{"meta":{"title":"Points de terminaison d’API REST pour le trafic du dépôt","intro":"Utilisez l’API REST pour récupérer les informations fournies dans le graphique de votre référentiel.","product":"API REST","breadcrumbs":[{"href":"/fr/enterprise-cloud@latest/rest","title":"API REST"},{"href":"/fr/enterprise-cloud@latest/rest/metrics","title":"Mesures"},{"href":"/fr/enterprise-cloud@latest/rest/metrics/traffic","title":"Trafic"}],"documentType":"article"},"body":"# Points de terminaison d’API REST pour le trafic du dépôt\n\nUtilisez l’API REST pour récupérer les informations fournies dans le graphique de votre référentiel.\n\n## À propos du trafic de référentiel\n\nVous pouvez utiliser ces points de terminaison pour récupérer les informations fournies dans le graphique de votre référentiel, pour les référentiels auxquels vous avez accès en écriture. Pour plus d’informations, consultez « [Affichage du trafic vers un référentiel](/fr/enterprise-cloud@latest/repositories/viewing-activity-and-data-for-your-repository/viewing-traffic-to-a-repository) ».\n\n> \\[!NOTE]\n> Les statistiques de trafic du référentiel ne sont pas disponibles via l’API REST ou l’interface utilisateur sur GHE.com.\n\n> \\[!NOTE]\n> 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.\n\n## Get repository clones\n\n```\nGET /repos/{owner}/{repo}/traffic/clones\n```\n\nGet 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`per`** (string)\n  The time frame to display results for.\n  Default: `day`\n  Can be one of: `day`, `week`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/traffic/clones\n```\n\n**Response schema (Status: 200):**\n\n* `count`: required, integer\n* `uniques`: required, integer\n* `clones`: required, array of `Traffic`:\n  * `timestamp`: required, string, format: date-time\n  * `uniques`: required, integer\n  * `count`: required, integer\n\n## Get top referral paths\n\n```\nGET /repos/{owner}/{repo}/traffic/popular/paths\n```\n\nGet the top 10 popular contents over the last 14 days.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/traffic/popular/paths\n```\n\n**Response schema (Status: 200):**\n\nArray of `Content Traffic`:\n\n* `path`: required, string\n* `title`: required, string\n* `count`: required, integer\n* `uniques`: required, integer\n\n## Get top referral sources\n\n```\nGET /repos/{owner}/{repo}/traffic/popular/referrers\n```\n\nGet the top 10 referrers over the last 14 days.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/traffic/popular/referrers\n```\n\n**Response schema (Status: 200):**\n\nArray of `Referrer Traffic`:\n\n* `referrer`: required, string\n* `count`: required, integer\n* `uniques`: required, integer\n\n## Get page views\n\n```\nGET /repos/{owner}/{repo}/traffic/views\n```\n\nGet 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`per`** (string)\n  The time frame to display results for.\n  Default: `day`\n  Can be one of: `day`, `week`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/traffic/views\n```\n\n**Response schema (Status: 200):**\n\n* `count`: required, integer\n* `uniques`: required, integer\n* `views`: required, array of `Traffic`:\n  * `timestamp`: required, string, format: date-time\n  * `uniques`: required, integer\n  * `count`: required, integer"}