? SmileBASIC API ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

SmileBASIC API

Quick jump: SiteJS plugin Credits 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
48 Comment(s) codinginept codinginept Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Video Games I like to play video games! Hobbies Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself i like the name sbapi 1 2