Replit restful API to enable inspection/edits on my own repls (list, rename, delete, etc.)

Hi Folks,

Does anyone have a working piece of code that generates a list of their own repls via a restful API call?

I’m not looking for speculations since I’ve done some testing… wondering if any knows for sure if there’s a way to do this.

Thanks!

1 Like

You can definitely do it with GraphQL, however I don’t believe that Replers (apart from Replit mods and staff) are actually allowed to use it (except with permission).

I don’t have any access to some private API or any thing to my knowledge. The only stuff I get for being a mod is only here on Ask

1 Like

I meant mods on the actual Replit site, not Replit Ask.

1 Like

Hi @cstutormarin, there used to be API points for accessing a user’s or a repl’s data, but it looks like they are partially deprecated.

The one for repls still works for now (like https://replit.com/data/repls/@nathanTi/Spotify-API), but the one for users doesn’t (e.g. https://replit.com/data/profiles/nathanTi).

You can access this info using GrapgQL, as @MattDESTROYER said.

You can copy this into the query:

query ProfilePublicRepls ($username: String !, $after: String, $search: String) {
  user : userByUsername(username : $username) {
    id
    profileRepls (after : $after, search : $search) {
      items {
        id
        url
        user {
          id
          url
        }
      }
      pageInfo {
        hasNextPage
        nextCursor
      }
    }
  }
}

with this object in the variables, knowing that the key username allows you to change the username for which you want the information, after the cursor to get the next repls, and search allows you to search for repls among those of the user.

{"username":"nathanTi","after":"","search":""}

You can test it here https://graphql-playground.pikachub2005.repl.co/, and click on the button labeled Copy as fetch to get a piece of working code (in nodejs) to fetch the info you want.

Hope it helps :wink:

2 Likes