Share your repls and programming experiences

← Back to all posts
ReplFiles! ~ Fetch ANY File from a Public Repl
RayhanADev (2513)

Hiya! It's Ray. Here's


Fetch ANY File from a Public Repl

Check out the API here
Quick Preview/Proof-of-Concept here


This is perhaps one of the more useful API's I've made for the Replit Community. I myself have always wanted to get files on a Repl, but (to my knowledge) there is no API endpoint or query to get files...

That's when @stungeye asked on the Feedback board for a tool to archive all Repls a Replit user has made. I set out to make such a tool and ended up with ArchiveIt. It fetches a .zip file available for every Repl at /@username/, unzips the file to a folder, and then zips up the full folder of Repls.

It then dawned on me that I had access to EVERY file from those Repls. The NodeJS package Adm-Zip also makes accessing the content of all these files dirt simple. This trail led me to make this simple API that allows you to access any file, on any public Repl!

OKAY storytime over, here's how to use it :)


The API has two endpoints:

  • /file/{username}/{repl-slug}
  • and /files/{username}/{repl-slug}

The former is used for fetching a specific file. It returns an array with the file contents.

You can also attach a raw=1 query to output the raw text without stringifying and nonsense.


The latter is used to get ALL files from a Repl. It returns an array with all files in a Repl. This uses a .gitignore file if present to filter out files.

and it's as simple as that! If you have any suggestions or ideas let me know in the comments below. Until next time :D.

P.S. integration with this API is on it's way >:)


These APIs just keep getting more interesting

DynamicSquid (4893)

Nice! That's something interesting I never thought of!

Coder100 (18071)


but here's the question:
what if the user didn't rename the file and replit, as the bug still exists, doesn't get the file?

RayhanADev (2513)

@Coder100 :>? Please elaborate because I'm curious.

Coder100 (18071)

So basically, if you don't rename the file, replit doesn't actually include that file in the zip. This is only for things like user-uploaded files or programmatically created files @RayhanADev

RayhanADev (2513)

@Coder100 I did not know that :>
oh wait, I think I remember the old post on the old canny bug board

Yeah I can't really help with that since this is the only option that I know of :C. Do you have any ideas?

Coder100 (18071)

Crosis ded
Well this is actually a really good way of doing it, just with that caveat xd @RayhanADev

RayhanADev (2513)

@Coder100 oof, I always wanted to use Crosis, never got the chance.
thx :3, I'll stick with this for now and think of any other ideas

ch1ck3n (2035)


but you realize you can use this too right??<repl slug>/<file name>

RayhanADev (2513)

@ch1ck3n what? How do I even use that lol


RayhanADev (2513)

@ch1ck3n after messing around it seems that replbox is just a sandbox to run web repls???

RayhanADev (2513)

@ch1ck3n lmfao

ch1ck3n (2035)



a potato knows

( feedback on the css pls)

RayhanADev (2513)

@ch1ck3n very, very nice!
Also I do believe chrome://dino is a valid url >:)

RayhanADev (2513)

Hey @ch1ck3n, you seem to be very versed in poking around Replit (actually the entire Blog class exists solely because of you LOL!) and you're really good at using Node/Web. Are you interested in joining the Project? I'm looking to get more people in on the project and I wanted to ask you first.

ch1ck3n (2035)

@RayhanADev and what exactly does that do and what do I have to do with it

RayhanADev (2513)

@ch1ck3n lol it just reads the blog rss feed, the existence of which I only know because of you (cough the post I made like a week or two ago)

RayhanADev (2513)

@ch1ck3n so what do you say, interested?

Enter y or n to continue...

RoBlockHead (520)

and what's the point of this as opposed to manually getting the file?

RayhanADev (2513)

@RoBlockHead are you asking for a use case?
Well say I wanted to get a file on someone else's Repl from my NodeJS application (maybe like a gallery of different user's projects and it shows project info and project code). Instead of finding the Repl and copy-pasting the code or using webscraping (yuck) there's an actual API to get the contents of a file, and it's easy to use :D!

I hope that makes sense...

RayhanADev (2513)

@RoBlockHead it's kinda similar to the usage of You can get the content of a file in a github repo through fetching the url.