Skip to content
← Back to Community
Replit DataBase/API
Profile icon
StevesGreatness

What I mean by a Replit DB is if Replit has made something like the "Rest API."

I found the answer on my own.

Voters
Profile icon
StevesGreatness
Comments
hotnewtop
Profile icon
Coder100

Nope, but you can use my json store thingy:
https://replit.com/talk/share/Easy-Web-Database/137962

Profile icon
RayhanADev

Hiya @StevesGreatness

Replit has a few dozen APIs, if you're asking about ReplDB's API I'd take a look at the source code (https://github.com/cursorweb/repl.it-db) to see the endpoints.

If you want to know about the other APIs there is a Restful API but that is typically used for Replit meta and Container connections. The GraphQL API is useful for projects integrating Replit, take a look at ReplAPI.it an API package I made (keep in mind its under a revision and currently broken: https://github.com/ReplAPI-it/ReplAPI.it-NodeJS/tree/c9f37b4f5f24fc51af4f4859db9f3808da10ef7f/esm/src/classes) that should give you some information about the different queries :).

If you have any specific questions or use cases I can try to answer them for you!

Profile icon
StevesGreatness

@RayhanADev does the nodejs api also support vanilla js(in conjunction with html and css)?
note: I have no idea how nodejs works...

Profile icon
Coder100

no node.js is the backend version, the stuff that powers the HTML @StevesGreatness

Profile icon
RayhanADev

@StevesGreatness nah and I can't assure you that it'd work rn anyways, but if you need a basic implementation:

async function getMyCycles() { const data = await fetch('https://replit.com/graphql', { method: 'POST', headers: { 'X-Requested-With': 'RayhanADev', 'Referrer': 'https://replit.com/' }, body: JSON.stringify({ query: `query UserCycles($username: String!) { userByUsername(username: $username) { karma } }`, variables: JSON.stringify({ username: 'RayhanADev' }) }) }); if(res.status !== 200) throw new Error('Something went wrong!'); return await res.json(); }