npm Registry API
registry.npmjs.org · Developer Tools
The npm public registry — package metadata, download statistics, version history, and dependency info for 2M+ JavaScript packages. Free, no API key required.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Get package info
Get full metadata for the React package.
https://registry.npmjs.org/react
Hover any highlighted part to learn what it does
curl -X GET "https://registry.npmjs.org/react"
import requests
response = requests.get(
"https://registry.npmjs.org/react",
)
print(response.json())const url = 'https://registry.npmjs.org/react'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://registry.npmjs.org/react"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://registry.npmjs.org/react")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://registry.npmjs.org/react";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET
Get latest version
Get the latest version of React.
https://registry.npmjs.org/react/latest
Hover any highlighted part to learn what it does
curl -X GET "https://registry.npmjs.org/react/latest"
import requests
response = requests.get(
"https://registry.npmjs.org/react/latest",
)
print(response.json())const url = 'https://registry.npmjs.org/react/latest'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://registry.npmjs.org/react/latest"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://registry.npmjs.org/react/latest")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://registry.npmjs.org/react/latest";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET
Get download stats
Get last-month download count for Express.
https://registry.npmjs.org/https:/api.npmjs.org/downloads/point/last-month/express
Hover any highlighted part to learn what it does
curl -X GET "https://registry.npmjs.orghttps://api.npmjs.org/downloads/point/last-month/express"
import requests
response = requests.get(
"https://registry.npmjs.orghttps://api.npmjs.org/downloads/point/last-month/express",
)
print(response.json())const url = 'https://registry.npmjs.orghttps://api.npmjs.org/downloads/point/last-month/express'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://registry.npmjs.orghttps://api.npmjs.org/downloads/point/last-month/express"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://registry.npmjs.orghttps://api.npmjs.org/downloads/point/last-month/express")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://registry.npmjs.orghttps://api.npmjs.org/downloads/point/last-month/express";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- Package info: GET https://registry.npmjs.org/express
- Latest version: GET https://registry.npmjs.org/express/latest
- Specific version: GET https://registry.npmjs.org/express/4.18.0
- Downloads: GET https://api.npmjs.org/downloads/point/last-week/react