Share your repls and programming experiences

← Back to all posts
ReplAPI
codingjlu (481)

ReplAPI

A Node.js server to get almost any information about a given username (besides their passwords of course).

API

Go to https://replapi.codingjlu.repl.co/user/Coder100. There you'll find some JSON to work with:

  • username - The username of whoever you're requesting
  • name - If the user has a set name for their account; otherwise it will return null
  • cycles - Amount of cycles the user has
  • pfp - The url to the user's profile picture
  • repls - An array of the user's top ten repls (I can't figure out how to request all the repls yet). Inside the array we have:
    • name - The name of the repl
    • link - The full link to the repl
    • lang - The language of the repl
    • desc - The description of the repl. If none, you will get null
  • badges - An array of badges the user has, in Coder100's case hacker and content creator
  • bio - The bio/description of the user, if any (otherwise it returns null)
  • posts - The last but definitely not the least. This returns all the posts the user has posted. Inside this array we have:
    • title - The title of the user's post
    • url - The url to the user's post
    • votes - An integer representing how many votes the post has
    • category - The category of the user's post
    • replName - The name of the repl in the user's post. Returns null if none
    • replUrl - The url of the repl in the user's post. Returns null if none
    • replLang - The language of the repl in the user's post. Returns null if none
    • comments - An integer representing how many comments the post has
    • desc - The first few words/sentences/phrases/paragraphs of the post

And of course, you don't have to use it on Coder100. Enter any username: https://replapi.codingjlu.repl.co/user/USERNAME.

Options

You can pass query strings to the URL for certain options:

  • callback=functionName - If you seriously want to do JSONP, you can specify the name of the function and it will be passed to it in a JSON array
  • <nameOfObject>=0 - Don't include that in the result, e.g. if you don't want the posts: posts=0

Example: https://replapi.codingjlu.repl.co/user/Coder100?callback=myFunc&posts=0&badges=0

Some helpful info

  • The route is CORS enabled

Repo

https://github.com/codingjlu/ReplAPI

License

MIT

If you like it

Please upvote!

Note: I'm open to suggestions and improvements. Feel free to comment ⬇

ANDDDDDDDD... we have an honorable mention: @candies

Without him I wouldn't have made this! (ping as promised xD)

Comments
hotnewtop
candies (429)

thanks. this deserves a lot of more recognition

codingjlu (481)

@candies do you happen to know @Codemen and @ApiKeyis838477s ? lol all of my comments have 4 upvotes xD

candies (429)

@codingjlu i know i told them to upvote :)

EpicCodeWizard (12)

@codingjlu Here's a faster way to fetch user info, just make a GET request to https://replit-user-info-api.epiccodewizard.repl.co/@USERNAME. It will return a lotta info in a short time. Add ?count=true for the number of posts, comments, and repls.

SilvermoonCat (458)

huh. that seems kinda like this lol

codingjlu (481)

@SilvermoonCat lol I've never seen that project before. And notice theirs is Python and mine is Node. I bet the way we did it was different too.

codingjlu (481)

@SilvermoonCat and probably my project returns different info than theirs.

SilvermoonCat (458)

@codingjlu I’m not saying you copied
I’m just noticing the names are same haha

programmeruser (615)

You know there's an easier way than scraping profile pages

codingjlu (481)

@programmeruser graphql? lol idk what it really is actually

ruiwenge2 (1107)

nice! it just takes a long time to load.

codingjlu (481)

@ruiwenge2 yeah... just specify what you don't want and it will load a lot faster

ruiwenge2 (1107)

btw look at our replshowcase project @codingjlu

codingjlu (481)

@ruiwenge2 the query strings, e.g. ?posts=0. Just try it

codingjlu (481)

@ruiwenge2 so it works huh? pretty cool?