API Docs

TruckRate Pro REST API · Enterprise Plan Only · v1.0 · Questions: billing@truckrate.pro

Overview

The TruckRate Pro API lets you generate full freight rate quotes programmatically. Send an origin, destination, and equipment type — get back a complete quote with fuel, tolls, linehaul, drayage, and margin applied.

Built for 3PLs, dispatch software integrations, and carrier pricing tools that need real-time rate intelligence without manual data entry.

Enterprise Only — API access is included with the Enterprise plan ($799/mo). Your API key is emailed to you after signup. Contact billing@truckrate.pro to get your key.

Authentication

Pass your API key in the request body as apiKey. Keep it private — do not expose in client-side code.

Endpoint

POST https://truckrate.pro/api/quote

Generate a full freight rate quote. Returns fuel cost, toll charges, linehaul benchmarks, and a customer-ready quote price.

Request Body

ParameterTypeRequiredDescription
apiKeystringRequiredYour Enterprise API key
originstringRequiredAny US address, city+state, or ZIP code
destinationstringRequiredAny US address, city+state, or ZIP code
equipmentstringOptionalvan (default), reefer, flat, step, tanker
marginnumberOptionalYour target margin % (default: 20)
mpgnumberOptionalTruck MPG (default: 6.5)

Example Request

// POST https://truckrate.pro/api/quote
{
  "apiKey":      "trp_live_your_key_here",
  "origin":      "Chicago, IL",
  "destination": "Atlanta, GA",
  "equipment":   "van",
  "margin":      20,
  "mpg":         6.5
}

Response

Success (200)

{
  "success": true,
  "quote": {
    "total":    2734,       // All-in customer quote with margin
    "per_mile": 3.60,       // $/mile all-in
    "margin":   20,          // % margin applied
    "currency": "USD"
  },
  "breakdown": {
    "fuel":      716,        // Diesel cost at current state prices
    "tolls":     103,        // Truck tolls via TollGuru
    "linehaul": {
      "low":     1140,       // DAT low rate
      "mid":     1459,       // DAT mid rate
      "high":    1885        // DAT high rate
    },
    "your_cost": 2278,       // Total cost before margin
    "markup":    456         // Margin amount
  },
  "route": {
    "origin":       "Chicago, IL 60601",
    "destination":  "Atlanta, GA 30301",
    "miles":        760,
    "drive_time":   "13h 6m",
    "equipment":    "van",
    "fuel_price":   6.12,       // IL diesel $/gal
    "state_origin": "IL"
  },
  "meta": {
    "generated_at": "2026-05-07T22:00:00Z",
    "powered_by":   "TruckRate Pro API v1",
    "contact":      "billing@truckrate.pro"
  }
}

Error Responses

StatusErrorReason
401Invalid API keyAPI key missing or incorrect
400origin and destination are requiredMissing required fields
500Internal errorGeocoding or calculation failure

Code Examples

JavaScript / Node.js

const res = await fetch('https://truckrate.pro/api/quote', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    apiKey:      'trp_live_your_key',
    origin:      'Houston, TX',
    destination: 'Dallas, TX',
    equipment:   'reefer',
    margin:      22
  })
});
const data = await res.json();
console.log('Quote: $' + data.quote.total);

Python

import requests

response = requests.post('https://truckrate.pro/api/quote', json={
    'apiKey':      'trp_live_your_key',
    'origin':      'Los Angeles, CA',
    'destination': 'Phoenix, AZ',
    'equipment':   'flat',
    'margin':      18
})
data = response.json()
print(f"Quote: ${data['quote']['total']:,}")

Rate Limits

Enterprise plan: 500 requests/day. Need more? Contact billing@truckrate.pro.

Equipment Types

ValueDescriptionRate Multiplier
vanDry Van 53ft (default)1.00×
reeferRefrigerated / Temperature Control1.28×
flatFlatbed1.18×
stepStep Deck / Lowboy1.25×
tankerTanker / Liquid Bulk1.22×