GitHub stars, forks, topics and license for any public repo, with no token and no 60-an-hour limit
GitHub's REST API allows 60 anonymous requests an hour. This endpoint reads the public repo page: stars, forks, watchers, topics, license, releases.
In short
- GET /v1/structured/github/repo?owner=…&repo=… returns the overview facts from the public page, with no GitHub token.
- Counts are exactly what GitHub renders, so they are as current as the page. Answers are stored for 1 hour and shared.
- The primary language is no longer in the server-rendered page, so language is usually null; everything else is stable.
Sixty requests an hour is what GitHub’s REST API gives an unauthenticated caller, and a token is the obvious fix when you can carry one. When you cannot, or when you just want a fixed JSON shape from one call, the public repository page carries the same overview facts, and this endpoint reads them.
The request
curl "https://api.webscrapingapi.dev/v1/structured/github/repo?owner=withastro&repo=astro" \
-H "X-API-Key: wsa_your_key"
The response
{
"site": "github",
"action": "repo",
"data": {
"owner": "withastro",
"repo": "astro",
"url": "https://github.com/withastro/astro",
"description": "The web framework for content-driven websites.",
"homepage": "https://astro.build",
"stars": 62720,
"forks": 3798,
"watchers": 221,
"language": null,
"topics": ["astro", "blog", "islands", "ssg", "static-site-generator"],
"license": "Other",
"defaultBranch": "main",
"archived": false,
"fork": false,
"releaseCount": 3251
},
"source": "live",
"age": 0,
"credits": 1
}
stars, forks and watchers are the exact counts from the page data, not the rounded labels in the header. license is the name GitHub shows (“MIT”, “Apache-2.0”, “Other”). topics is the list under the description. releaseCount is the number in the Releases sidebar.
language deserves a warning: GitHub renders the language bar after the page loads, so the server HTML no longer contains it and the field is null on the current layout. The endpoint reports what it can see rather than guessing.
Freshness and cost
Star counts move, but not in ways that matter minute to minute, so answers are stored for 1 hour and shared. A dashboard that shows twenty repositories and refreshes every minute costs twenty credits an hour, not twelve hundred. max_age=0 fetches fresh for 1 credit.
Where it fits
Comparison tables, “is this project alive” checks in an agent (archived, releaseCount, stars), README badges you generate yourself, and any place you would have reached for the REST API without a token. The reference page lists the parameters.
Questions people ask
- Why would I use this instead of api.github.com?
- When you have no token and need more than 60 requests an hour, or when you are inside an agent and want one call with a fixed shape. With a token and a modest volume the official API is fine.
- Are the star counts exact?
- They are the exact numbers GitHub puts in the page's data, not the rounded '62k' label.
- Does it work on private repositories?
- No. The API never signs in anywhere; only public pages are reachable.
- Why is language null?
- GitHub now loads the language bar after the page, so it is not in the HTML the API receives. Rather than guess, the field is null.