? SmileBASIC API ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

SmileBASIC API

Quick jump: SiteJS plugin Credits NOTE: This doesn't yet work with SB4 (Switch SB). We're looking for people with the software that also have CFW that would be willing to help with reverse engineering the new servers. If you're interested and you have what we need, message me on Discord (MasterR3C0RD#7695). 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 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
  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
11 votes
Categories
Keywords
  • sbapi
  • smilebasic
  • api
  • trinitro21
  • masterr3c0rd
  • brokenr3c0rd
  • file
  • format
  • png
  • grp
  • dat
  • txt
  • prj
  • projects
49 Comment(s) MasterR3C0RD MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself Just 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. 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 Bug: 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. MasterR3C0RD MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself It's because SB removes file metadata when it makes a project. I'll have this fixed ASAP 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 I 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... 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 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? 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 Also, could you add a blocks (bytes/512) value alongside the mb and kb values for files in a project (as well as the project itself) for both the API and the SiteJS? 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 What time zone is used for the upload times in the SiteJS version? 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 The timezone of whoever uploaded the files 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 k 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 For 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. 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 Also, the K should technically be lowercase. 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 Eh, 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_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 Lol, that is a mature theme 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 Use 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. 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 Also what photonegativemickey photonegativemickey 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 He looked at the meme I posted in a reply 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 lol 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 Oh photonegativemickey photonegativemickey 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 Tarudahat Tarudahat Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself OSP Contest 3 Contest Participant I participated in the third SmileBASIC Source OSP Contest! RNG Hidden Easter Eggs This is very useful thanks for submitting this 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 But I cant get it... photonegativemickey photonegativemickey 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 2 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 it 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 Oh, ok photonegativemickey photonegativemickey 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 photonegativemickey photonegativemickey 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 click the reply button on comments 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 key of this photonegativemickey photonegativemickey 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 It doesn’t work on a key 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 And where's the key? 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 Hover 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_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 I was talking about without a PC 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 In that API, is there a Wav to SB Wav converter? 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 think you mean the other way around, but just use Perska’s tool if you want to convert WAVs to SB WAVs. 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 This is really cool! Using this tool, it would be 10x easier to archive the SmileBASIC servers in case they go down. 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 It defeats one of its purposes? 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 Please 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. 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 RIP Petit Modem I guess (Well, at least the 3DS->PC part) photonegativemickey photonegativemickey 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 what happened to petit modem? 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 Nothing, this just defeats one of its purposes. kantackistan kantackistan Neat! Wish I had this last week, then I wouldn't have spent hours with Petit Modem... Would you consider adding horizontal scrolling to the code viewer? Word wrapping is great but it doesn't help much on gigantic MML strings or animations without whitespaces. MasterR3C0RD MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself Gotcha, I'll get that fixed for you EDIT: There you go! By default, code doesn't wrap, so add ?wrap=1 to the end of the URL if you do want it. 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 Since the code view is really just for presentation, you could add a toggleable word wrap button. kantackistan kantackistan Excellent, thanks MasterR3C0RD MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself Next thing to add is a way for people to add download counters to their pages, might be useful-ish Sam Sam Amazing Page Hidden Achievements Great Page Hidden Achievements Good Page Hidden Achievements I wasn't asked for permission to have my program be showcased here (which I don't mind: people can do whatever they want with any program), but as the epic grand dad memer himself, I just want to let people know that I do not actually approve of this whole hacking thing. MasterR3C0RD MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself Sorry for not asking for permission first, I didn't really think that part through. Maybe everything is public in SB, but this is a separate thing so I'd prefer not to use graphics that other people don't want displayed Sam Sam Amazing Page Hidden Achievements Great Page Hidden Achievements Good Page Hidden Achievements (I'd delete my comment now that we're gucci but I can't.) Thanks fam 1 2