{"uid":"cap_TfdRI_xB5ooBY5Ayf6T_U","slug":"bundlephobia-npm-package-size-lookup-4e94569e","name":"Bundlephobia npm Package Size Lookup","description":"npm package bundle size from Bundlephobia's public size API: minified and gzipped size in bytes, version, number of dependencies, repository and description. Give a package name, optionally with @version (e.g. react@18.3.1). Sizes are as Bundlephobia computes them.","url":"https://api.fadeandco.workers.dev/api/dev/bundlephobia?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["package"],"properties":{"package":{"type":"string","description":"npm package name, optionally with @version, e.g. react or lodash@4.17.21"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"source":"https://bundlephobia.com/api/size?package=react%4018.3.1","package":"react","version":"18.3.1","checkedAt":"2026-10-23T09:35:41.224Z","gzipBytes":2618,"repository":"https://github.com/facebook/react.git","description":"React is a JavaScript library for building user interfaces.","minifiedBytes":6629,"hasSideEffects":true,"dependencyCount":1}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_oSolFshnzMlULwW9rPzbM","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns the minified and gzipped bundle sizes, dependency count, version, and metadata for any npm package via Bundlephobia's size API.","exampleAgentPrompt":"What's the minified and gzipped bundle size of lodash@4.17.21 according to Bundlephobia, and how many dependencies does it have?","exampleUseCases":[{"title":"Evaluating library before adding to project","prompt":"Before I add date-fns to my project, can you check what its bundle size is — both minified and gzipped — and how many dependencies it pulls in?"},{"title":"Comparing bundle footprint of two packages","prompt":"I'm choosing between moment and dayjs for date handling. What does Bundlephobia say about the gzipped size and dependency count of each?"},{"title":"Auditing a specific versioned release","prompt":"Can you look up the bundle size for react@18.3.1 on Bundlephobia? I want to know the minified bytes, gzip bytes, and whether it has any side effects."}],"resultDescription":"Returns a JSON object with the npm package name, resolved version, minified size in bytes, gzipped size in bytes, dependency count, side effects flag, repository URL, package description, the Bundlephobia source URL used, and a timestamp of when the check was performed.","failureModes":["Package not found on npm — returns an error if the package name is invalid or does not exist","Version not found — if a specific @version is requested but does not exist in the registry","Bundlephobia upstream unavailable — if Bundlephobia's own API is down, the proxy will fail","Rate limiting — high call volume may trigger upstream throttling","Private packages — packages not published publicly to npm will not be resolvable"],"whenToPreferThis":"Use this endpoint when you need accurate, Bundlephobia-computed bundle size metrics for any npm package by name and optional version. Prefer this over manual npm registry checks when you specifically need minified and gzipped byte sizes and dependency counts as computed by Bundlephobia's tree-shaking analysis, rather than raw install size.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T12:43:00.237Z","isFirstParty":false,"canonicalSlug":"bundlephobia-npm-package-size-lookup-4e94569e"}