Basic LTL rate request
Get rates for a single pallet from Chicago to Los Angeles:
curl -X POST https://api.shippeek.com/rates \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"originPostalCode": "60601",
"originType": "business dock",
"destPostalCode": "90210",
"destType": "business dock",
"items": [
{
"weight": 500,
"freightClass": 70,
"length": 48,
"width": 40,
"height": 48,
"quantity": 1,
"package": "Pallets_48x40"
}
]
}'
LTL with accessorials
Add liftgate delivery and arrival notification:
curl -X POST https://api.shippeek.com/rates \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"originPostalCode": "60601",
"originType": "business dock",
"destPostalCode": "90210",
"destType": "residential",
"charges": ["liftgate delivery", "arrival notice"],
"items": [
{
"weight": 300,
"freightClass": 85,
"length": 48,
"width": 40,
"height": 36,
"quantity": 1,
"package": "Pallets_48x40"
}
]
}'
Residential delivery charges are automatically applied when destType is set to residential. You do not need to add a separate accessorial for it.
Parcel rate request
Get UPS and FedEx parcel rates for a single package:
curl -X POST https://api.shippeek.com/rates/parcel \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"originPostalCode": "60601",
"originType": "business dock",
"destPostalCode": "90210",
"destType": "residential",
"charges": ["signature required"],
"items": [
{
"weight": 15,
"length": 12,
"width": 10,
"height": 8,
"quantity": 1,
"package": "Custom"
}
]
}'
Filter by carrier
Request rates from specific carriers only:
curl -X POST "https://api.shippeek.com/rates?carriers=exla,saia,odfl" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"originPostalCode": "60601",
"destPostalCode": "90210",
"items": [
{
"weight": 500,
"freightClass": 70,
"quantity": 1
}
]
}'
Streaming rates (SSE)
Use the streaming endpoint to receive rates as each carrier responds, instead of waiting for all carriers:
const response = await fetch('https://api.shippeek.com/rates/ltl/stream', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.SHIPPEEK_API_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
originPostalCode: '60601',
destPostalCode: '90210',
items: [{ weight: 500, freightClass: 70 }],
}),
});
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const text = decoder.decode(value);
// Each SSE event contains a JSON-encoded rate
const lines = text.split('\n').filter(line => line.startsWith('data: '));
for (const line of lines) {
const rate = JSON.parse(line.slice(6));
console.log(`${rate.carrier}: $${rate.total}`);
}
}
Streaming is useful when building real-time UIs that show rates as they arrive.