
npm Registry Has a Free API — Query 2M+ JavaScript Packages Without Authentication
npm Is Not Just a CLI The npm registry exposes a free JSON API. No API key, no OAuth, no rate limits for reasonable usage. Every package on npm has a JSON endpoint. Get Package Metadata const res = await fetch ( " https://registry.npmjs.org/express " ); const pkg = await res . json (); console . log ( ` ${ pkg . name } — ${ pkg . description } ` ); console . log ( `Latest: ${ pkg [ " dist-tags " ]. latest } ` ); console . log ( `Versions: ${ Object . keys ( pkg . versions ). length } ` ); console . log ( `License: ${ pkg . license } ` ); Get Specific Version const res = await fetch ( " https://registry.npmjs.org/react/19.0.0 " ); const version = await res . json (); console . log ( `Dependencies:` , Object . keys ( version . dependencies || {})); console . log ( `Size: ${ version . dist . unpackedSize } bytes` ); console . log ( `Tarball: ${ version . dist . tarball } ` ); Get Download Counts // Last week downloads const res = await fetch ( " https://api.npmjs.org/downloads/point/last-
Continue reading on Dev.to Webdev
Opens in a new tab


