Quick jump:
SiteJS pluginCreditsNotice: Due to the way the Switch servers are set up, it is incredibly unlikely that SBAPI will ever support SmileBASIC 4. Research will continue to see if we can get anything working but we need your help. If you have a Nintendo Switch with Custom Firmware and you own SmileBASIC 4, I humbly request you contact me on Discord (@MasterR3C0RD#7695).
I provide this service free of charge, and pay for the server to run it out of pocket. Donations to maintain the server and pay for my caffeinated beverages are not required, but appreciated. If you enjoy this service and want to help keep the server running, there's a link on my userpage to donate.NEW: There's now a GUI by 12Me21 to make browsing projects easier. You can access it at http://sbapi.me/gui.html
SmileBASIC API (SBAPI) is a service created by me (MasterR3C0RD) and triangle, with help from Yttria, 12Me21, and snail_, that allows you to get info for and download programs directly from SmileBASIC 3 servers. Not only is this useful for moderators to check if a key is still available, it also allows users to post GRPs to the forums as a PNG.
Everything in SBAPI is simply a URL. The basic URL format for keys is http://sbapi.me/get/(key)[/(filename)]/(encoding), where anything in [] is optional and anything in () is required. key should be replaced with the public key, and filename allows you to choose a specific file if the key is a project. The encoding is required and can be one of the following:
info - all files, shows information about the file provided (use ?json=1 if you're writing a program)
list - only projects, lists all files
zip - only projects, download all files from the project as a ZIP file. If you want to convert files to their preferred format (ex, GRP -> PNG, TXT -> Text), add ?nice=1
raw - all files, downloads the raw file. However, some files are compressed and may require using the decompressed encoding instead
csv - only <=2D DATs, converts the data to a CSV (comma-separated values) file
downloads - all files, returns a PNG with the download count (download count is only updated every 24 hours)
encodings - all files, returns JSON array with all possible encodings for the file given
Other encodings may be added in the future.
Uses:Disclaimer: Authors of projects or assets displayed on this page are not associated with and have not contributed to the SmileBASIC API project.
This can be used when asking people to debug code on the forums. Posting a public key and a link to the code could make debugging much easier.
Example:http://sbapi.me/get/CKANY53Y/TN_SHARP/code (Phil's N# compiler)
Output:
Wanting to show off your sprites is another possible use. Simply use the PNG endpoint.
Example:http://sbapi.me/get/4DH5P4K3/BBG_TIKI/png (sprites from cujo1992's Tiki Descent)
Output:
You can also back up your project as a ZIP file if you need to be sure you'll always have it.
Example:http://sbapi.me/get/P3T43E3V/zip (kantackistan's Virtual Buffalo)
Output:
Don't forget a download counter to gauge how popular your programs are! Note that the download count is not real time, and only updates every 24 hours.
Example:http://sbapi.me/get/QK4N3PZF/downloads (calc84maniac's Spooky Maze Raycaster demo)
Output:Optional SiteJS:
If you think it's too much of a hassle to have to go through the API to check out information about programs, you have a similar mindset to I. That's why I wrote a SiteJS, available at http://sbapi.me/sbapi-sbs.js that adds an extra section to pages that looks something like this:
Simply copy and paste the contents into your SiteJS and load up a program page. After a few seconds, the information will load and be shown on the page.
Note that for the moment, it only works on newer versions of Chrome and Firefox due to using newer JavaScript features, but this could change in the future. Thanks to 12Me21, it now works on most browsers, including Internet Explorer and even the 3DS browser!
Credits
triangle - file format guru, wrote the file parser used for SB files and other parts of code, and most of reverse engineering of SmileBASIC's servers, donated 3DS information for the server
MasterR3C0RD - hosting, wrote the server communication libraries and helped with reverse engineering of SmileBASIC's servers
12Me21 - wrote sbhighlight and rewrote the SiteJS plugin to work with more browsers
snail_ - working on proper documentation for API
Yttria - word of reason, helped with multiple things internally
132 Comment(s)HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteCan you add an encoding that allows projects to be downloaded with txts that have no metadata and GRPs that are converted to png? The reason why I'm asking is because I would like to use this with otyasmilebasic.ralseiForum LeaderHiddenAchievementsSecond YearMy account is over 2 years oldWebsiteExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthGRPs can be converted to PNG already.
Also, TXT/PRG files can be opened in Wordpad and you can convert the program by simply saving it as a TXT file.HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteI know, but you have to convert each one individually, which is annoying when downloading large projects.MasterR3C0RDAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsThird YearMy account is over 3 years oldWebsiteosu! Is Awesome!I love osu!Express YourselfI'll work at adding this when I get the chance.MasterR3C0RDAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsThird YearMy account is over 3 years oldWebsiteosu! Is Awesome!I love osu!Express YourselfAdded. You can add ?nice=1 to the end of the zip encoding URL, and it'll download it as a nicer ZIP file. Note that certain files (DAT files with > 2 dimensions) will stay raw.HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteCan you add an option to keep DATs raw? CSV DATs aren't compatible with otya.
By the way, do raw DATs work well with PetitModem?TarudahatOSP Contest 3 Contest ParticipantI participated in the third SmileBASIC Source OSP Contest!Forum ContributorHiddenAchievementsAvatar EmbargoI didn't change my avatar for 90 daysWebsiteA question: How do I download a full game (with all the code and grps) to a computer?chickenAdminhttp://sbapi.me/get/KEYHERE/zipHTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteSuggestion: Add decompression support for .PKD format compressed files.MasterR3C0RDAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsThird YearMy account is over 3 years oldWebsiteosu! Is Awesome!I love osu!Express YourselfThat's outside of the scope of what SBAPI should do.
SBAPI is only meant to get files and convert them to file types that make sense, not to become a be-all end-all of SmileBASIC PC tools. That would be nice, but it would take forever and no one would really use it.HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteOkay, thanks for the response. Is there any documentation on how .PKD files are packed and how its compression methods could be ported to PC?MasterR3C0RDAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsThird YearMy account is over 3 years oldWebsiteosu! Is Awesome!I love osu!Express YourselfI have absolutely no idea, you'd have to look at the unpacker and figure it out yourself. MasterR3C0RDAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsThird YearMy account is over 3 years oldWebsiteosu! Is Awesome!I love osu!Express YourselfJust want to note that we're still looking for people with SmileBASIC 4 and a hacked Switch to help with adding support for SB Switch keys on SBAPI. If you have what's needed and you're interested, please DM on Discord (@MasterR3C0RD#7695), send me a Site PM, or message me in the SBS Chat.TheV360Pokemon Is Awesome!I love Pokemon!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteNight PersonI like the quiet night and sleep late.Express YourselfBug: Seems like some of the metadata disappeared. This is only when I use the zip option.
When I download keys that only contain one file (not even a folder) the metadata is intact.MasterR3C0RDAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!AchievementsThird YearMy account is over 3 years oldWebsiteosu! Is Awesome!I love osu!Express YourselfIt's because SB removes file metadata when it makes a project. I'll have this fixed ASAPCyberYoshi64Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthNight PersonI like the quiet night and sleep late.Express YourselfGreat PageHiddenAchievementsI love it.
Without it, I wouldn't be able to transfer my programs to my tablet because I don't have any PC any time soon.Okay, I could write out each byte one at a time and on GRPs one pixel at a time but typing it in using no actual keyboard is horrible if not, it would take years to even get my projects on my device, when it doesn't fail...HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteHow do I transfer binary and GRP files back to my 3DS via PetitModem? Is the file structure different, or is it the same as sending a DAT/GRP file to PC via PetitModem?ralseiForum LeaderHiddenAchievementsSecond YearMy account is over 2 years oldWebsiteExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthWhat time zone is used for the upload times in the SiteJS version?12Me21Power UserSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfThe timezone of whoever uploaded the filesralseiForum LeaderHiddenAchievementsSecond YearMy account is over 2 years oldWebsiteExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthkHTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteFor anyone using the SiteJS, if you want to use MB (megabytes) and KB (kilobytes) instead, change the 1024 values to 1000, and rename the MiB value to MB.12Me21Power UserSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfAlso, the K should technically be lowercase.HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteEh, I personally left it the same because I’m used to having it uppercase (other devices use capital K). But a lowercase K is the correct way.the_squat1115Minecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesLol, that is a mature themeHTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteUse the reply button, please.
You probably can’t see it right now, so head to your settings page, and disable the checkmark for hiding options on comments. You should be able to reply to comments now.HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteAlso whatphotonegativemickeyMinecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesHe looked at the meme I posted in a replyHTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteOh lolthe_squat1115Minecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesOhphotonegativemickeyMinecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesTarudahatOSP Contest 3 Contest ParticipantI participated in the third SmileBASIC Source OSP Contest!Forum ContributorHiddenAchievementsAvatar EmbargoI didn't change my avatar for 90 daysWebsiteThis is very useful thanks for submitting this the_squat1115Minecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesBut I cant get it...photonegativemickeyMinecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!Hobbies2 things, 1 congrats on using the reply button, and second of all, you need a pc or a laptop or some sort of computer to use itthe_squat1115Minecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesOh, okphotonegativemickeyMinecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesphotonegativemickeyMinecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!Hobbiesclick the reply button on commentsthe_squat1115Minecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesThe key of thisphotonegativemickeyMinecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesIt doesn’t work on a keythe_squat1115Minecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesAnd where's the key?TheV360Pokemon Is Awesome!I love Pokemon!Express YourselfFirst DayJoined on the very first day of SmileBASIC SourceWebsiteNight PersonI like the quiet night and sleep late.Express YourselfHover or tap your previous comment and a reply button will appear. You can use that to clean up chains of comments so people don't have to read them backwards.
Also note that there is an edit button, to correct mistakes and clarify details.the_squat1115Minecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesI was talking about without a PCthe_squat1115Minecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesIn that API, is there a Wav to SB Wav converter?HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteI think you mean the other way around, but just use Perska’s tool if you want to convert WAVs to SB WAVs.HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteThis is really cool! Using this tool, it would be 10x easier to archive the SmileBASIC servers in case they go down.the_squat1115Minecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesIt defeats one of its purposes?HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsitePlease reply next time, and I meant the 3DS to PC part of PetitModem. With this, all you would have to do to port SB programs to PC is use SBAPI.HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteRIP Petit Modem I guess
(Well, at least the 3DS->PC part)photonegativemickeyMinecraft Is Awesome!I love Minecraft!Express YourselfIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthVideo GamesI like to play video games!HobbiesWait what happened to petit modem?HTV04Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthAvatar TabooI didn't change my avatar for 180 daysWebsiteSecond YearMy account is over 2 years oldWebsiteNothing, this just defeats one of its purposes.
1
2
3