Skip to content

/repos/<id>/files/<path> endpoint redirects to raw.githubusercontent.com #123

Open

Description

@pi0

Due to recent service abuse of /repos/<id>/files/<path> endpoint (being used for crawling scripts), this endpoint redirects to the original https://raw.githubusercontent.com/ URL (which returns full content instead of JSON)

Sorry for the inconvenience.

Activity

  1. added
    enhancement
    and removed
    enhancement
    on Apr 30, 2025
  2. pinned this issue on Apr 30, 2025
  3. changed the title [-]`/repos/<id>/files/<path>` endpoint disabled[/-] [+]`/repos/<id>/files/<path>` endpoint redirects to `raw.githubusercontent.com`[/+] on Apr 30, 2025
  4. onmax commented on Apr 30, 2025

    @onmax

    Hi there,

    Sorry for the trouble! Not sure if I was the responsible, I was sending about 100 requests per hour to /repos/<id>/files/<path> with an automated script, not realising that the endpoint wasn't designed for sustained traffic. I'm now updating the code to use the official GitHub API and using my GH token.

    I'm sorry for the extra load and any inconvenience it may have caused. Please let me know if there's anything else I can do.

    Thanks for your understanding!

    PS: Maybe we could add a terms of use in the repo?

  5. ota-meshi commented on May 23, 2025

    @ota-meshi

    Hi @pi0. Thank you for providing this project!
    I'm using this API in the unofficial eslint-online-playground:
    https://eslint-online-playground.netlify.app/
    However, today I noticed that some features stopped working.

    I'm not using /repos/{owner}/{name}/files/{branch}/{...path}, but I'm using /repos/{owner}/{name}/files/{branch}.

    It seems that somehow /repos/{owner}/{name}/files/{branch} is now redirected as well. You can check by opening the following link:
    https://ungh.cc/repos/unjs/h3/files/main

    Is this the behavior you intended?

  6. pi0 commented on May 23, 2025

    @pi0
    MemberAuthor

    It was intended to disable all file endpoints but you are right redirect does not works for listing anymore nor we properly noticed in docs (PR welcome)

    I really hope we can add these back via token pool (ironically my peesonal use with pipress cannot leverqge ungh with my personal token 🥲

  7. alexandre-hallaine commented on Jun 24, 2025

    @alexandre-hallaine

    What about adding a way for users to contribute their GitHub tokens to a shared token pool by logging into the site? Like using a donate button

  8. pi0 commented on Jun 25, 2025

    @pi0
    MemberAuthor

    We are thinking of this (see #5), however, i guess with having a pool, priority would be lowering cache times rather than adding back the files endpoint (in addition to github rate limits, overusage costs a lot of worker traffic)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions