Freight Class API
NMFTA density-based LTL freight class from shipment dimensions and weight. JSON in, JSON out. CORS open. Free for 60 requests per hour without a key. Get a free sandbox key for 1,000 per hour.
30-second start
POST your shipment dimensions and weight. Get back the freight class plus density. 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/freight-class \
-H "Content-Type: application/json" \
-d '{
"length": 48,
"width": 40,
"height": 48,
"weight": 500
}'Or use GET with query params for one-liners:
curl GET
curl "https://www.wearewarp.com/api/v1/tools/freight-class?length=48&width=40&height=48&weight=500"
Request
POST /api/v1/tools/freight-class
Metric example:
curl
curl -X POST https://www.wearewarp.com/api/v1/tools/freight-class \
-H "Content-Type: application/json" \
-d '{
"length": 122,
"width": 102,
"height": 122,
"weight": 227,
"units": "cm",
"weight_unit": "kg"
}'Response
Every response has a data envelope (the computed result) and a meta envelope (rate limits, docs, upgrade path, attribution).
200 OK
{
"data": {
"freight_class": "100",
"density_pcf": 9.38,
"cubic_feet": 53.33,
"class_band": "Standard",
"note": "Density-based NMFTA class. NMFC commodity codes can override density for specific items. Verify the active tariff before booking. Warp prices by pallet, so freight class never changes your rate."
},
"meta": {
"request_id": "req_lzgk2zo_a1b2c3d4",
"tier": "anon",
"rate_limit": {
"limit": 60,
"remaining": 59,
"reset_at": "2026-05-14T19:00:00.000Z"
},
"docs": "https://www.wearewarp.com/developers/tools-api/freight-class",
"upgrade": "Get a free sandbox key for 1000/hr: https://www.wearewarp.com/agents/account",
"attribution": "Powered by Warp — https://www.wearewarp.com"
}
}Code samples
JavaScript (fetch)
const res = await fetch('https://www.wearewarp.com/api/v1/tools/freight-class', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
length: 48,
width: 40,
height: 48,
weight: 500,
}),
});
const { data, meta } = await res.json();
console.log(data.freight_class); // "100"
console.log(data.density_pcf); // 9.38Python (requests)
import requests
res = requests.post(
"https://www.wearewarp.com/api/v1/tools/freight-class",
json={"length": 48, "width": 40, "height": 48, "weight": 500},
)
data = res.json()["data"]
print(data["freight_class"]) # "100"
print(data["density_pcf"]) # 9.38curl with sandbox key
curl -X POST https://www.wearewarp.com/api/v1/tools/freight-class \
-H "Content-Type: application/json" \
-H "Authorization: Bearer wak_test_YOUR_KEY" \
-d '{
"length": 48,
"width": 40,
"height": 48,
"weight": 500
}'Rate limits and tiers
No tier blocks access. Hit the limit and the response includes an upgradeURL with the next tier's sign-up 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": {
"request_id": "req_lzgk2zo_r1l2m3t4",
"tier": "anon",
"rate_limit": { "limit": 60, "remaining": 0, "reset_at": "..." },
"docs": "https://www.wearewarp.com/developers/tools-api/freight-class",
"upgrade": "Get a free sandbox key for 1000/hr: https://www.wearewarp.com/agents/account",
"attribution": "Powered by Warp — https://www.wearewarp.com"
}
}Errors
Bad input example:
400 Bad Request
{
"error": "length, width, height, and weight must all be greater than zero.",
"code": "BAD_INPUT",
"meta": {
"request_id": "req_lzgk2zo_x9y8z7w6",
"tier": "anon",
"rate_limit": { "limit": 60, "remaining": 58, "reset_at": "..." },
"docs": "https://www.wearewarp.com/developers/tools-api/freight-class",
"attribution": "Powered by Warp — https://www.wearewarp.com"
}
}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 freight class is calculated
The API uses the NMFTA density table. Steps:
- Cubic feet = length × width × height (in inches) ÷ 1,728.
- Density (PCF) = weight (lbs) ÷ cubic feet.
- Class = NMFTA density-to-class lookup (50 to 500).
NMFC commodity codes can override density for specific items. The API returns a note field reminding you to verify the active tariff before booking.
Related
Get a free sandbox key
Sandbox keys take 30 seconds. No card. 1,000 freight-class calls per hour. The same key works across every Warp tool API and the freight quote sandbox.