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
    }
  }
}

Example Usage

# Using curl
curl -H "X-API-Key: your_api_key" https://api.pepy.tech/api/v2/projects/requests

# Python with requests library
import requests

headers = {
    'X-API-Key': 'your_api_key'
}

response = requests.get(
    'https://api.pepy.tech/api/v2/projects/requests',
    headers=headers
)
data = response.json()

Response Status Codes

CodeDescription
200Successful response
401Missing or invalid API key
404Project not found
429Rate limit exceeded