Skip to main content
Official SDKs

FreightAPIs SDKs

Lightweight, zero-dependency client libraries for the FreightAPIs REST API — carrier terminal locations, global seaports, and NMFC freight classification. Auth, query encoding, and error handling are taken care of; or just call the REST API directly.

Node.js (Node 18+)

Zero dependencies, TypeScript types included. npmjs.com/package/freightapis →

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

// Carrier terminal locations
await fa.carrierByStateOrZip('estes', { state: 'GA' });
await fa.carrierSearch('saia', 'atlanta');

// Seaports
await fa.portsByCountry('CN');
await fa.port('CNSHA');

// NMFC (Pro plan)
await fa.nmfcSearch('furniture');

// Any endpoint not covered by a helper
await fa.request('GET', '/api/abf-location/service-days', { query: { zip: '72401' } });

Python (3.8+)

Uses requests if installed, else the stdlib. pypi.org/project/freightapis →

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

# Carrier terminal locations
fa.carrier_by_state_or_zip("estes", state="GA")
fa.carrier_search("saia", "atlanta")

# Seaports
fa.ports_by_country("CN")
fa.port("CNSHA")

# NMFC (Pro plan)
fa.nmfc_search("furniture")

# Any endpoint not covered by a helper
fa.request("GET", "/api/abf-location/service-days", query={"zip": "72401"})

Coverage & notes

  • Both SDKs cover all carrier-location, seaport, and NMFC endpoints, plus a request() escape hatch for anything else.
  • Authenticate with your API key; calls count against your subscription's monthly quota — the same meter the REST API uses.
  • NMFC classification requires a Pro plan; all other endpoints work on every plan.
  • Prefer raw HTTP? See the API documentation, OpenAPI spec, or Postman collection.