Developers
QuickFreightCalc API
Truckload quotes in your own website, TMS or spreadsheet  ·  API plan, $199.99/month
What it does

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.

Getting started
  1. Get the API plan. Already subscribed? Choose API under Subscription on your Profile. New here? Sign up for the API plan.
  2. Create a key. Profile → API Access → Create key. Copy it right away; it's shown only once. You can have up to 5 keys and revoke any of them.
  3. Call the API from your server with the key in the 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.

Request
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.

FieldTypeWhat it does
origintext, requiredPickup: 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.
destinationtext, requiredDelivery, in the same formats.
milesnumberYour own miles (1–10,000). Leave it out and we look up driving miles with Google; that counts toward your 5,000 a month.
trailertextvan (default), reefer or flatbed.
weightnumberPounds. 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.
commoditytextstandard (default), food, hazmat, highval or oversized.
pickupDatedateYYYY-MM-DD. Used by season and extraDayRate.
deliveryDatedateYYYY-MM-DD. With extraDayRate, adds a charge for days beyond normal transit (about 500 miles a day).
marginnumberYour margin in percent, 0–100. Default 15.
ratestextsheet: 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.
baseRatePerMilenumberYour own base rate in dollars per mile, used instead of ours.
dieselPricenumberDiesel in dollars per gallon. Adds a fuel surcharge of (price − $1.25) ÷ 6.5 per mile.
capacitytrue / falseAdjust for this month's load-to-truck ratio (up to ±12%). Default false.
seasontextA 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.
holidayslistAny of roadcheck, brake_week, memorial, july4, labor, thanksgiving, xmas_nye, mothers_day.
marketnumberMarket adjustment in percent, −10 to 30. Default 0.
extraDayRatenumberDollars 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.

Examples

curl

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"
  }'

JavaScript (Node.js)

// 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);

Python

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
// 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'];
Response

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"
}
Errors

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."
  }
}
HTTPcodeMeaning
400invalid_requestA field is missing or not valid. field says which one.
400invalid_jsonThe body isn't a JSON object.
401missing_key, invalid_keyNo key was sent, or it's wrong or revoked.
403plan_requiredThe account isn't on the API plan.
403subscription_inactiveThe subscription has ended or its payment failed.
405method_not_allowedUse POST.
413too_largeThe body is over 4 KB.
422location_not_foundWe couldn't find a location; field says which. Counts toward the month.
422no_routeThere's no driving route between the two places. Counts toward the month.
422same_locationThe pickup and delivery are the same place. Counts toward the month.
429rate_limitedMore than 60 requests in a minute. Wait and try again (see the Retry-After header).
429monthly_limitThis billing month's 5,000 quotes with automatic miles are used. Send miles, or wait for your next billing month.
503miles_unavailableAutomatic miles are unavailable right now. Doesn't count. Try again shortly, or send miles.
503unavailableThe API is temporarily unavailable. Try again shortly.
Limits
A quote form on your website

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:

Visitor's browser→Your server (holds the key)→QuickFreightCalc API
// 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.

How quotes are figured

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)
Showing quotes

Questions or need a higher limit?
Email info@quickfreightcalc.com.