Your software sends us a lane — pickup, delivery, trailer, weight — and gets back a quote: miles, rate per mile, total and a full breakdown. It's the same calculation as the calculator, with this month's rates, so the API and the website always agree.
Common uses: a "Get a quote" form on your own website, suggested rates inside your TMS, or pricing a list of lanes from a spreadsheet or database.
The API plan is $199.99/month and includes everything in Pro Max on the website, plus 5,000 API quotes with automatic miles every billing month. Requests where you send your own miles don't count toward the 5,000.
Authorization header, as in the examples below.Keep your key on your server. Store it in an environment variable or secrets manager. Never put it in a web page, a mobile app or a public code repository: anyone who has it can use up your quotes. The API doesn't accept calls made directly from a browser on another website for the same reason.
POST https://quickfreightcalc.com/api/v1/quote
Authorization: Bearer qfc_live_…
Content-Type: application/json
Send a JSON object. Only origin and destination are required; everything else defaults to what a first visit to the calculator uses.
| Field | Type | What it does |
|---|---|---|
origin | text, required | Pickup: a city and state ("Lancaster, PA"), a ZIP code or a street address. Include the state: a city on its own ("Lancaster") is looked up on our best match, which may be in another state, and the request counts as usual. With your own miles, the state also lets us use that region's rates; without one we use national rates. |
destination | text, required | Delivery, in the same formats. |
miles | number | Your own miles (1–10,000). Leave it out and we look up driving miles with Google; that counts toward your 5,000 a month. |
trailer | text | van (default), reefer or flatbed. |
weight | number | Pounds. Under 10,000: ×0.95 · 10,000–29,999: ×0.97 · 30,000–44,000: ×1.00 · over 44,000: ×1.08. Leave it out for ×1.00. |
commodity | text | standard (default), food, hazmat, highval or oversized. |
pickupDate | date | YYYY-MM-DD. Used by season and extraDayRate. |
deliveryDate | date | YYYY-MM-DD. With extraDayRate, adds a charge for days beyond normal transit (about 500 miles a day). |
margin | number | Your margin in percent, 0–100. Default 15. |
rates | text | sheet: your own rate sheet from your Profile page, for the pickup state's region (where your sheet is blank, this month's market rate). The default once you've saved a rate sheet. regional: this month's market rate for the pickup state's region (the default without a rate sheet). national: the national market rate. |
baseRatePerMile | number | Your own base rate in dollars per mile, used instead of ours. |
dieselPrice | number | Diesel in dollars per gallon. Adds a fuel surcharge of (price − $1.25) ÷ 6.5 per mile. |
capacity | true / false | Adjust for this month's load-to-truck ratio (up to ±12%). Default false. |
season | text | A seasonal profile, by pickup month: fl, se, ca, pnw, tx, az, gl, ne_produce, storage, mw, ne, sw, national. Same list as the calculator's Seasonality setting. |
holidays | list | Any of roadcheck, brake_week, memorial, july4, labor, thanksgiving, xmas_nye, mothers_day. |
market | number | Market adjustment in percent, −10 to 30. Default 0. |
extraDayRate | number | Dollars per extra transit day, when both dates are sent. |
Field names are case-sensitive, and unknown fields are rejected so a typo can't quietly change a quote. Numbers can be sent as numbers or numeric strings.
curl https://quickfreightcalc.com/api/v1/quote \
-H "Authorization: Bearer $QFC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"origin": "Lancaster, PA",
"destination": "New York, NY",
"trailer": "reefer",
"weight": 42000,
"commodity": "food",
"pickupDate": "2026-11-20"
}'
// Node.js 18 or newer, on your server
const resp = await fetch('https://quickfreightcalc.com/api/v1/quote', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.QFC_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
origin: 'Lancaster, PA',
destination: 'New York, NY',
trailer: 'reefer',
weight: 42000,
}),
});
const data = await resp.json();
if (!resp.ok) throw new Error(data.error.message);
console.log(data.quote.total, data.lane.miles);
import os
import requests
resp = requests.post(
"https://quickfreightcalc.com/api/v1/quote",
headers={"Authorization": f"Bearer {os.environ['QFC_API_KEY']}"},
json={
"origin": "Lancaster, PA",
"destination": "New York, NY",
"trailer": "reefer",
"weight": 42000,
},
timeout=15,
)
data = resp.json()
if resp.status_code != 200:
raise RuntimeError(data["error"]["message"])
print(data["quote"]["total"], data["lane"]["miles"])
<?php
// PHP (for example a WordPress site), on your server
$ch = curl_init('https://quickfreightcalc.com/api/v1/quote');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 15,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('QFC_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'origin' => 'Lancaster, PA',
'destination' => 'New York, NY',
'trailer' => 'reefer',
'weight' => 42000,
]),
]);
$data = json_decode(curl_exec($ch), true);
echo $data['quote']['total'] ?? $data['error']['message'];
A successful request returns HTTP 200:
{
"quote": {
"total": 1075.48,
"ratePerMile": 6.48,
"currency": "USD"
},
"lane": {
"origin": {
"input": "Lancaster, PA",
"name": "Lancaster, PA",
"city": "Lancaster",
"state": "PA",
"zip": "",
"county": "Lancaster County",
"lat": 40.0379,
"lng": -76.3055,
"partialMatch": false
},
"destination": {
"input": "New York, NY",
"name": "New York, NY",
"city": "New York",
"state": "NY",
"zip": "",
"county": "New York County",
"lat": 40.7128,
"lng": -74.006,
"partialMatch": false
},
"miles": 166,
"milesSource": "google",
"driveSeconds": 10620,
"driveTime": "2h 57m"
},
"shipment": {
"trailer": "reefer",
"weight": 42000,
"commodity": "food",
"pickupDate": "2026-11-20",
"deliveryDate": null
},
"breakdown": {
"rateRegion": "northeast",
"rateSource": "market",
"baseRatePerMile": 3.36,
"multipliers": {
"weight": 1,
"distance": 1.5525,
"commodity": 1.08,
"capacity": 1,
"season": 1,
"holidays": 1,
"market": 1
},
"adjustedRatePerMile": 5.6337,
"fuelSurchargePerMile": 0,
"cost": 935.2,
"extraDays": 0,
"extraDayCharge": 0,
"marginPercent": 15,
"margin": 140.28
},
"ratesUpdated": "November 11, 2026",
"usage": {
"used": 128,
"limit": 5000,
"resetsAt": "2026-12-08T14:02:11.000Z"
},
"attribution": "Miles and drive time: Google Maps"
}
quote.total is the price to quote, including your margin, to the cent. The calculator shows the same number rounded to whole dollars.lane.origin and lane.destination show the places we matched, so you can check them. partialMatch: true means Google matched only part of what was sent.lane.milesSource is google for automatic miles or provided for yours. With your own miles there's no name, coordinates or drive time.breakdown shows every step of the calculation (see How quotes are figured).usage shows this billing month's quotes with automatic miles, including this one.attribution appears when miles came from Google; see Showing quotes.Errors come back with an HTTP status and a body like this; message is written to be shown to a person.
{
"error": {
"code": "invalid_request",
"field": "trailer",
"message": "trailer must be one of: van, reefer, flatbed."
}
}
| HTTP | code | Meaning |
|---|---|---|
| 400 | invalid_request | A field is missing or not valid. field says which one. |
| 400 | invalid_json | The body isn't a JSON object. |
| 401 | missing_key, invalid_key | No key was sent, or it's wrong or revoked. |
| 403 | plan_required | The account isn't on the API plan. |
| 403 | subscription_inactive | The subscription has ended or its payment failed. |
| 405 | method_not_allowed | Use POST. |
| 413 | too_large | The body is over 4 KB. |
| 422 | location_not_found | We couldn't find a location; field says which. Counts toward the month. |
| 422 | no_route | There's no driving route between the two places. Counts toward the month. |
| 422 | same_location | The pickup and delivery are the same place. Counts toward the month. |
| 429 | rate_limited | More than 60 requests in a minute. Wait and try again (see the Retry-After header). |
| 429 | monthly_limit | This billing month's 5,000 quotes with automatic miles are used. Send miles, or wait for your next billing month. |
| 503 | miles_unavailable | Automatic miles are unavailable right now. Doesn't count. Try again shortly, or send miles. |
| 503 | unavailable | The API is temporarily unavailable. Try again shortly. |
miles never count.usage.429 monthly_limit until your next billing month; requests with your own miles keep working.Your web page can't call the API directly, because that would expose your key. Instead, the page sends the lane to your own server, your server asks us for the quote, and your server sends the price back to the page:
// Your server (Node.js + Express). Your web page's quote form posts
// { origin, destination } here; the key never leaves your server.
app.post('/get-quote', async (req, res) => {
const resp = await fetch('https://quickfreightcalc.com/api/v1/quote', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.QFC_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
origin: String(req.body.origin || ''),
destination: String(req.body.destination || ''),
trailer: 'van',
margin: 20, // your markup
}),
});
const data = await resp.json();
if (!resp.ok) return res.status(400).json({ message: data.error.message });
res.json({ price: data.quote.total, miles: data.lane.miles });
});
A public form spends your monthly allowance for every visitor's lookup. Consider a CAPTCHA, a limit on how often one visitor can ask, or offering the form only to signed-in customers.
Exactly like the calculator:
adjusted rate/mile = base rate × weight × distance × commodity × capacity × season × holidays × market
cost = (adjusted rate/mile + fuel surcharge/mile) × miles
total = (cost + extra-day charge) × (1 + margin)
ratesUpdated says which month's rates were used. Once you've saved a rate sheet on your Profile page, your own rate for the region (or your all-regions rate) is used instead, and the market rate only where your sheet is blank. breakdown.rateSource says which: sheet, market or provided (baseRatePerMile in the request).attribution field has text you can use.Questions or need a higher limit?
Email info@quickfreightcalc.com.