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.

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

ParameterTypeDescription
projectstringName 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

CodeDescription
200Successful response
401Missing or invalid API key
404Project not found
429Rate 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

ParameterTypeDescription
projectstringName of the Python package

Query Parameters

ParameterTypeDescription
includeCIDownloadsbooleanInclude CI downloads
timeRangestringTime range for the downloads (FOUR_MONTHS/ONE_YEAR)

Response

{ "downloads": { "2023-08-29": { "1.0": 10 } } }

Response Status Codes

CodeDescription
200Successful response
401Missing or invalid API key
403Unauthorized because you are not PRO
404Project not found
429Rate limit exceeded