GitHub Scraper: Repos, Stars & Contributors

A github scraper guide to repos, stars, issues, PRs, releases and contributors via GitHub's free API, with every command tested October 2026.

MMotherlode Lab9 min read
Magpie title card: GitHub Scraper: Repos, Stars & Contributors

GitHub hands its data out through a free REST API: 60 requests an hour with no account at all, 5,000 with a free token. A github scraper that loads github.com pages and pries star counts out of the HTML is doing the job the slow way. This page covers the four record types Magpie’s github_repo vertical returns, the two endpoints it doesn’t cover and how to fetch them anyway, and the rate-limit math that decides when you need a token. Every command below ran October 29, 2026, from a home connection.

Two sentences of terms first, because GitHub is the rare site where the legal answer is simpler than the folklore. The Acceptable Use Policies define scraping as “extracting information from our Service via an automated process, such as a bot or webcrawler”, then add: “Scraping does not refer to the collection of information through our API.” The same section restricts what you may do with the data no matter how you got it: no spamming, no selling users’ personal information to recruiters or job boards. Most scraper-blog writeups claim GitHub bans scraping outright. The current policy says no such thing. It doesn’t need to. The API is free, typed, and faster than any page render, and GitHub’s own robots.txt points you there: “If you would like to crawl GitHub contact us… We also provide an extensive API.” The general-purpose version of this talk lives in Is Web Scraping Legal?.

What you want, and the route that gets it

You want Route My run today
Stars, forks, language, license, open issues --vertical github_repo on a repo URL golang/go: 139,501 stars, one request
One issue or PR: title, author, state, body --vertical github_repo on the /pull/N or /issues/N URL magpie PR #1, full record with body
Latest release plus changelog --vertical github_repo on /releases cli/cli v2.103.3, changelog in the record
Contributor list Plain scrape of api.github.com + jq rsc: 7,579 contributions on golang/go
Top repos for a topic Plain scrape of the search endpoint go-rod/rod, 7,139 stars, for “web scraper language:go”
Star history over time No anonymous route; /stargazers returns HTTP 401 without a token Blocked, tested today

One tool runs the first three: Magpie, a local CLI whose github_repo vertical rewrites your github.com URL to the matching api.github.com call and hands back typed records. No key, no LLM, no per-record cost. The vertical is one of 27 zero-cost extractors; Command-Line Web Scraper shows where it sits among the others.

Repo records: stars, forks, language, license

magpie scrape https://github.com/golang/go --vertical github_repo --format json

The record, verbatim except for spacing:

{
  "record": {
    "description": "The Go programming language",
    "forks": 21596,
    "full_name": "golang/go",
    "kind": "repo",
    "language": "Go",
    "license": "bsd 3-clause \"new\" or \"revised\" license",
    "open_issues": 10544,
    "stars": 139501,
    "url": "https://github.com/golang/go"
  }
}

Nine fields, always the same nine. That’s the deal: stable beats exhaustive. If you need topics, timestamps, or the default branch, the underlying endpoint api.github.com/repos/{owner}/{repo} returns more than the vertical keeps, and a plain scrape reads it:

magpie scrape https://api.github.com/repos/golang/go --page-format raw | jq '.open_issues_count, .pushed_at'

One quirk worth knowing before it costs you ten confused minutes. The license field comes from GitHub’s license detection, and dual licenses have no SPDX slot there. Run the vertical against Magpie’s own repo and you get "license": "other", because AGPL-3.0-or-later OR commercial is not a string GitHub’s detector maps. The stars count on that repo is 0, which is also real. The vertical reports what the API reports.

Issues and pull requests

Point the vertical at a /pull/N URL and you get the thread record:

magpie scrape https://github.com/motherlodelab/magpie/pull/1 --vertical github_repo --format json
{
  "record": {
    "kind": "pr",
    "title": "Phase 1: single-URL fetch→clean→extract",
    "state": "closed",
    "comments": 0,
    "body": "Greenfield Milestone 1 per plan/phase-1.md. ..."
  }
}

Body, author, state, comment count. The body keeps its markdown, \r\n line endings included, which matters if you’re feeding threads into anything downstream.

Two failure modes, both typed errors instead of garbage. A repo that doesn’t exist:

Error: vertical: GET https://api.github.com/repos/motherlodelab/does-not-exist-xyz: HTTP 404

And a numbering quirk GitHub itself built: issues and pull requests share one number sequence. Ask for cli/cli/issues/1 and GitHub redirects to the pull request at number 1; the vertical follows it and returns the PR’s data under "kind": "issue". Title and body are still correct. The kind label just can’t tell you the redirect happened, so don’t trust it to classify, trust the URL you typed.

Releases and changelogs

magpie scrape https://github.com/cli/cli/releases --vertical github_repo --format json
{
  "record": {
    "kind": "release",
    "title": "GitHub CLI 2.103.3",
    "tag": "v2.103.3",
    "body": "## What's Changed\r\n### 🐛 Fixes\r\n\r\n* fix(gh auth status): explain expired expiring tokens ...",
    "url": "https://github.com/cli/cli/releases"
  }
}

That’s the newest release with its changelog body intact. A specific version works too: /releases/tag/v2.103.2 in your URL fetches that tag’s release instead of the latest.

The error case is the useful one. Magpie’s own repo has hundreds of git tags and zero published Releases, because tags and Releases are different GitHub features. The vertical refuses to guess:

Error: vertical: GET https://api.github.com/repos/motherlodelab/magpie/releases: vertical: empty array response

If you see that error, the repo publishes tags, not Releases. If what you actually want is a notification when the next release lands, that’s watch mode with a webhook, not a scrape: Get Notified of New GitHub Releases walks through it.

Contributors and search, without the vertical

The vertical stops at four record types. Two more endpoints matter enough to fetch by hand, and plain magpie scrape handles both because they return raw JSON. The one flag you need is --page-format raw, which skips the HTML cleaning pipeline entirely and gives you the body GitHub sent.

Contributors, sorted by commit count:

magpie scrape https://api.github.com/repos/golang/go/contributors --page-format raw \
  | jq -r '.[] | "\(.contributions)\t\(.login)"' | head -3
7579	rsc
4633	griesemer
2993	robpike

That list is live contributor data, not a scraped sidebar. Thirty lines of jq away from a proper league table.

Search works the same way and is the closest thing GitHub has to a global star ranking:

magpie scrape "https://api.github.com/search/repositories?q=web+scraper+language:go&sort=stars&order=desc&per_page=3" --page-format raw \
  | jq -r '.items[] | "\(.stargazers_count)\t\(.full_name)"'
7139	go-rod/rod
3888	Anakin-Inc/anakin
2781	geziyor/geziyor

The catch is that search has its own rate bucket, separate from the 60 an hour: 10 requests a minute unauthenticated, 30 with a token (code search is 10 a minute and token-only, per GitHub’s REST docs). Ten a minute is plenty for a one-off ranking and hopeless for a cron job that sweeps a topic every five minutes.

The rate-limit math that decides your architecture

Everything above ran anonymous. The /rate_limit endpoint shows the meter:

magpie scrape https://api.github.com/rate_limit --page-format raw | jq .resources.core

Mid-run today it reported "limit": 60, "remaining": 53, after my seven morning calls. The counter is real, per IP, and resets hourly.

Do the division before you build anything:

  • 60 requests an hour is one repo check a minute. A 500-repo scan takes 8.3 hours and one unlucky shared office IP.
  • A free personal token (create one at github.com/settings/tokens, no scopes needed for public read) lifts the core cap to 5,000 requests an hour. Same scan: about 6 minutes.
  • The vertical reads the token from the MAGPIE_GITHUB_TOKEN environment variable and sends it as an Authorization: Bearer header. No config file, no keyring entry.
  • magpie batch has no --vertical flag (checked today), so multi-repo jobs are a scrape loop with your own sleep between calls, or a crawl of nothing. With a token you likely don’t need the sleep: 5,000 an hour is 1.4 requests a second.

GitHub’s API terms reserve the right to suspend “abuse or excessively frequent requests”, which at 5,000 an hour means you’d have to work at it. Polling a handful of repos once an hour is a rounding error.

Where the github scraper vertical stops

Honest boundary, so you don’t find these out mid-job:

  • Four record types only. Repo, issue, PR, release. No user profiles, no organizations, no file contents, no README, no commit history.
  • github.com hosts only. Gists, raw.githubusercontent.com and codeload URLs don’t match the vertical. The contributors and search calls above work because plain scrape fetches any URL, not because the vertical understands them.
  • The record is fixed. Nine fields for a repo. Topics, watchers, and dates are dropped. Drop to --page-format raw on the API endpoint when you need them.
  • Star history has no free route. The /stargazers endpoint now returns HTTP 401 without authentication, which I confirmed today. With a token, magpie scrape on that endpoint plus --header "Accept: application/vnd.github.star+json" returns stars with timestamps; the flag exists and the header format is GitHub’s documented one, but I hold no token here, so treat that path as untested rather than proven.
  • Pages the vertical won’t match still scrape. The trending page rendered to 223 words of clean markdown today under a generic scrape. That’s fine for reading, wrong for volume: it’s the HTML route GitHub’s robots.txt waves you away from, and one redesign away from breaking. (And if your stack is Python, the same api.github.com endpoints return the same JSON to requests; the vertical’s whole job is skipping that plumbing.)

For the sibling API-first site, the same pattern holds: Hacker News Scraper uses the Firebase API instead of HTML for the same reason. Every site on the popular-sites list gets one of these verdicts: API first, feeds second, HTML last.

FAQ

Is scraping GitHub against the rules? The Acceptable Use Policies define scraping and exempt API collection from the definition. Usage limits, like no spamming and no selling personal information, apply regardless of how you obtained the data. The API route keeps you clearly inside policy.

Does GitHub have an official API? Yes. The REST API at api.github.com serves the same data the website shows: repos, issues, PRs, releases, contributors, search. 60 requests an hour anonymous, 5,000 with a free token. No approval process for public data.

How do I get past 60 requests per hour? Create a free personal token at github.com/settings/tokens and export it as MAGPIE_GITHUB_TOKEN. The vertical sends it automatically. That raises the core cap to 5,000 requests an hour. The search endpoint’s 10-a-minute bucket stays separate.

Can I get a repo’s star history? Not anonymously. /stargazers with GitHub’s star+json media type returns timestamps, but the endpoint requires authentication now. Third-party chart sites exist, or authenticate and page through stargazers yourself.

Do I need a GitHub account for any of this? No. Every command on this page ran without one. You only need an account to create the token that lifts the hourly cap, and a token with zero scopes covers public data.

Start with one repo

Pick a repository you actually depend on, run the repo command from the top of this page, and read .resources.core off /rate_limit when the record comes back. If the job grows past a few dozen repos, export MAGPIE_GITHUB_TOKEN before you start; 60 becomes 5,000 and the sleep statements stay in the drawer. Everything else here is plumbing around those two moves.

Live-tested October 29, 2026, home connection. GitHub’s API terms are the stable part; the HTML layout is not.

Stop renting credits.

One flat price, your machine, your keys.

Download free for Windows, macOS and Linux

Windows · macOS · Linux $49/mo flat, cancel anytime