Stretch XL Freight · Developers

How to use your API key

A quick start for the live lane rates API: the header, your first request, examples, the response, quotas, errors, and how to regenerate a key.

1. Get your key

  1. Open the magic link in your email, or request a new one at the developer portal sign-in.
  2. In the portal, choose Issue key or Regenerate.
  3. Copy the key when it is shown. We hash it immediately and cannot show the full value again.

A key looks like sxlf_live_ followed by a long random string. Treat it like a password. Do not put it in frontend JavaScript, public repos, screenshots, or chat.

2. Put it in the X-API-Key header

Every request must send the key in the X-API-Key HTTP header. Query-string keys are not accepted (they leak in logs and Referer headers).

X-API-Key: sxlf_live_your_key_here

3. Make your first request

Call the lane rates endpoint with origin, destination, and optional equipment. Use POST or GET. The live URL is:

https://stretchxlfreight.com/api/?endpoint=api/lane_rates

The same handler also answers at /stretch-crm/api/?endpoint=api/lane_rates.

curl

curl -X POST 'https://stretchxlfreight.com/api/?endpoint=api/lane_rates' \
  -H 'X-API-Key: $SXLF_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "origin_city": "Atlanta",
    "origin_state": "GA",
    "dest_city": "Miami",
    "dest_state": "FL",
    "equipment": "van"
  }'

JavaScript (Node)

const res = await fetch(
  'https://stretchxlfreight.com/api/?endpoint=api/lane_rates',
  {
    method: 'POST',
    headers: {
      'X-API-Key': process.env.SXLF_API_KEY,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      origin_city: 'Atlanta',
      origin_state: 'GA',
      dest_city: 'Miami',
      dest_state: 'FL',
      equipment: 'van',
    }),
  }
);
const json = await res.json();
if (!json.success) throw new Error(json.message || 'lookup failed');
console.log(json.data.per_mile, json.data.quota);

Python

import os, requests

r = requests.post(
    'https://stretchxlfreight.com/api/?endpoint=api/lane_rates',
    headers={'X-API-Key': os.environ['SXLF_API_KEY']},
    json={
        'origin_city': 'Atlanta',
        'origin_state': 'GA',
        'dest_city': 'Miami',
        'dest_state': 'FL',
        'equipment': 'van',
    },
    timeout=10,
)
r.raise_for_status()
data = r.json()['data']
print(data['per_mile'], data['quota'])

4. Parameters

NameRequiredNotes
origin_cityYesCase-insensitive, e.g. Atlanta
origin_stateYes2-letter USPS code, e.g. GA
dest_cityYesCase-insensitive
dest_stateYes2-letter USPS code
equipmentNovan, reefer, flatbed, step_deck, hotshot, power_only. Omit for any.

5. Response shape

Successful responses are JSON with success: true and a data object:

{
  "success": true,
  "data": {
    "lane": {
      "origin": "Atlanta, GA",
      "destination": "Miami, FL",
      "equipment": "van"
    },
    "samples": 48,
    "rate": { "median": 3450, "low": 3200, "high": 3600 },
    "per_mile": { "median": 2.45, "low": 2.20, "high": 2.70 },
    "distance_avg": 662,
    "data_freshness": {
      "newest_load": "2026-11-10T20:30:31+00:00",
      "cache_fetched": "2026-11-11 07:15:00"
    },
    "is_estimate": false,
    "tier": "free",
    "quota": {
      "daily_quota": 100,
      "daily_used": 1,
      "daily_remaining": 99,
      "monthly_quota": 3000,
      "monthly_used": 1,
      "monthly_remaining": 2999
    },
    "fetched_at": "2026-11-11T12:15:00+00:00"
  }
}

When no live loads match the lane in the last 24 hours, is_estimate is true, rate may be null, and per_mile is a national bucket for that equipment.

6. Quotas and rate limits

PlanDailyMonthly
Free1003,000
Starter5005,000
Pro5,00050,000
Enterprise50,0001,500,000

Quota counters increment only on accepted, authenticated requests. Exceeding a quota returns 429. Invalid or revoked keys do not consume quota.

7. Error codes

HTTPWhen
400Missing origin/destination fields. Need origin_city, origin_state, dest_city, dest_state
401Missing, invalid, or revoked API key.
403Key is suspended, or the key is not entitled to this endpoint.
429Daily or monthly quota exceeded, or too many invalid-key attempts from one IP.
{ "success": false, "message": "Invalid or revoked API key", "data": null }

8. How to regenerate or revoke

  1. Sign in at the developer portal with a login link sent to your email.
  2. Regenerate creates a new key and immediately revokes the old one. Update your integration before you drop the new value — we only show the full key once.
  3. Revoke disables a key immediately. Later requests with that key return 401.