100 free credits. No credit card required.Start building
Logo
npm logonpm API

Get npm package data with one API

Search npm and read any package version with its dependencies, licence, maintainers, downloads and tarball integrity hash, as structured JSON with one SocialCrawl API key. Reads are priced in credits.

npm logo
/v1/npm

2 active endpoints. Package search and package version detail.

  • GET /v1/npm/search
  • GET /v1/npm/package

What npm endpoints does SocialCrawl ship?

Two read endpoints for the public npm registry. Search packages, then read one version in full.

/v1/npm/search

Packages matching search terms and npm qualifiers, each with its name, latest version, description, licence, links, keywords, maintainers by username, weekly and monthly downloads and dependents. Up to 100 a page for 100 pages, with npm's total. Standard tier (1 credit).

query, page, limit

/v1/npm/package

One version of a package by name or link, the latest by default: description, licence, homepage, repository, maintainers by username, dependencies, peer dependencies, engines and the tarball link with its integrity hash. A package or version npm does not have answers 404 and is not charged. Standard tier (1 credit).

package or url, version

npm Registry API2 endpoints supported
View docs
Packages

Returns the npm packages matching search terms, each with its latest version, description, licence, links, downloads and dependents.

Use it to find libraries for a task, compare their adoption, or track packages in an ecosystem.

1 credit

GET/v1/npm/search?query=react+state

query · Search terms, 1 to 300 characters, for example react state, with npm qualifiers such as keywords:hooks.

$ curl https://www.socialcrawl.dev/v1/npm/search?query=react+state \
    -H "x-api-key: sc_YOUR_API_KEY"
idle
// Running this live needs your own API key. Hit "Try it" to see an example response

How the npm API works

npm is a normal SocialCrawl data surface. You call GET /v1/npm/… with an API key, spend credits on live misses, and get a single JSON envelope back.

Authenticate every call

Send your key in the x-api-key header. No npm account is needed for public reads. The same key works across SocialCrawl platforms.

GET with query params

Search takes query, page and limit. Package takes package or url, and version. Formats are validated before any charge.

Pay in credits, not seats

Every npm route costs 1 credit. Cache hits cost 0.

Read one JSON envelope

Every response is the same shape: success, data, credits_used, credits_remaining, request_id, cached. Lists also carry pagination when the route pages.

The usual integration chain

Most products search a need once, then read the versions they depend on.

01Search packages
GET /v1/npm/search?query=…

PostList of packages with version, downloads and dependents

Compare candidates by adoption before choosing one.

02Read the version
GET /v1/npm/package?package=…

Post with dependencies, engines and the tarball hash

One call shows what a version pulls in.

03Read another version
GET /v1/npm/package?package=…&version=…

Post for a pinned version or a tag

Check what changed before an upgrade.

request
GET /v1/npm/search?query=react+state
Host: www.socialcrawl.dev
x-api-key: sc_your_api_key_here

GET /v1/npm/package?package=zod
response envelope
{
  "success": true,
  "data": {
    "post": {
      "id": "zod",
      "url": "https://www.npmjs.com/package/zod",
      "content": { "text": "TypeScript-first schema declaration and validation library with static type inference" },
      "ext": {
        "title": "zod",
        "npm": { "version": "4.6.7", "license": "MIT", "maintainers": ["colinhacks"] }
      }
    }
  },
  "credits_used": 1,
  "credits_remaining": 9999,
  "request_id": "req_…",
  "cached": false
}

What lands in data

Field names match the rest of SocialCrawl where archetypes align. Parse once, reuse across platforms.

PostListsearch

items[] with post.id (name), ext.title, url, content.text (description), ext.npm version, downloads_weekly, dependents

Postpackage

the version with ext.npm dependencies, peer_dependencies, engines, tarball_url, integrity

Inside the gateway

Same request lifecycle as every other /v1 platform endpoint. npm is not a sidecar.

  1. 01

    Edge receives the call

    Next.js catch-all routes into the Hono social API. We mint a request_id, authenticate the key, then enforce rate limit (600/min) and concurrency (50 in flight per key).

  2. 02

    Validate, then debit

    Registry lookup finds the npm route. Required params and format checks run first. Invalid input returns 400 with no charge. Valid calls debit the tier cost atomically before the read starts.

  3. 03

    Cache or fetch

    A deterministic cache key is built from platform + resource + params. Hit: return immediately, credits_used = 0. Miss: the public data is read live, with retries on 5xx or network errors and a circuit breaker if the source is unhealthy.

  4. 04

    Normalize and return

    npm data is mapped to the Post and PostList archetypes with the npm-only facts in ext.npm, validated, then wrapped in the success envelope and logged for billing audit.

Billing rules that matter in production

  • search and package: 1 credit
  • Cache hit: 0 credits
  • Empty / hard fail: auto-refund
  • Bad params: 400, never charged
  • No credits: 402, never charged
  • Unknown package or version: 404, never charged
  • Up to 100 packages a page, 100 pages
  • Maintainers by username only
  • No publishing or account data

How SocialCrawl gets npm data

npm data is public. We normalize it into the SocialCrawl schema so your code does not learn a second vendor SDK.

What npm is for this API

Public packages and published versions on the npm registry, with their dependencies, licences and downloads.

How SocialCrawl reaches it

Public data is read on request and normalized server-side, within each source's published usage rules.

What leaves our edge

PostList for search and Post for a version, the shared shapes. The npm-only facts sit in ext.npm.

What we do not ship live

No publishing, private packages, maintainer email addresses or account data.

field map sketch
name, version, description→ post.*name, version, description, links
dependencies, engines, licence→ post.ext.npmdependencies, engines, licence
downloads, dependents, tarball hash→ post.ext.npmdownloads, dependents, tarball hash

What this API is used for

The jobs this API is most often used for.

2active npm endpoints in the registry
1credit per call on every npm route

Dependency research, ecosystem tracking and supply-chain checks

Callers search a category of package, then read the versions they depend on when those change. Package versions with their dependencies and tarball integrity hashes in the shared Post schema, from the same key as the rest of the catalog.

Live misses read the public source on request. Repeat calls hit cache and cost 0 credits.

Use case examples

Common ways teams put this data to work, and the stack each one tends to run.

Dependency review

Node, CI jobs

read each new version a project pulls in and check its licence, engines and dependencies.

Ecosystem tracking

Python, scheduled jobs

search a keyword on a schedule to follow new packages and their downloads.

Supply-chain checks

Go, security tooling

read a version's tarball integrity hash and compare it with what was installed.

How to call the npm API

Every npm route is 1 credit. Cache hits are free.

curl "https://www.socialcrawl.dev/v1/npm/search?query=react%20state" \
  -H "x-api-key: sc_your_api_key_here"
curl "https://www.socialcrawl.dev/v1/npm/package?package=zod" \
  -H "x-api-key: sc_your_api_key_here"
npm logonpm on SocialCrawl

Same key as the rest of the catalog

Endpoints

What data does the npm Registry API return?

Every endpoint returns structured JSON in a unified envelope. Computed fields such as engagement rate and content category are included only where the endpoint supports them and the required source inputs are present.

FAQ

Have a question? We got answers

Find answers to frequently asked questions about SocialCrawl's API, pricing, and capabilities.

Contact us
What does the SocialCrawl npm API cover?
It covers 2 endpoints: Search and Package. They search npm packages and read one published version with its dependencies, in the same unified JSON as the other 94 platforms.
Can I read a scoped package?
Yes. Pass the full name, for example @vue/server-renderer, or the package's npm page as url.
Does it return download counts?
Yes. Search results carry weekly and monthly downloads and the number of dependents in post.ext.npm.
Do I get maintainers' email addresses?
No. Maintainers are listed by npm username only.
How much does it cost?
Each call costs 1 credit, cache hits are free, and a package or version npm does not have answers 404 and is not charged. You start with 100 free credits.
Is scraping npm Registry data legal?
SocialCrawl returns publicly available npm Registry data and does not access private or login-gated content. Whether scraping fits your project depends on your use case and jurisdiction. You are responsible for complying with npm Registry's terms of service and applicable data-protection laws such as GDPR and CCPA. This is general information, not legal advice.
npm Registry scraping API vs the official npm Registry API: what's the difference?
With SocialCrawl there is no app review or approval queue. Sign up and call npm Registry endpoints immediately with a single x-api-key. Responses share one unified schema with every other SocialCrawl platform, and credit-based pricing replaces per-platform quotas. Official APIs are still the right choice for posting and other write actions: SocialCrawl is read-only data.

Ask AI about SocialCrawl

Read the npm Registry API reference in the docs

🤖 AI agent or LLM? Read this page as markdown