Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 1.29 KB

API.md

File metadata and controls

58 lines (43 loc) · 1.29 KB

API

Users

Current websites using this API:

If you intend to use this API, please add your website to the list and set user-agent header to match.

Endpoints

  • v1: GET /api.json
  • v2: GET /v2/api.json

You can use the npm package name and version (cached for up to one week):

https://packagephobia.com/api.json?p=satori@0.4.3

Or just the npm package name, which will automatically use the latest version (cached for thirty seconds):

https://packagephobia.com/api.json?p=satori

This caching is done using a Cache-Control header, see server.ts.

Example response from v1

{
  "publishSize":3686131,
  "installSize":8724612
}

Example response from v2

{
  "name": "satori",
  "version": "0.4.3",
  "publish": {
    "bytes": 3686131,
    "files": 19,
    "pretty": "3.52 MB",
    "color": "#007EC6"
  },
  "install": {
    "bytes": 8724612,
    "files": 297,
    "pretty": "8.32 MB",
    "color": "#DFB317"
  }
}