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.

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 repository clones

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/traffic/clones

Response schema (Status: 200):

Get top referral paths

GET /repos/{owner}/{repo}/traffic/popular/paths

Get the top 10 popular contents over the last 14 days.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/traffic/popular/paths

Response schema (Status: 200):

Array of Content Traffic:

Get top referral sources

GET /repos/{owner}/{repo}/traffic/popular/referrers

Get the top 10 referrers over the last 14 days.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/traffic/popular/referrers

Response schema (Status: 200):

Array of Referrer Traffic:

Get page views

GET /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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/traffic/views

Response schema (Status: 200):