← 返回首页
warehouse/docs/user/api/stats.md at main · pypi/warehouse · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Latest commit

 

History

History
53 lines (38 loc) · 914 Bytes
 main
Top

File metadata and controls

  • Preview
  • Code
  • Blame
53 lines (38 loc) · 914 Bytes

Stats API

!!! important

You **must** set `Accept: application/json` in your requests to this API. Without the `Accept` header, you will be returned an HTML page.

!!! tip

An example stats API client can be found at @cooperlees/pypistats.

Routes

Project stats

Route: GET /stats/

Returns statistics in JSON format. This includes:

  • Total size of PyPI packages in bytes
  • Top 100 packages + their size in bytes

Status codes:

  • 200 OK - no error

Example request:

GET /stats HTTP/1.1 Host: pypi.org Accept: application/json

??? note "Example JSON response"

```json { "top_packages": { "CodeIntel": { "size": 23767329521 }, "Fiona": { "size": 6209535709 }, "FlexGet": { "size": 4387002448 }, "...": "..." }, "total_packages_size": 23965450269 } ```

Footer

© 2026 GitHub, Inc.