Developer
npm bundle size cost API
Returns an npm package's minified + gzipped byte size, dependency count, tree-shakeable and side-effect-free flags, a derived weight class, and estimated download time on slow 3G / 4G — normalized from Bundlephobia. The value-add is the derived weight classification and download-time estimate over the raw blob. Answers 'how big is this npm package', 'gzip size of lodash', 'is this package tree-shakeable', 'is this dependency heavy'.
Price$0.01per request
MethodPOST
Route/v1/dev/bundle-size
StatusLive
MIME typeapplication/json
Rate limit60/minute
Cache3600s public
devbundlesizenpmbundlephobiagziptree-shakingweight
API URL
Integration docshttps://x402.hexl.dev/v1/dev/bundle-sizeExample request
{
"package": "react",
"version": "18.2.0"
}Example response
{
"name": "react",
"version": "18.2.0",
"minifiedBytes": 6453,
"gzippedBytes": 2823,
"minifiedKB": 6.3,
"gzippedKB": 2.76,
"dependencyCount": 1,
"treeShakeable": false,
"sideEffectFree": false,
"weightClass": "tiny",
"downloadTime": {
"slow3gMs": 55,
"fast4gMs": 3
},
"repository": "https://github.com/facebook/react"
}Input schema
{
"type": "object",
"required": [
"package"
],
"properties": {
"package": {
"type": "string",
"examples": [
"react",
"lodash"
]
},
"version": {
"type": "string",
"examples": [
"18.2.0"
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}