API Documentation
Access Python package download statistics programmatically through our REST API.
Base URL
https://api.pepy.tech
All API endpoints are relative to this base URL.
Authentication
All API requests require an API key to be included in the request headers.
X-API-Key: your_api_key
Get your API key from your user profile.
Never share your API key or commit it to public repositories.
Rate Limits
- Free users: 10 requests per minute
- Pro users: 100 requests per minute
Get Project Statistics
Retrieve download statistics for a specific Python package.
GET
Endpoint
GET /api/v2/projects/{project}
Path Parameters
Parameter | Type | Description |
---|---|---|
project | string | Name of the Python package |
Response
{
"total_downloads": 1395207458,
"id": "requests",
"versions": [
"1.0",
"1.1"
],
"downloads": {
"2023-08-29": {
"1.0": 1142321,
"1.1": 1231
},
"2023-08-28": {
"1.0": 1241242,
"1.1": 3234
}
}
}
Response Status Codes
Code | Description |
---|---|
200 | Successful response |
401 | Missing or invalid API key |
404 | Project not found |
429 | Rate limit exceeded |
PRO: Get Project Downloads
Retrieve download statistics for a specific project.
Pro
GET
Endpoint
GET /service-api/v1/pro/projects/{project}/downloads
Path Parameters
Parameter | Type | Description |
---|---|---|
project | string | Name of the Python package |
Query Parameters
Parameter | Type | Description |
---|---|---|
includeCIDownloads | boolean | Include CI downloads |
timeRange | string | Time range for the downloads (FOUR_MONTHS/ONE_YEAR) |
Response
{
"downloads": {
"2023-08-29": {
"1.0": 10
}
}
}
Response Status Codes
Code | Description |
---|---|
200 | Successful response |
401 | Missing or invalid API key |
403 | Unauthorized because you are not PRO |
404 | Project not found |
429 | Rate limit exceeded |