NPM API
Base URL: https://notamitgamer-osma-npm-api.hf.space
GET /ping
Uptime check — always returns 200. Lightweight endpoint for UptimeRobot or health monitors; doesn't query the database.
curl https://notamitgamer-osma-npm-api.hf.space/ping
{ "ping": "pong" }
GET /health
Server status + total package count. Returns 200 with the package count once the database is ready; returns 503 if it's still initializing after a cold start.
curl https://notamitgamer-osma-npm-api.hf.space/health
{
"status": "ok",
"total_packages": 3881465
}
GET /stats
Dataset metadata and package count, intended for dashboard stats bars.
curl https://notamitgamer-osma-npm-api.hf.space/stats
{
"total_npm_packages": 3881465,
"source": "npmjs.com",
"note": "Snapshot dataset — updated periodically."
}
GET /browse
Paginated package list, ordered by package_no.
curl "https://notamitgamer-osma-npm-api.hf.space/browse?page=1&limit=5"
{
"page": 1,
"limit": 5,
"results": [
{ "no": 1, "name": "--123hoodmane-pyodide", "version": "latest", "url": "https://www.npmjs.com/package/..." }
]
}
GET /search
Ranked search across all packages. Results are ranked by match quality — exact match (0) first, starts-with (1) second, contains (2) last — then sorted alphabetically within each rank.
curl "https://notamitgamer-osma-npm-api.hf.space/search?q=react&limit=5"
{
"query": "react",
"count": 250,
"results": [
{ "no": 42, "name": "react", "version": "18.3.1", "url": "...", "rank": 0 },
{ "no": 88, "name": "react-dom", "version": "18.3.1", "url": "...", "rank": 1 }
]
}