Get a repo's traffic views
Read how many page views a repository has had over GitHub’s 14-day rolling window, broken down by day.
-
Call
get_repo_traffic_viewswith the repository’s owner and name:get_repo_traffic_views { owner: "octocat", repo: "example" } -
Read the totals off the top-level fields, and the day-by-day breakdown off
daily:{"count": 512,"uniques": 71,"daily": [{ "timestamp": "2026-06-22T00:00:00Z", "count": 40, "uniques": 12 }]}countis total views in the window;uniquesis unique visitors.dailyhas one entry per day GitHub reported; if GitHub’s response omits theviewsarray entirely, this tool returnsdaily: []rather than failing.
If it fails
Section titled “If it fails”missing_scope: no GitHub token was resolvable. SetGITHUB_TOKENor rungh auth login.github_api_errorwith a 403: check whether it’s a genuine permission problem (you need push access to the repository to read its traffic) — a rate-limited 403 is retried automatically up to three times before this error surfaces, so if you see it, it isn’t a rate limit that will clear on its own.
See also
Section titled “See also”- reference/tools.md for the exact response schema.
- get-repo-traffic-clones.md for the sibling clone-traffic tool.