Use the REST API to retrieve information provided in your repository graph.
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.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /repos/{owner}/{repo}/traffic/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.
accept (string)application/vnd.github+json is recommended.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.
per (string)
The time frame to display results for.
Default: day
Can be one of: day, week
200 - OK
403 - Forbidden
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/traffic/clones
Response schema (Status: 200):
count: required, integeruniques: required, integerclones: required, array of Traffic:
timestamp: required, string, format: date-timeuniques: required, integercount: required, integerGET /repos/{owner}/{repo}/traffic/popular/paths
Get the top 10 popular contents over the last 14 days.
accept (string)application/vnd.github+json is recommended.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.
200 - OK
403 - Forbidden
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/traffic/popular/paths
Response schema (Status: 200):
Array of Content Traffic:
path: required, stringtitle: required, stringcount: required, integeruniques: required, integerGET /repos/{owner}/{repo}/traffic/popular/referrers
Get the top 10 referrers over the last 14 days.
accept (string)application/vnd.github+json is recommended.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.
200 - OK
403 - Forbidden
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/traffic/popular/referrers
Response schema (Status: 200):
Array of Referrer Traffic:
referrer: required, stringcount: required, integeruniques: required, integerGET /repos/{owner}/{repo}/traffic/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.
accept (string)application/vnd.github+json is recommended.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.
per (string)
The time frame to display results for.
Default: day
Can be one of: day, week
200 - OK
403 - Forbidden
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/traffic/views
Response schema (Status: 200):
count: required, integeruniques: required, integerviews: required, array of Traffic:
timestamp: required, string, format: date-timeuniques: required, integercount: required, integer