# Social Fetch API - npm endpoints # Base URL: https://api.socialfetch.dev # Auth: x-api-key header (sfk_...) # Full catalog: https://www.socialfetch.dev/llms-endpoints.txt | JSON: https://www.socialfetch.dev/llms.json # Docs hub: https://www.socialfetch.dev/docs/api | OpenAPI: https://www.socialfetch.dev/openapi.json 18 documented npm operations. Do not invent paths - only the routes below (and their linked markdown pages) are supported. ## GET /v1/npm/package Get npm package Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/package/get.mdx SDK: client.npm.getPackage({ name: "express" }) Parameters: - name (required, string) - npm package name, e.g. `express`, `lodash.merge`, `@types/node` or `--file--1`. Names are case-sensitive (`Express` is a different package) and keep legacy punctuation such as a leading `-`. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/package?name=express" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/package/details Get npm package full registry document Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/package/details/get.mdx SDK: client.npm.getPackageDetails({ name: "express" }) Parameters: - name (required, string) - npm package name, e.g. `express`, `lodash.merge`, `@types/node` or `--file--1`. Names are case-sensitive (`Express` is a different package) and keep legacy punctuation such as a leading `-`. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/package/details?name=express" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/package/versions List npm package versions Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/package/versions/get.mdx SDK: client.npm.listVersions({ name: "express", limit: 100 }) Parameters: - name (required, string) - npm package name, e.g. `express`, `lodash.merge`, `@types/node` or `--file--1`. Names are case-sensitive (`Express` is a different package) and keep legacy punctuation such as a leading `-`. - limit (optional, integer) - Versions per page, 1 to 200. Default: 100. - cursor (optional, string) - Cursor from `page.nextCursor` of the previous response. It only continues the same lookup and filters. Pagination: send query `cursor` from prior `data.page.nextCursor`; stop when `data.page.hasMore` is false. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/package/versions?name=express" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/package/version Get one npm package version Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/package/version/get.mdx SDK: client.npm.getVersion({ name: "express", version: "5.3.0" }) Parameters: - name (required, string) - npm package name, e.g. `express`, `lodash.merge`, `@types/node` or `--file--1`. Names are case-sensitive (`Express` is a different package) and keep legacy punctuation such as a leading `-`. - version (required, string) - Exact version or dist-tag, e.g. `5.3.0`, `5.0.0-alpha.1`, `latest` or `latest-4`. Semver ranges (`^4`, `4.x`) are refused. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/package/version?name=express&version=5.3.0" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/package/downloads Get npm package downloads Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/package/downloads/get.mdx SDK: client.npm.getDownloads({ name: "express", period: "last-week" }) Parameters: - name (optional, string) - Package name. Omit it for the whole registry's download total. - period (optional, string, enum: last-day | last-week | last-month | last-year) - Window: `last-day`, `last-week`, `last-month` or `last-year`. Default: `last-week` unless `from`/`to` are given. - from (optional, string) - First day of the range, `YYYY-MM-DD`. Download data starts on 2015-01-10; a `from` after today is refused. A range spans up to 18 months; a longer range keeps its newest 18 months and sets `clamped`. - to (optional, string) - Last day of the range, `YYYY-MM-DD`. Must be on or after `from`; a `to` before 2015-01-10 is refused. A range spans up to 18 months; a longer range keeps its newest 18 months and sets `clamped`. - granularity (optional, string, enum: total | daily) - `total` for one number, `daily` for one row per day. Default: `total`. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/package/downloads?name=express&period=last-week" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/package/downloads/versions Get npm downloads for every version Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/package/downloads/versions/get.mdx SDK: client.npm.getVersionDownloads({ name: "express" }) Parameters: - name (required, string) - npm package name, e.g. `express`, `lodash.merge`, `@types/node` or `--file--1`. Names are case-sensitive (`Express` is a different package) and keep legacy punctuation such as a leading `-`. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/package/downloads/versions?name=express" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/packages/downloads Get npm downloads for several packages Credit cost: 1 credit per name. Up to 128 names per request. Max 128 credits. A name that is not found is still charged. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/packages/downloads/get.mdx SDK: client.npm.getPackagesDownloads({ names: ["express", "react", "lodash"], period: "last-week" }) Parameters: - names (required, array) - Comma-separated package names, 1 to 128, with at most 20 scoped names because each one is looked up separately. - period (optional, string, enum: last-day | last-week | last-month | last-year) - Window: `last-day`, `last-week`, `last-month` or `last-year`. Default: `last-week` unless `from`/`to` are given. - from (optional, string) - First day of the range, `YYYY-MM-DD`. Download data starts on 2015-01-10; a `from` after today is refused. A range spans up to 18 months; a longer range keeps its newest 18 months and sets `clamped`. - to (optional, string) - Last day of the range, `YYYY-MM-DD`. Must be on or after `from`; a `to` before 2015-01-10 is refused. A range spans up to 18 months; a longer range keeps its newest 18 months and sets `clamped`. - granularity (optional, string, enum: total | daily) - `total` for one number, `daily` for one row per day. Default: `total`. curl "https://api.socialfetch.dev/v1/npm/packages/downloads?names=express,react,lodash" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/package/advisories List npm package security advisories Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/package/advisories/get.mdx SDK: client.npm.listAdvisories({ name: "lodash", version: "4.17.15" }) Parameters: - name (required, string) - npm package name, e.g. `express`, `lodash.merge`, `@types/node` or `--file--1`. Names are case-sensitive (`Express` is a different package) and keep legacy punctuation such as a leading `-`. - version (optional) - Exact version or dist-tag to check, `all` for every version, or omit for `latest`. A dist-tag is resolved to the version it points to. Semver ranges are not resolved. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/package/advisories?name=lodash" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/package/provenance Get npm package provenance Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/package/provenance/get.mdx SDK: client.npm.getProvenance({ name: "express", version: "5.3.0" }) Parameters: - name (required, string) - npm package name, e.g. `express`, `lodash.merge`, `@types/node` or `--file--1`. Names are case-sensitive (`Express` is a different package) and keep legacy punctuation such as a leading `-`. - version (optional, string) - Exact version or dist-tag. A dist-tag is resolved to the version it points to. Default: `latest`. - include (optional, string, enum: raw) - `raw` also returns each sigstore bundle. Signatures are decoded, not verified. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/package/provenance?name=express" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/package/dependents List npm package dependents Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/package/dependents/get.mdx SDK: client.npm.listDependents({ name: "express", page: 1 }) Parameters: - name (required, string) - npm package name, e.g. `express`, `lodash.merge`, `@types/node` or `--file--1`. Names are case-sensitive (`Express` is a different package) and keep legacy punctuation such as a leading `-`. - page (optional, integer) - 1-based page number. Each page carries 36 rows and the list stops at page 11; a page past it is an empty page. Default: 1. - cursor (optional, string) - Cursor from `page.nextCursor` of the previous response. It only continues the same lookup and filters. Pagination: send query `cursor` from prior `data.page.nextCursor`; stop when `data.page.hasMore` is false. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/package/dependents?name=express" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/packages/search Search npm packages Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/packages/search/get.mdx SDK: client.npm.search({ query: "react", limit: 20 }) Parameters: - query (required, string) - Search text, 2 to 64 characters. A single emoji counts as two characters. The registry's qualifiers work: `author:isaacs`, `maintainer:`, `keywords:a,b`, `not:deprecated`, `@scope`. - sort (optional, string, enum: optimal | popularity | quality | maintenance) - Ranking: `optimal` (npm's blend), or a single component. Default: `optimal`. - quality (optional, number) - Quality weight, 0 to 1. - popularity (optional, number) - Popularity weight, 0 to 1. - maintenance (optional, number) - Maintenance weight, 0 to 1. - limit (optional, integer) - Results per page, 1 to 250. Default: 20. - page (optional, integer) - 1-based page number. The registry accepts a starting offset only up to 5000, so a page past the reachable results is an empty page. Default: 1. - cursor (optional, string) - Cursor from `page.nextCursor` of the previous response. It only continues the same lookup and filters. Pagination: send query `cursor` from prior `data.page.nextCursor`; stop when `data.page.hasMore` is false. curl "https://api.socialfetch.dev/v1/npm/packages/search?query=react" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/user Get npm user Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/user/get.mdx SDK: client.npm.getUser({ username: "sindresorhus" }) Parameters: - username (required, string) - npm username, e.g. `sindresorhus`. Case-sensitive. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/user?username=sindresorhus" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/user/packages List npm user packages Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/user/packages/get.mdx SDK: client.npm.listUserPackages({ username: "sindresorhus", page: 1 }) Parameters: - username (required, string) - npm username, e.g. `sindresorhus`. Case-sensitive. - page (optional, integer) - 1-based page number. Default: 1. - cursor (optional, string) - Cursor from `page.nextCursor` of the previous response. It only continues the same lookup and filters. Pagination: send query `cursor` from prior `data.page.nextCursor`; stop when `data.page.hasMore` is false. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/user/packages?username=sindresorhus" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/org Get npm org or scope Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/org/get.mdx SDK: client.npm.getOrg({ name: "babel" }) Parameters: - name (required, string) - npm org or scope name, e.g. `babel`. Case-sensitive. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/org?name=babel" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/org/packages List npm org or scope packages Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/org/packages/get.mdx SDK: client.npm.listOrgPackages({ name: "babel", page: 1 }) Parameters: - name (required, string) - npm org or scope name, e.g. `babel`. Case-sensitive. - page (optional, integer) - 1-based page number. Default: 1. - cursor (optional, string) - Cursor from `page.nextCursor` of the previous response. It only continues the same lookup and filters. Pagination: send query `cursor` from prior `data.page.nextCursor`; stop when `data.page.hasMore` is false. Outcome field: `data.lookupStatus` in `found`, `not_found` curl "https://api.socialfetch.dev/v1/npm/org/packages?name=babel" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/registry/packages List npm package names Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/registry/packages/get.mdx SDK: client.npm.listRegistryPackages({ after: "express", limit: 100 }) Parameters: - after (optional, string) - Inclusive start: the named package is the first row. Leave it out to start at the beginning. - limit (optional, integer) - Names per page, 1 to 1000. Default: 1000. - cursor (optional, string) - Cursor from `page.nextCursor` of the previous response. It only continues the same lookup and filters. Pagination: send query `cursor` from prior `data.page.nextCursor`; stop when `data.page.hasMore` is false. curl "https://api.socialfetch.dev/v1/npm/registry/packages?after=express&limit=100" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/registry/changes List npm registry changes Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/registry/changes/get.mdx SDK: client.npm.listRegistryChanges({ since: 141000000, limit: 100 }) Parameters: - since (optional, integer) - Start after this sequence. Omit it or use `0` for the oldest changes. No call returns the current sequence: for recent changes pass one such as `141000000`, then your stored `lastSeq`. Not with `cursor`. - limit (optional, integer) - Changes per page, 1 to 1000. Default: 100. - cursor (optional, string) - Cursor from `page.nextCursor` of the previous response. It only continues the same lookup and filters. Pagination: send query `cursor` from prior `data.page.nextCursor`; stop when `data.page.hasMore` is false. curl "https://api.socialfetch.dev/v1/npm/registry/changes?since=141000000&limit=100" \ -H "x-api-key: YOUR_API_KEY" ## GET /v1/npm/registry/recent List npm recent package updates Credit cost: 1 credit. Failed requests are free. Auth: API key or x402 payment (no key needed for payment) Docs: https://www.socialfetch.dev/docs/api/v1/npm/registry/recent/get.mdx SDK: client.npm.listRegistryRecent() curl "https://api.socialfetch.dev/v1/npm/registry/recent" \ -H "x-api-key: YOUR_API_KEY"