GitHub API: Fetch all folders and Files in Single GET Request

The only way to do it with a single request is to get the current contents as an archive: https://docs.github.com/en/rest/reference/repos#download-a-repository-archive

Actually, it's 2 requests since the initial response is a 302 redirect.


You would have to make individual GETs for each of those URLs provided by the API. You should check the headers on the responses you get for either 'ETag' or 'Last-Modified' values and use those to prevent having to re-download the file every time your website is queried. Assuming the content has changed, you'll also save your ratelimit.