Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 1.47 KB

API.md

File metadata and controls

61 lines (45 loc) · 1.47 KB

API

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

If you forget to set a user-agent, you will likely be blocked.

Users

Current websites using this API:

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/[email protected]

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