Skip to content
← Back to Community
Simple Replit User API
Profile icon
PYer

Deprecated | Hello everyone! I haven't been active for a long time considering everything that's going on. I did get bored and created this quickly. I often create repls that interact with data about real replit users. With that in mind I decided to create a simple API, not too complicated, that would give basic information on a repl.it user.

There are probably already a few others out there

To use the api, you can scrape that data with requests module, by going to the url https://replit-user-api.pyer.repl.co/get?user=<PUT_USERNAME_HERE>

If you just want to test the api, you can get an edited version of the data that is more pleasant to look at by replacing the get with view. https://replit-user-api.pyer.repl.co/view?user=<PUT_USERNAME_HERE>

For example, the data will be raw here: https://replit-user-api.pyer.repl.co/get?user=PYer

To get it cleaner, go to: https://replit-user-api.pyer.repl.co/view?user=PYer

Thanks! I hope you will find a use for this someday!

Source Code: The repl linked is an example of using the API, to look at the source code for the API itself, go to: Repl.it User Api

Voters
Profile icon
programmeruser
Profile icon
GavinYe
Profile icon
CoolJames1610
Profile icon
Acer123
Profile icon
catherinebish
Profile icon
PowerCoder
Profile icon
Pythonier
Profile icon
codingmaster123
Profile icon
2020587
Profile icon
N3rdL0rd
Comments
hotnewtop
Profile icon
[deleted]

ha imagine using string1 + string2 instead of f'{string1}{string2}' cool api otherwise

Profile icon
PYer

Imagine... @sugarfi

Profile icon
[deleted]

Imagine that coding did not exist.

Nooooooooooo!!!

@PYer

Profile icon
PYer
Profile icon
[deleted]

Thank you, thank you! @PYer

Profile icon
imacceol

i don't really have enough knowledge of python to understand what is happening in the repl, the API source code itself looks more complicated What does the requests module do? is there a docs somewhere i can look at?

Profile icon
PYer

Hey! The requests module basically opens up a webpage and gathers data from it. My first result when I searched for a doc can be found at Requests: HTTP For Humans
The API itself uses similar modules as well. Glad you liked the project, and if you have any other questions, please ask me.

Profile icon
imacceol

@PYer k thanks I'll look into it

Profile icon
nullified

Haha I made your 2727 cycles into 2728

Profile icon
PYer
Profile icon
gantr833

Kind of slow but cool. Here's an upvote.

Profile icon
PYer

thanks @gantr833. The speed could improve depending on the type of computer you use. the speed is hard to improve majorily. With some slight changes, i might be able to knock off a few milliseconds :) If I find a way to make it much faster, i will try it out.

Profile icon
hg0428

Broken

Profile icon
PYer

The project is from 2 years ago, and updates have since been made that prevent the outdated code from functioning properly. If you want to look into it, it should be easy to fix. @hg0428

Profile icon
Botman2424

All i'm getting is {"error": "'NoneType' object is not subscriptable"}

Profile icon
ApoorvAgrawal

You should make it so that instead of manually having to change the code, take user input and then if the user doesn't exist, using a try-except send a error message

Profile icon
PYer

The repl attached is just a quick example of how to use it. It isn't the main focus of the post. The part that I really want to share is the API itself. The attached repl just demonstrates that it can be done, and shows an easy way to use it. @ApoorvAgrawal

Profile icon
haysaderhold

What does this do

Profile icon
PYer

Hey, @haysaderhold! This project allows you to access simple variables defined by a repl.it user. For example, you could use the API to access the amount of cycles somebody has, or to reveal their bio or profile picture. I made a repl that shows how to use it, https://repl.it/@PYer/Using-simple-replit-api. Ask if you have any other questions or if you don't understand.

Profile icon
jackou

I made it so that you could forever input a username and give the results:

https://repl.it/@JacksonPhilips/Using-simple-replit-api-but-theres-custom-input

:)

Profile icon
jackou

@JacksonPhilips NOTE: I do not intend to steal this program, I'm just recycling and reusing it. :)

Profile icon
PYer

Yeah, cool project. @JacksonPhilips
Even if you posted it and "stole this program" it would be fine. I even said,

I hope you will find a use for this someday!

Cool program though!

Profile icon
imcraft

@JacksonPhilips I made something similar to yours. You should check it out!

https://repl.it/@imcraft/Replit-User-Search

Profile icon
PYer

yeah i saw it! @imcraft

Profile icon
DJWang

I'm speechless

Profile icon
Coder100

Nice work!
Was graphQL working for you?

Profile icon
PYer

lol I don't even know it. I was just messing around with the thing and copying what you typed :) @Coder100

Profile icon
Coder100

lol :P
why is it only me who can't access it ;( @PYer

Profile icon
Coder100

looks at code
You literally parsed the HTML? lol
@PYer

Profile icon
PYer

lol, i was bored so i just did [email protected]

Profile icon
Coder100
Profile icon
PYer

If you want to see the source code for the API itself, it can be found at Repl.it User Api

Profile icon
[deleted]

How do I use it? @PYer

Profile icon
PYer

How do you use what? @CodeABC123

Profile icon
[deleted]

The repl.it user api. @PYer

Profile icon
PYer

The repl I linked should describe it, https://repl.it/@PYer/Using-simple-replit-api @CodeABC123 Is that not what you are looking for?

Profile icon
PYer

@CodeABC123 That repl doesn't really interact with the user. It does print out the user's information when asked for it. When you use the requests module (in the other repl "Using simple repl.it api"), it access the flask server that is created using the repl "replit-user-api". Then it gets the dictionary that is returned through the flask server, and uses it in the repl ("Using simple repl.it api").

Does that make sense?

Profile icon
[deleted]

Yes. @PYer

Profile icon
PYer

Okay! Feel free to ask me if you have any other questions. (I may not be online though) @CodeABC123

Profile icon
[deleted]

How do I get more complicated info? @PYer

Profile icon
PYer

on how the API works? @CodeABC123

Profile icon
[deleted]

Yes. @PYer

Profile icon
PYer

Sorry I haven't responded quickly. One tutorial that I liked by @LeonDoesCode, https://repl.it/talk/learn/Using-Web-APIs-in-Python/20777 is really good and goes through using a wikipedia api. @CodeABC123 If you want to learn to create your own API, I found one here https://programminghistorian.org/en/lessons/creating-apis-with-python-and-flask. I haven't personally read through this one, but it is the first search result, and I also got the link from a friend who used it.