CBM Calculator API
Cubic meters (CBM) from shipment dimensions. Returns CBM per piece, total CBM, and volumetric weight for both air (× 167) and ocean (× 1,000) freight pricing. JSON in, JSON out. CORS open. Free for 60 requests per hour without a key.
30-second start
POST your inputs. Get back the answer in JSON. No signup. No key required for the first 60 calls per hour per IP.
curl
curl -X POST https://www.wearewarp.com/api/v1/tools/cbm \
-H "Content-Type: application/json" \
-d '{"length":120,"width":100,"height":150,"qty":4,"units":"cm"}'Or use GET with query params for one-liners:
curl GET
curl "https://www.wearewarp.com/api/v1/tools/cbm?length=120&width=100&height=150&qty=4&units=cm"
Request
POST /api/v1/tools/cbm
Imperial input example (inches):
curl
curl -X POST https://www.wearewarp.com/api/v1/tools/cbm \
-H "Content-Type: application/json" \
-d '{"length":48,"width":40,"height":60,"qty":4,"units":"in"}'Response
Every response has a data envelope (the computed result) and a meta envelope (rate limits, docs, upgrade path, attribution).
200 OK
{
"data": {
"cbm_per_unit": 1.8,
"total_cbm": 7.2,
"qty": 4,
"volumetric_weight_air_kg": 1202.4,
"volumetric_weight_ocean_kg": 7200
},
"meta": {
"request_id": "req_lzgk2zo_a1b2c3d4",
"tier": "anon",
"rate_limit": { "limit": 60, "remaining": 59, "reset_at": "2026-05-15T19:00:00.000Z" },
"docs": "https://www.wearewarp.com/developers/tools-api/cbm",
"attribution": "Powered by Warp — https://www.wearewarp.com"
}
}Code samples
JavaScript (fetch)
const res = await fetch('https://www.wearewarp.com/api/v1/tools/cbm', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"length":120,"width":100,"height":150,"qty":4,"units":"cm"}),
});
const { data, meta } = await res.json();
console.log(data.length);Python (requests)
import requests
res = requests.post(
"https://www.wearewarp.com/api/v1/tools/cbm",
json={"length":120,"width":100,"height":150,"qty":4,"units":"cm"},
)
data = res.json()["data"]
print(data["length"])curl with sandbox key
curl -X POST https://www.wearewarp.com/api/v1/tools/cbm \
-H "Content-Type: application/json" \
-H "Authorization: Bearer wak_test_YOUR_KEY" \
-d '{"length":120,"width":100,"height":150,"qty":4,"units":"cm"}'Rate limits and tiers
No tier blocks access. Hit the limit and the response includes an upgradeURL with the next tier's signup flow.
Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers. The meta.rate_limit object mirrors the same values in JSON.
Rate-limited response:
429 Too Many Requests
{
"error": "Anonymous rate limit reached (60/hr). Get a free sandbox key for 1000/hr at https://www.wearewarp.com/agents/account.",
"code": "RATE_LIMITED",
"meta": { "tier": "anon", "rate_limit": { "limit": 60, "remaining": 0 }, "upgrade": "..." }
}Errors
Bad input example:
400 Bad Request
{
"error": "length, width, and height must all be greater than zero.",
"code": "BAD_INPUT",
"meta": { "request_id": "req_...", "docs": "https://www.wearewarp.com/developers/tools-api/cbm" }
}Attribution
The free tier carries an attribution request: link back to wearewarp.com from any surface that displays results from this API. A “Powered by Warp” link in your footer is enough. Live keys remove the attribution request.
Every API response includes meta.attribution so you can render the link programmatically.
How CBM is calculated
- CBM per piece. length × width × height ÷ 1,000,000 (cm input) or ÷ 61,023.7 (inch input).
- Total CBM. CBM per piece × qty.
- Air volumetric weight (kg). total CBM × 167. IATA-published standard for air freight billing.
- Ocean volumetric weight (kg). total CBM × 1,000. 1 CBM = 1 metric ton revenue weight on ocean carriers.
Ocean freight is billed at the higher of actual weight or volumetric weight (whichever generates more revenue). Air freight is the same logic. CBM is the universal volume unit for international freight.
Related
Get a free sandbox key
Sandbox keys take 30 seconds. No card. 1,000 calls per hour across every Warp tool API.