GitHub traffic API reference: endpoints, fields and limits

A compact reference for GitHub's repository traffic endpoints: what each returns, who can call it and what the limits are.

Key takeaways

Endpoints

EndpointReturnsWindow
/repos/{owner}/{repo}/traffic/viewscount, uniques and a list of daily {timestamp, count, uniques}14 days
/repos/{owner}/{repo}/traffic/clonescount, uniques and a list of daily {timestamp, count, uniques}14 days
/repos/{owner}/{repo}/traffic/popular/referrerslist of {referrer, count, uniques}14 days, top 10
/repos/{owner}/{repo}/traffic/popular/pathslist of {path, title, count, uniques}14 days, top 10

The views and clones endpoints accept a per parameter to choose daily or weekly buckets. Always read the official GitHub documentation for the current contract.

Access

You need push access to the repository. Send a token in the Authorization: Bearer header and request application/vnd.github+json. Private repositories require a token that can read them; this dashboard never collects private repositories.

Interpreting the numbers

Limits

Requests count against GitHub's REST rate limit, described in the rate limit documentation. Responses include x-ratelimit-remaining and x-ratelimit-reset; stop when the remaining budget is low. Because a call returns 14 days, fetching a quiet repository every few days loses nothing.

Keeping history

See how to keep GitHub traffic data beyond 14 days.