ReplFiles! ~ Fetch ANY File from a Public Repl
Hiya! It's Ray. Here's
Fetch ANY File from a Public Repl
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/slug.zip, 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:
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. ReplAPI.it integration with this API is on it's way >:)