{"uid":"cap_QQXSRc54A2QnOPVD_QCM5","slug":"npm-package-download-statistics-api-5e73355d","name":"npm Package Download Statistics API","description":"Real-time GitHub trending repos, repo analytics, npm download stats, Hacker News stories, and DeFi yield data for AI agents. Pay per request via x402 (USDC on Base).","url":"https://myearnings-seven.vercel.app/npm-downloads","method":"GET","headers":{},"bodySchema":{"type":"object","required":["package"],"properties":{"period":{"enum":["day","week","month"],"type":"string","description":"Download period"},"package":{"type":"string","description":"npm package name"}}},"responseSchema":{"type":"object","properties":{"package":{"type":"string"},"downloads":{"type":"integer"},"daily_average":{"type":"integer"},"popularity_tier":{"enum":["mega","tier1","tier2","tier3","tier4","niche"],"type":"string"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_1Nunhz9REohSFOD496Qrw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns download counts, daily averages, and popularity tier for a given npm package over a specified period","exampleAgentPrompt":"Can you look up the npm download stats for the 'axios' package over the last week and tell me how popular it is?","exampleUseCases":[{"title":"Vetting an open-source dependency","prompt":"Before I add 'zod' as a dependency, can you check how many times it gets downloaded on npm per week and what popularity tier it falls into?"},{"title":"Comparing library adoption for a tech blog post","prompt":"I'm writing about state management libraries — can you pull the npm download counts and daily averages for 'zustand' over the last month so I can cite real usage numbers?"},{"title":"Monitoring a published package's traction","prompt":"I published 'my-color-utils' to npm last quarter — can you check its total downloads and tell me whether it's in the niche or tier4 category yet?"}],"resultDescription":"Returns a JSON object containing the package name, total download count for the requested period, daily average download count, and a popularity tier label (one of: mega, tier1, tier2, tier3, tier4, or niche) indicating the package's relative usage ranking on npm.","failureModes":["Package not found on npm registry — returns an error if the package name is misspelled or does not exist","Invalid period parameter — unrecognized period strings may return an error or default to a fallback period","Payment failure — x402 payment not completed results in HTTP 402 and no data returned","Rate limiting or upstream npm API unavailability causing delayed or failed responses"],"whenToPreferThis":"Choose this endpoint when you need structured, pre-computed npm download analytics (total downloads, daily average, and popularity tier classification) without having to query the raw npm registry API yourself. Ideal for agents enriching package metadata, performing dependency audits, or surfacing popularity signals in developer tooling workflows. The popularity tier enum makes it especially useful for quick categorical judgments without post-processing.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:37:21.550Z","isFirstParty":false}