? SmileBASIC API ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

SmileBASIC API

Quick jump: SiteJS plugin Credits Notice: 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:
  1. info - all files, shows information about the file provided (use ?json=1 if you're writing a program)
  2. list - only projects, lists all files
  3. 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
  4. raw - all files, downloads the raw file. However, some files are compressed and may require using the decompressed encoding instead
  5. text - only TXTs, text content of the file
  6. code - only TXTs, highlights code using 12Me21's SBHighlight library (use ?wrap=1 to enable word-wrapping)
  7. png - only GRPs, converts the GRP to a PNG
  8. csv - only <=2D DATs, converts the data to a CSV (comma-separated values) file
  9. downloads - all files, returns a PNG with the download count (download count is only updated every 24 hours)
  10. 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
  1. 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
  2. MasterR3C0RD - hosting, wrote the server communication libraries and helped with reverse engineering of SmileBASIC's servers
  3. 12Me21 - wrote sbhighlight and rewrote the SiteJS plugin to work with more browsers
  4. snail_ - working on proper documentation for API
  5. Yttria - word of reason, helped with multiple things internally
Author
MasterR3C0RD
Updated
Rating
21 votes
Categories
Keywords
  • sbapi
  • smilebasic
  • api
  • trinitro21
  • masterr3c0rd
  • brokenr3c0rd
  • file
  • format
  • png
  • grp
  • dat
  • txt
  • prj
  • projects
110 Comment(s) MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself The /Info endpoint is now a HTML webpage, supporting OpenGraph to make it embed all pretty like in Discord. Also, I fixed an issue with non-existent files where it said that the key was bad. Feel free to suggest more features here! banana banana RNG Hidden Easter Eggs Third Year My account is over 3 years old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength You could have a /poll endpoint (properly throttled obviously) so the information can be polled from SB servers on demand if any of this errors occur. MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself It's too unsafe to add such a functionality. Tarudahat Tarudahat OSP Contest 3 Contest Participant I participated in the third SmileBASIC Source OSP Contest! Forum Contributor Hidden Achievements Avatar Embargo I didn't change my avatar for 90 days Website Is it me or doesn't it work with some programs BC. I tested this http://sbapi.me/get/N3VX53ED/SUPER_BASIC/code and it said "Bad key" eventough it is correct :/ Midnight Midnight Deep Sleep Hidden Website http://sbapi.me/gui.html It works if you put the key here. Something... must be done wrong somehow and that error must be a default error or something...? 12Me21 12Me21 Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself You used the wrong filename first check http://sbapi.me/get/N3VX53ED/info (works) the real filename is TSUPER_BASIC http://sbapi.me/get/N3VX53ED/TSUPER_BASIC/code MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself Because of the way I wrote the server, "Bad key" is simply anytime something can't be found. Will fix this soon, give me a few hours. EDIT: Done! Wrong filenames now show "Bad filename" instead of "Bad key". Midnight Midnight Deep Sleep Hidden Website This is cool!! I can't believe you can check download count. I don't even think the app itself allows that, does it? MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself Nope, it doesn't. I wish it was visible though because it's super cool to know analytics wise. I might end up adding analytics for programs just for shits and giggles, but I'd have to gauge interest first (I don't want to waste my time doing something only for it to not get used ever) MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself I replaced the official SBS SiteJS with Snail's, which makes the plugin no longer silently fail on SB4 keys, and I also fixed the issue with a certain popular game's availability on SBAPI. I've poked around at SB4 API things when I wasn't busy and it's looking close to impossible to add SB4 compatibility. I don't have a Switch to do any real reverse engineering work on it though, so if anyone with CFW and SB4 is interesting in working on support, message me on Discord (@MasterR3C0RD#7695). Also, this project is serving a second function as a way to archive the entire SmileBASIC library. If anyone is interested in helping further this goal by providing a list of keys to back up, DM me on Discord. A huge thanks to everyone for the support I've gotten for this project. I am accepting donations to keep the server running now. If you're interested you can check my profile to find my PayPal. All donations are appreciated, but are not required to use this service. snail_ snail_ QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Updated the sitejs to include a sb4 mincompat check, now displays a helpful unsupported message instead of silently giving up random_god random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Forum Leader Hidden Achievements Thx you for the site js It's probably in SBAPI itself, but sometimes it says that the key doesn't work, when it does. (This has been mentioned before) MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself Never been reported to me, if you could give some examples I could do some looking around TheV360 TheV360 Pokemon Is Awesome! I love Pokemon! Express Yourself First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Here's one example: this page keeps reporting that the key doesn't exist, even though the developer has confirmed it is downloadable. HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website A fix by CY64 was also provided, but it trips up the check for keys that were actually removed. random_god random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Forum Leader Hidden Achievements Yeah basically virtual buffalo There was another one I saw, but I don't remember what it was. CyberYoshi64 CyberYoshi64 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Great Page Hidden Achievements
A fix by CY64 was also provided, but it trips up the check for keys that were actually removed.
Yeah, removed keys will just stuck saying that their info is loading though there aren't any infos to load...
MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself I'm thinking what happened is someone tried to check the key while SB servers were down for maintenance and it returned unavailable. I'll fix it when I get home. I've been really busy with school and work so...
kitesinpowerlines kitesinpowerlines Avatar Block I didn't change my avatar for 30 days. Website Avatar Embargo I didn't change my avatar for 90 days Website Avatar Taboo I didn't change my avatar for 180 days Website I don’t think it is documented here but there seems to be a required letter to preface the file name depending on the output. Examples: ...BBG_TIKI/png ...TN_SHARP/code CyberYoshi64 CyberYoshi64 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Great Page Hidden Achievements The prefix? Explained here. (see post below) And the code is comparable with the [CODE] bbcode here but without the rest of the page. random_god random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Forum Leader Hidden Achievements TEST Ok it failed To put a code image from this, do I need to screenshot? How do I put the image? chicken chicken the website returns a SB-like code preview, so yes, you have to screenshot it. random_god random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Forum Leader Hidden Achievements Ok. I find that kinda dumb, because honestly it's easier to just screenshot the code directly on SB. chicken chicken it's so you can copy-paste and use a mouse and stuff on pc random_god random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Forum Leader Hidden Achievements Yeah. The problem with that for me is that almost always, I'm using a 3ds to post here. TheV360 TheV360 Pokemon Is Awesome! I love Pokemon! Express Yourself First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself Feature suggestion: add an option to zip downloads that adds a text file to the project containing metadata such as the key, author, size, date downloaded, downloads, etc. It could also use a character that isn't on the SmileBASIC filename keyboard, to decrease the likelihood of a file name clash. This would help make the preservation process easier. Speaking of that, has anyone built a key scraper yet, for sites like SBS, the Japanese wiki, the official key repository, and the Twitter hashtag? HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Pretty sure 12 already made one for an experiment he did Not sure about the wiki or Twitter Now that I think about it, what will we do when eventually we hear about SB3's servers closing? With the 3DS basically dying, it's bound to happen soon in favor of SB4, which may attract a much larger user base due to being on the Switch. I kind of thought of something, but I don't know if it will work. I could create an account for archive.org specifically for archiving SmileBASIC's servers. Using SBAPI, we can scrape keys and get the raw data from them (we should also release tools convert files like SBAPI does). These projects/files can then be put into a new entry in the archive.org database, with a lot of folders that are named after projects/files' public keys. If a key only contains a single file, it should be put into a new folder named after its key, with the name of the file intact. The project names should be changed to the public key, but the files inside the project (folder) should have their names intact. Sorry if any of my wording above is wrong, I'm really tired rn and I need to get some sleep :P I don't even know if the sentence above is worded right. Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Omg Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies So, if a SmileBASIC interpreter were created, it can have all functionality of the original application Elijah Elijah Deep Sleep Hidden Website Avatar Taboo I didn't change my avatar for 180 days Website First Year My account is over 1 year old Website S Bapi And its comic sans bruh And youre on a chromebook HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website S Bapi random_god random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Forum Leader Hidden Achievements Sba Pi (Sba 3.141592653589793238462643383269502884197169399375105820974944592307816406208208998) banana banana RNG Hidden Easter Eggs Third Year My account is over 3 years old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength sb + ap*i random_god random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Forum Leader Hidden Achievements Nice Why am I seeing this now? random_god random_god Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Second Year My account is over 2 years old Website Forum Leader Hidden Achievements Hilarious: http://sbapi.me/get/(key)/downloads the_squat1115 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
They're planning to make it compatible with SB4
Oh, thank god.
the_squat1115 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Hey, MasterR3c0rd, I had made a concept for a new GUI that I think will be much simple to search a program without putting the key, and make it fullscreen compat. Yea, it's just a concept... HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Good concept, but a search function would be nearly impossible to implement, at least without having a preloaded list of project names. Not to be rude, but that’s kind of unneeded though, since that’s kind of what the point of this site is. the_squat1115 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies The "Search" thing is just for searching the programs ADDED plus NOT ALL without having to search and put the key. 12Me21 12Me21 Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself being able to search the SBAPI cache would be pretty nice HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Would you be able to implement it? I would like a feature like this.
HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website How are the Switch servers set up (how are they different from the SB3 servers)? MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself It's not the SmileBoom side, rather, it's the Nintendo side. They completely changed the way they handle logging into accounts, requiring a client certificate as far as I can tell (which is unique to every console). As such, it would be easy to ban the client and Switch. I'm hoping to figure out a way to get this working without having to fake a console (I contacted SmileBoom in the hopes to resolve this last year, and I've just sent them a new inquiry on their website, so I hope I'll hear back from them) HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website That’s an ouch. I guess Nintendo had a problem with SmileBoom hosting their own servers for downloading and uploading programs. Either that or it was too much money to run, which might mean that the SB3 servers are closing soon. snail_ snail_ QSP Contest 1 Contest Participant I participated in the first SmileBASIC Source QSP Contest! Helper Received for being very helpful around SmileBASIC Source Achievements Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Smileboom still runs their own servers. For compliance with Nintendo online features and Nintendo Account authentication, they have to communicate with Nintendo before connecting to their own server. That's how the uploads are tied to your Nintendo Account. HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Oh, my bad. I hope there’s a way we can get SBAPI working for SB4. I’m sure there’s a way. the_squat1115 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Wait, SBAPI will not work with SB4? ...ouch... IAmRalsei IAmRalsei Forum Leader Hidden Achievements First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength They're planning on making it compatible with SB4, They just haven't figured out how yet. banana banana RNG Hidden Easter Eggs Third Year My account is over 3 years old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength I guess SBAPI for SB4 could use a generously donated modded Switch to access the servers, but that would be prone to bans... I don't know it's just a proof of concept. Midnight Midnight Deep Sleep Hidden Website that's like... amazing tbh HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Can 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. IAmRalsei IAmRalsei Forum Leader Hidden Achievements First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength GRPs can be converted to PNG already.
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:
Also, TXT/PRG files can be opened in Wordpad and you can convert the program by simply saving it as a TXT file.
HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website I know, but you have to convert each one individually, which is annoying when downloading large projects. MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself I'll work at adding this when I get the chance. MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself Added. 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. HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Can 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?
Tarudahat Tarudahat OSP Contest 3 Contest Participant I participated in the third SmileBASIC Source OSP Contest! Forum Contributor Hidden Achievements Avatar Embargo I didn't change my avatar for 90 days Website A question: How do I download a full game (with all the code and grps) to a computer? chicken chicken http://sbapi.me/get/KEYHERE/zip HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Suggestion: Add decompression support for .PKD format compressed files. MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself That'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. HTV04 HTV04 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Okay, thanks for the response. Is there any documentation on how .PKD files are packed and how its compression methods could be ported to PC? MasterR3C0RD MasterR3C0RD Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself I have absolutely no idea, you'd have to look at the unpacker and figure it out yourself.
1 2 3