Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

warpfreight

The official Python client for the Warp freight API. Quote real, bookable freight prices with no API key, no account, and no card. Book and track once you have a key.

pip install warpfreight

Zero third-party dependencies — it uses only the Python standard library.

Quote (keyless)

from warpfreight import WarpFreight

warp = WarpFreight()  # no key needed to quote

q = warp.quote(
    origin_zip="90001",
    destination_zip="10001",
    pickup_date="2026-09-01",
    pallets=2,
    weight_lbs_per_pallet=500,
    commodity="auto parts",
    length_in=48, width_in=40, height_in=48,
)

print(q["price_usd"], q["transit_days"], q["quote_id"])

The price is real and bookable. quote_id is an opaque, bookable token — pass it straight to book().

Compare every mode in one call

The same palletized load can move as LTL, full truckload, a cargo van, or a 26' box truck, often at very different prices. compare_modes prices all of them keylessly and hands back the recommended one:

result = warp.compare_modes(
    origin_zip="90001", destination_zip="10001",
    pickup_date="2026-09-01", pallets=2, weight_lbs_per_pallet=500,
)

Modes Warp can't serve for a lane come back explicitly unavailable with the reason, so nothing is silently dropped.

Book (needs an API key + a card)

Quoting is keyless; booking spends money, so it needs a key and a card on file. Get a key instantly at wearewarp.com/developers — no card required to issue one.

warp = WarpFreight(api_key="wak_live_...")  # or set WARPFREIGHT_API_KEY

booking = warp.book(quote_id=q["quote_id"], reference="PO-4471")
print(booking["shipment_number"])

If the account has no card on file, book() raises a WarpFreightError with code == "WARPFREIGHT_PAYMENT_REQUIRED" and a checkout_url to add one. The quote stays valid.

Track

t = warp.track("S-199806-2617")
print(t["status"])

Configuration

The API key is resolved in this order:

  1. WarpFreight(api_key="...")
  2. WARPFREIGHT_API_KEY environment variable
  3. WARP_API_KEY (deprecated alias — still works, warns once)

Errors

Every failure raises WarpFreightError:

from warpfreight import WarpFreight, WarpFreightError

try:
    warp.book(quote_id="wq_expired")
except WarpFreightError as e:
    print(e.code)          # e.g. "WARPFREIGHT_QUOTE_EXPIRED"
    print(e.status)        # HTTP status
    print(e.checkout_url)  # set when a card is required

code is prefixed WARPFREIGHT_ so it stays greppable and attributable when pasted into a search box or an AI assistant.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages