DEV Community

Freightapis.dev
Freightapis.dev

Posted on

One REST API for carrier terminals and global seaports

If you've ever built quoting, a TMS integration, or any LTL shipping feature, you've hit the same wall I did: the reference data is a mess. Every carrier's terminal list is a different scraped HTML page, and seaport data is scattered across PDFs.

I got tired of re-scraping it for every project, so I put it behind one REST API: FreightAPIs. This post shows the lookups I reach for most.

WHAT'S IN IT

  • Carrier terminals — 10 LTL/freight carriers (ABF, Estes, Saia, TForce, CEVA, USPS, and more), searchable by state, ZIP, city, radius, or batch
  • Seaports — 4,400+ global ports by UN/LOCODE, country, shipping company, or geographic radius
  • USPS drop points — 98,000+ post offices and collection boxes by ZIP, keyword, or ID

One API key, JSON in / JSON out. Free tier is 20 calls/month, no credit card.

SETUP

Grab a key at https://freightapis.dev/account, then:

npm install freightapis      (Node 18+)
pip install freightapis      (Python 3.8+)
Enter fullscreen mode Exit fullscreen mode

1) LOOK UP A CARRIER'S TERMINALS

Node:

    const FreightAPIs = require('freightapis');
    const fa = new FreightAPIs(process.env.FREIGHTAPIS_KEY);

    // Estes terminals in Georgia
    await fa.carrierByStateOrZip('estes', { state: 'GA' });

    // Search any carrier by city/ZIP
    await fa.carrierSearch('saia', 'atlanta');
Enter fullscreen mode Exit fullscreen mode

2) RESOLVE A SEAPORT

Node:

await fa.port('CNSHA');            // Shanghai, by UN/LOCODE
await fa.portsByCountry('CN');     // all China ports
await fa.portsNearby(31.2, 121.5, { radius: 200 });  // ports near a coordinate
Enter fullscreen mode Exit fullscreen mode

3) PYTHON IS THE SAME SHAPE

from freightapis import FreightAPIs
fa = FreightAPIs(os.environ["FREIGHTAPIS_KEY"])

fa.carrier_by_state_or_zip("estes", state="GA")
fa.carrier_search("saia", "atlanta")
fa.port("CNSHA")
fa.ports_by_country("CN")
Enter fullscreen mode Exit fullscreen mode

PREFER RAW HTTP?

Every endpoint is a plain REST call — no SDK required:

curl https://freightapis.dev/api/estes-location?state=GA -H "X-API-Key: YOUR_KEY"
Enter fullscreen mode Exit fullscreen mode

There's an OpenAPI spec (https://freightapis.dev/openapi.yaml) and a Postman collection (https://freightapis.dev/freightapis.postman_collection.json) if you'd rather generate your own client.

WRAPPING UP

Full reference is at https://freightapis.dev/docs. I built this because I needed it — if you work with LTL/freight data, I'd genuinely love feedback on what's missing. What logistics data do you end up scraping over and over?

Top comments (0)