REST API endpoints for repository traffic - GitHub Docs
Skip to main content Skip to content Collapse sidebar Expand sidebar The REST API is now versioned. For more information, see " About API versioning ." REST API endpoints for repository traffic Use the REST API to retrieve information provided in your repository graph. About repository traffic You can use these endpoints to retrieve information provided in your repository graph, for repositories that you have write access to.
For more information, see Viewing traffic to a repository . Get repository clones Get the total number of clones and breakdown per day or week for the last 14 days. Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. Fine-grained access tokens for "Get repository clones" This endpoint works with the following fine-grained token types : GitHub App user access tokens GitHub App installation access tokens Fine-grained personal access tokens The fine-grained token must have the following permission set: "Administration" repository permissions (read) Parameters for "Get repository clones" Headers Name, Type, Description accept string Setting to application/vnd.github+json is recommended.
Path parameters Name, Type, Description owner string Required The account owner of the repository. The name is not case sensitive. repo string Required The name of the repository without the .git extension. The name is not case sensitive. Query parameters Name, Type, Description per string The time frame to display results for. Default : day Can be one of : day , week HTTP response status codes for "Get repository clones" Status code Description 200 OK 403 Forbidden Code samples for "Get repository clones" Request example get /repos /{owner} /{repo} /traffic /clones Copy to clipboard curl request example curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/traffic/clones Response Status: 200 { "count": 173, "uniques": 128, "clones": [ { "timestamp": "2016-10-10T00:00:00Z", "count": 2, "uniques": 1 }, { "timestamp": "2016-10-11T00:00:00Z", "count": 17, "uniques": 16 }, { "timestamp": "2016-10-12T00:00:00Z", "count": 21, "uniques": 15 }, { "timestamp": "2016-10-13T00:00:00Z", "count": 8, "uniques": 7 }, { "timestamp": "2016-10-14T00:00:00Z", "count": 5, "uniques": 5 }, { "timestamp": "2016-10-15T00:00:00Z", "count": 2, "uniques": 2 }, { "timestamp": "2016-10-16T00:00:00Z", "count": 8, "uniques": 7 }, { "timestamp": "2016-10-17T00:00:00Z", "count": 26, "uniques": 15 }, { "timestamp": "2016-10-18T00:00:00Z", "count": 19, "uniques": 17 }, { "timestamp": "2016-10-19T00:00:00Z", "count": 19, "uniques": 14 }, { "timestamp": "2016-10-20T00:00:00Z", "count": 19, "uniques": 15 }, { "timestamp": "2016-10-21T00:00:00Z", "count": 9, "uniques": 7 }, { "timestamp": "2016-10-22T00:00:00Z", "count": 5, "uniques": 5 }, { "timestamp": "2016-10-23T00:00:00Z", "count": 6, "uniques": 5 }, { "timestamp": "2016-10-24T00:00:00Z", "count": 7, "uniques": 5 } ] } Get top referral paths Get the top 10 popular contents over the last 14 days.
Fine-grained access tokens for "Get top referral paths" This endpoint works with the following fine-grained token types : GitHub App user access tokens GitHub App installation access tokens Fine-grained personal access tokens The fine-grained token must have the following permission set: "Administration" repository permissions (read) Parameters for "Get top referral paths" Headers Name, Type, Description accept string Setting to application/vnd.github+json is recommended.
Path parameters Name, Type, Description owner string Required The account owner of the repository. The name is not case sensitive. repo string Required The name of the repository without the .git extension. The name is not case sensitive. HTTP response status codes for "Get top referral paths" Status code Description 200 OK 403 Forbidden Code samples for "Get top referral paths" Request example get /repos /{owner} /{repo} /traffic /popular /paths Copy to clipboard curl request example curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/traffic/popular/paths Response Status: 200 [ { "path": "/github/hubot", "title": "github/hubot: A customizable life embetterment robot.", "count": 3542, "uniques": 2225 }, { "path": "/github/hubot/blob/master/docs/scripting.md", "title": "hubot/scripting.md at master · github/hubot · GitHub", "count": 1707, "uniques": 804 }, { "path": "/github/hubot/tree/master/docs", "title": "hubot/docs at master · github/hubot · GitHub", "count": 685, "uniques": 435 }, { "path": "/github/hubot/tree/master/src", "title": "hubot/src at master · github/hubot · GitHub", "count": 577, "uniques": 347 }, { "path": "/github/hubot/blob/master/docs/index.md", "title": "hubot/index.md at master · github/hubot · GitHub", "count": 379, "uniques": 259 }, { "path": "/github/hubot/blob/master/docs/adapters.md", "title": "hubot/adapters.md at master · github/hubot · GitHub", "count": 354, "uniques": 201 }, { "path": "/github/hubot/tree/master/examples", "title": "hubot/examples at master · github/hubot · GitHub", "count": 340, "uniques": 260 }, { "path": "/github/hubot/blob/master/docs/deploying/heroku.md", "title": "hubot/heroku.md at master · github/hubot · GitHub", "count": 324, "uniques": 217 }, { "path": "/github/hubot/blob/master/src/robot.coffee", "title": "hubot/robot.coffee at master · github/hubot · GitHub", "count": 293, "uniques": 191 }, { "path": "/github/hubot/blob/master/LICENSE.md", "title": "hubot/LICENSE.md at master · github/hubot · GitHub", "count": 281, "uniques": 222 } ] Get top referral sources Get the top 10 referrers over the last 14 days.
Fine-grained access tokens for "Get top referral sources" This endpoint works with the following fine-grained token types : GitHub App user access tokens GitHub App installation access tokens Fine-grained personal access tokens The fine-grained token must have the following permission set: "Administration" repository permissions (read) Parameters for "Get top referral sources" Headers Name, Type, Description accept string Setting to application/vnd.github+json is recommended.
Path parameters Name, Type, Description owner string Required The account owner of the repository. The name is not case sensitive. repo string Required The name of the repository without the .git extension. The name is not case sensitive. HTTP response status codes for "Get top referral sources" Status code Description 200 OK 403 Forbidden Code samples for "Get top referral sources" Request example get /repos /{owner} /{repo} /traffic /popular /referrers Copy to clipboard curl request example curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/repos/OWNER/REPO/traffic/popular/referrers Response Status: 200 [ { "referrer": "Google", "count": 4, "uniques": 3 }, { "referrer": "stackoverflow.com", "count": 2, "uniques": 2 }, { "referrer": "eggsonbread.com", "count": 1, "uniques": 1 }, { "referrer": "yandex.ru", "count": 1, "uniques": 1 } ] Get page views Get the total number of views and breakdown per day or week for the last 14 days.
Timestamps are aligned to UTC midnight of the beginning of the day or week. Week begins on Monday. Fine-grained access tokens for "Get page views" This endpoint works with the following fine-grained token types : GitHub App user access tokens GitHub App installation access tokens Fine-grained personal access tokens The fine-grained token must have the following permission set: "Administration" repository permissions (read) Parameters for "Get page views" Headers Name, Type, Description accept string Setting to application/vnd.github+json is recommended.
Path parameters Name, Type, Description owner string R
The rest of this page is on the live site.