Zum Inhalt springen
GET /v1/size

Bundle size of a package

Live testen

10 freie Calls pro Tag — keine Anmeldung, kein API-Key. Geht durchs oanor-Gateway.

Eigene Header (optional)
api.oanor.com/bundlephobia-api

Funktioniert. Hol dir einen API-Key und nutze sie in deinem Projekt.

API-Key holen

Code-Snippets

curl "https://api.oanor.com/bundlephobia-api/v1/size" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/bundlephobia-api/v1/size", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/bundlephobia-api/v1/size");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/bundlephobia-api/v1/size",
    headers={"x-oanor-key": "oanor_test_..."}
)

Beispiel-Response

Echte Antwort dieses Endpoints, erfasst beim letzten Health-Check.

{
    "data": {
        "name": "react",
        "assets": [
            {
                "gzip": 2909,
                "name": "main",
                "size": 7593,
                "type": "js"
            }
        ],
        "gzip_kb": 2.84,
        "size_kb": 7.42,
        "version": "19.2.7",
        "gzip_bytes": 2909,
        "repository": "https://github.com/facebook/react.git",
        "size_bytes": 7593,
        "description": "React is a JavaScript library for building user interfaces.",
        "has_js_module": false,
        "dependency_count": 0,
        "dependency_sizes": [
            {
                "name": "react",
                "approximate_size_kb": 7.62,
                "approximate_size_bytes": 7798
            }
        ],
        "has_side_effects": true,
        "peer_dependencies": []
    },
    "meta": {
        "timestamp": "2026-06-02T16:52:08.829Z",
        "request_id": "904a613e-fd21-41d3-978a-76ae04cf03f9"
    },
    "status": "ok",
    "message": "Bundle size of a package",
    "success": true
}