JavaScript Bundle Size API
Bundle size of npm packages and versions as bundlephobia.com measures them: minified and gzipped bytes, dependency count, what makes up the bundle, ES module, tree-shaking and side-effect flags, peer dependencies and the repository link. One record per package you list.
$0.50 per 1,000 records
You pay only for the records you get. Zero records cost zero. 10,000 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.
Data from bundlephobia.com
Get this data
Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.
Try it
Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 10,000 records of this API, no card. Create a free key
For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
- Small runs answer in the same request; longer ones answer
202with a run to poll. fieldsreturns only the fields you name. The examples send the ones picked on this page.Idempotency-Keyis optional. A retry with it is never charged twice.- You pay for records returned. Zero records cost zero.
curl -X POST "https://pullrow.dev/v1/apis/js-bundle-size/run" \
-H "Authorization: Bearer $PULLROW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"packages":["react@18.2.0","lodash"]},"max_items":50}'Inputs
Send them as input in the request body. Leave one out to use its default.
What's in each record
22 fields: 21 here, 1 technical one under Technical details.
Basics
- Requested package
The package as you listed it, such as react@18.2.0 or lodash.
Example r•••@18.2.0
- Name
Package name on npm, such as react or @reduxjs/toolkit.
Example react
- Version
The version measured: the one you asked for, or the newest one matching your range or tag (latest when none is given).
Example 18.2.0
- Status
ok when sizes were measured; not_found, unsupported or failed otherwise (see error).
Example ok
- Size bytes
Minified bundle size in bytes, dependencies included.
Example 6,618
- Gzip bytes
Minified and gzipped bundle size in bytes: roughly what a browser downloads.
Example 2,608
- Dependency count
Number of dependencies bundled with the package.
Example 1
- Composition
Approximate minified bytes each part adds to the bundle, by name: the package itself and its dependencies.
Example Redux: 18078 · Immer: 31282 · Reselect: 14612
- Peer dependencies
Peer dependencies the package expects the app to install, such as react.
Example react, react-redux
- Has js module
Yes when the package ships an ES module build (a module entry).
Example No
- Module entry
Path of that ES module entry inside the package, when bundlephobia gives it.
Example dist/redux-toolkit.legacy-esm.js
- Module type
Yes when the package declares itself an ES module package (type module).
Example No
- Tree shakeable
Yes when bundlers can drop unused exports: an ES module entry, a jsnext:main entry or type module.
Example No
- Has side effects
False when the package declares itself free of side effects; true when it does not, or lists files that have them.
Example Yes
- Side effect files
Files the package lists as having side effects, when it lists them.
Example *.css
- Asset types
Kinds of files in the bundle, such as js and css.
Example js
- Scoped
True for a scoped package such as @types/node.
Example No
- Description
The package's own description.
Example React is a JavaScript library for building user interfaces.
Links
- Link
The package's result page on bundlephobia.com.
Example bundlephobia.com/package/r%E2%80%A2%E2%80%A2%E2%80%A2@18.2.0
- Npm link
The measured version's page on npmjs.com.
Example npmjs.com/package/react/v/18.2.0
- Repository link
Code repository of the package, as a browser link.
Example github.com/facebook/react
Technical detailsField names and types for developers, and the 1 field hidden above
Hidden by default
This field comes with each record too. It is an internal code, a note about how the record was read or a copy of what was searched for, so the lists above leave it out.
- Error
errorWhy there are no sizes, for records whose status is not ok.
Field names and types
The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.
| Field name | Type | Shown on this page as | Filled |
|---|---|---|---|
requested_package | text | Requested package | 3 of 3 |
name | text | Name | 3 of 3 |
version | text | Version | 3 of 3 |
status | text | Status | 3 of 3 |
url | link | Link | 3 of 3 |
npm_url | link | Npm link | 3 of 3 |
size_bytes | number | Size bytes | 3 of 3 |
gzip_bytes | number | Gzip bytes | 3 of 3 |
dependency_count | number | Dependency count | 3 of 3 |
composition | group of values | Composition | 2 of 3 |
peer_dependencies | list | Peer dependencies | 2 of 3 |
has_js_module | yes or no | Has js module | 3 of 3 |
module_entry | text | Module entry | 2 of 3 |
is_module_type | yes or no | Module type | 3 of 3 |
is_tree_shakeable | yes or no | Tree shakeable | 3 of 3 |
has_side_effects | yes or no | Has side effects | 3 of 3 |
side_effect_files | list | Side effect files | 1 of 3 |
asset_types | list | Asset types | 3 of 3 |
is_scoped | yes or no | Scoped | 3 of 3 |
repository_url | link | Repository link | 3 of 3 |
description | text | Description | 3 of 3 |
error | text | Error (hidden) | 0 of 3 |
How it reads the site
Runs on a reader we built and maintain by hand for this site.
Save as pipeline
A pipeline remembers this API, your inputs and the fields you picked. It can run on a schedule and email you the results.
Sample records
| Record | Name | Requested package | Version | Status | Size bytes | Gzip bytes | Dependency count | Composition | Peer dependencies | Has js module | Module entry | Module type | Tree shakeable | Has side effects | Side effect files | Asset types | Scoped | Description | Link | Npm link | Repository link |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | react | r•••@18.2.0 | 18.2.0 | ok | 6,618 | 2,608 | 1 | — | — | No | — | No | No | Yes | — | js | No | React is a JavaScript library for building user interfaces. | bundlephobia.com/package/r%E2%80%A2%E2%80%A2%E2%80%A2@18.2.0 | npmjs.com/package/react/v/18.2.0 | github.com/facebook/react |
| 2 | @reduxjs/toolkit | @reduxjs/t•••@2.2.1 | 2.2.1 | ok | 37,951 | 13,589 | 4 | Redux: 18078 · Immer: 31282 · Reselect: 14612 | react, react-redux | Yes | dist/redux-toolkit.legacy-esm.js | No | Yes | No | — | js | Yes | The official, opinionated, batteries-included toolset for efficient Redux development | bundlephobia.com/package/@reduxjs/t%E2%80%A2%E2%80%A2%E2%80%A2@2.2.1 | npmjs.com/package/@reduxjs/toolkit/v/2.2.1 | github.com/reduxjs/redux-toolkit |
| 3 | antd | a•••@5.15.0 | 5.15.0 | ok | 1,401,353 | 432,276 | 48 | Rc resize observer: 7792 · Rc util: 47156 · Babel runtime: 23956 | react, react-dom | Yes | es/index.js | No | Yes | Yes | *.css | js | No | An enterprise-class UI design language and React components implementation | bundlephobia.com/package/a%E2%80%A2%E2%80%A2%E2%80%A2@5.15.0 | npmjs.com/package/antd/v/5.15.0 | github.com/ant-design/ant-design |
Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.
Reliability
Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.
Incidents and repairs
How it is kept working What a repair can't do
A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.
- You pay only for records returned. A run that returns none costs nothing.
- Sizes are bundlephobia's own build of each package (minified, then gzipped, with its default settings), not your bundler's output; treat them as a fair comparison between packages and versions.
- bundlephobia.com is a free community service with no published request limit. Packages are read one at a time, about one a second; a version it has never measured is built on first request, which can take up to a minute.
- Up to 200 packages per run. Long lists of packages bundlephobia has never measured may not all finish within one run's time limit; ask again for the rest.
- Packages bundlephobia cannot build (native modules, packages for one operating system such as fsevents) come back with status unsupported; unknown names or versions come back as not_found; a build that fails or takes too long comes back as failed.
- composition and peer_dependencies are empty for some older measurements, where bundlephobia did not record them.
- No licence is stated for the numbers; credit bundlephobia.com when you publish them.
Version history
A run uses the live version unless the request names another one with version.
Manage this API
Only your workspace sees this part.
Automatic repair
Off: a rebuilt version is stored and waits for you in the version history.
Delete this API
Removes the API, its versions and the saved records of its runs. Calls to its address then answer 404. Records already charged stay charged. This cannot be undone.