NETWORK OPERATIONAL

Get your API KEY

    API ROOT

        https://api.smartports.app/
            

Get your API KEY from your profile page. Log into your account and click your profile in the top-right corner to retrieve your secret API KEY.

Every tracking request carries the key inline in the JSON body as api_key — there is no Authorization header. The key must belong to a verified user. Contact us at [email protected] if you run into any trouble with your KEY.

Tracking — Overview


# Every endpoint is POST with a JSON body:
#   -H "Content-Type: application/json"
#   -d '{"api_key":"your_api_key", ...}'

# mode (bl / container / pedimento) selects the source:
#   carrier   → shipping line upstream        (default for bl, container)
#   terminal  → the Mexican port terminals
#   customs   → SAT Pedimento / Container

# terminal (optional, mode=terminal) scopes to ONE terminal.
# Without it, the free terminals capable of that type are swept.
            

Base URL: https://api.smartports.app. The reference type is decided by the endpoint you call — track/bl = BL, track/container = container, track/booking = booking, track/pedimento = pedimento, track/release = release document, track/awb = air waybill.

TerminalsContecon SSA TIMSA OCUPA (Manzanillo) · LCT APM (Lázaro Cárdenas — APM is paid, never swept) · ICAVE CICE GOLMEX (Veracruz) · ATP IPM (Altamira) · EIT (Ensenada). ATP is container-only, CICE is BL-only, IPM/GOLMEX are pending.

POD → aduana (for mode=customs when you pass pod instead of customs_id): MXZLO→160, MXLZC→510, MXVER→430, MXATM→810, MXENS→110, MXTAM→380, MXMZT→180.

Track Bill of Lading


# 1 · Carrier (default) — line derived from the BL prefix
curl -X POST https://api.smartports.app/track/bl -H "Content-Type: application/json" -d '{"api_key":"your_api_key","bl_code":"MEDUY8665505"}'

# 2 · Carrier — with explicit shipping_line
curl -X POST https://api.smartports.app/track/bl -H "Content-Type: application/json" -d '{"api_key":"your_api_key","bl_code":"MEDUY8665505","shipping_line":"MEDU"}'

# 3 · Terminal — sweep every free BL-capable terminal
curl -X POST https://api.smartports.app/track/bl -H "Content-Type: application/json" -d '{"api_key":"your_api_key","bl_code":"MEDUY8665505","mode":"terminal"}'

# 4 · Terminal — one only (Contecon | SSA | TIMSA | LCT | ICAVE | EIT | OCUPA | CICE)
curl -X POST https://api.smartports.app/track/bl -H "Content-Type: application/json" -d '{"api_key":"your_api_key","bl_code":"MEDUY8665505","mode":"terminal","terminal":"Contecon"}'

# 5 · Terminal — APM (paid; needs ZYTE_API_KEY + APM_CONSUMER_KEY on the server)
curl -X POST https://api.smartports.app/track/bl -H "Content-Type: application/json" -d '{"api_key":"your_api_key","bl_code":"MEDUY8665505","mode":"terminal","terminal":"APM"}'

# 6 · Customs — by container, explicit aduana (discovers patente + pedimento)
curl -X POST https://api.smartports.app/track/bl -H "Content-Type: application/json" -d '{"api_key":"your_api_key","bl_code":"MEDUY8665505","mode":"customs","container":"TCLU1234567","customs_id":"160","year":"2026"}'

# 7 · Customs — by container, aduana derived from the POD LOCODE
curl -X POST https://api.smartports.app/track/bl -H "Content-Type: application/json" -d '{"api_key":"your_api_key","bl_code":"MEDUY8665505","mode":"customs","container":"TCLU1234567","pod":"MXZLO","year":"2026"}'

# 8 · Customs — by pedimento
curl -X POST https://api.smartports.app/track/bl -H "Content-Type: application/json" -d '{"api_key":"your_api_key","bl_code":"MEDUY8665505","mode":"customs","pedimento":"4004975","patente":"3849","customs_id":"160","year":"2026"}'

# 9 · Customs — by pedimento + CEP movements (DESADUANADO date)
curl -X POST https://api.smartports.app/track/bl -H "Content-Type: application/json" -d '{"api_key":"your_api_key","bl_code":"MEDUY8665505","mode":"customs","pedimento":"4004975","patente":"3849","customs_id":"160","year":"2026","movimientos":1}'
            

Track a Bill of Lading. POST to https://api.smartports.app/track/bl with a JSON body. mode defaults to carrier; terminal and customs switch the source.

QUERY PARAMETERS

FieldTypeDescription
api_keyStringRequired. Your API key.
bl_codeStringRequired. The Bill of Lading number.
modeStringOptional. carrier (default) · terminal · customs.
shipping_lineStringOptional (carrier). Carrier code; defaults to the first 4 chars of the BL.
terminalStringOptional (terminal). One terminal short name. Omit to sweep the free ones.
containerStringCustoms (by container). Discovers patente + pedimento.
pedimentoStringCustoms (by pedimento).
patenteStringCustoms (by pedimento).
customs_idStringCustoms. SAT aduana code (e.g. 160). Or derive it with pod.
podStringCustoms (by container). UN/LOCODE used to derive customs_id.
yearStringCustoms. Pedimento year.
movimientosIntegerOptional (customs). 1 attaches the CEP movements table.

Track Container


# 1 · Carrier (default) — upstream tracking
curl -X POST https://api.smartports.app/track/container -H "Content-Type: application/json" -d '{"api_key":"your_api_key","container_code":"TCLU1234567"}'

# 2 · Terminal — sweep the free container-capable terminals (includes ATP)
curl -X POST https://api.smartports.app/track/container -H "Content-Type: application/json" -d '{"api_key":"your_api_key","container_code":"TCLU1234567","mode":"terminal"}'

# 3 · Terminal — one only (e.g. ATP, Altamira, container-only)
curl -X POST https://api.smartports.app/track/container -H "Content-Type: application/json" -d '{"api_key":"your_api_key","container_code":"TCLU1234567","mode":"terminal","terminal":"ATP"}'

# 4 · Customs — by container, explicit aduana (discovers patente + pedimento)
curl -X POST https://api.smartports.app/track/container -H "Content-Type: application/json" -d '{"api_key":"your_api_key","container_code":"TCLU1234567","mode":"customs","customs_id":"160","year":"2026"}'

# 5 · Customs — by container, aduana derived from the POD LOCODE
curl -X POST https://api.smartports.app/track/container -H "Content-Type: application/json" -d '{"api_key":"your_api_key","container_code":"TCLU1234567","mode":"customs","pod":"MXLZC","year":"2026"}'
            

Track a container. POST to https://api.smartports.app/track/container. The carrier call returns an OBJECT (single container) rather than the ARRAY that track/bl returns.

QUERY PARAMETERS

FieldTypeDescription
api_keyStringRequired. Your API key.
container_codeStringRequired. The container number.
modeStringOptional. carrier (default) · terminal · customs.
terminalStringOptional (terminal). One terminal short name. Omit to sweep.
customs_idStringCustoms. SAT aduana code, or derive it with pod.
podStringCustoms. UN/LOCODE used to derive customs_id.
yearStringCustoms. Pedimento year.

Track Booking


# 1 · Sweep the free booking-capable terminals (SSA, TIMSA, LCT, ICAVE, EIT, OCUPA)
curl -X POST https://api.smartports.app/track/booking -H "Content-Type: application/json" -d '{"api_key":"your_api_key","booking_code":"EMC2026008"}'

# 2 · One terminal only
curl -X POST https://api.smartports.app/track/booking -H "Content-Type: application/json" -d '{"api_key":"your_api_key","booking_code":"EMC2026008","terminal":"TIMSA"}'
            

Look a booking reference up inside the port terminals. POST to https://api.smartports.app/track/booking. Terminal lookup only — there is no mode.

QUERY PARAMETERS

FieldTypeDescription
api_keyStringRequired. Your API key.
booking_codeStringRequired. The carrier booking reference.
terminalStringOptional. One terminal short name. Omit to sweep.

Track Pedimento


# 1 · Terminal (default) — Hutchison DOCUMENT search (TIMSA, LCT, ICAVE, EIT)
curl -X POST https://api.smartports.app/track/pedimento -H "Content-Type: application/json" -d '{"api_key":"your_api_key","pedimento_code":"4004975"}'

# 2 · Terminal — one only
curl -X POST https://api.smartports.app/track/pedimento -H "Content-Type: application/json" -d '{"api_key":"your_api_key","pedimento_code":"4004975","terminal":"ICAVE"}'

# 3 · Customs — SAT by pedimento
curl -X POST https://api.smartports.app/track/pedimento -H "Content-Type: application/json" -d '{"api_key":"your_api_key","pedimento_code":"4004975","mode":"customs","patente":"3849","customs_id":"160","year":"2026"}'

# 4 · Customs — Movements (DESADUANADO date)
curl -X POST https://api.smartports.app/track/pedimento -H "Content-Type: application/json" -d '{"api_key":"your_api_key","pedimento_code":"4004975","mode":"customs","patente":"3849","customs_id":"160","year":"2026","movimientos":1}'
            

Look a pedimento up. POST to https://api.smartports.app/track/pedimento. mode defaults to terminal; customs runs the SAT query.

QUERY PARAMETERS

FieldTypeDescription
api_keyStringRequired. Your API key.
pedimento_codeStringRequired. The pedimento number.
modeStringOptional. terminal (default) · customs.
terminalStringOptional (terminal). One terminal short name. Omit to sweep.
patenteStringCustoms. Broker patente.
customs_idStringCustoms. SAT aduana code.
yearStringCustoms. Pedimento year.
movimientosIntegerOptional (customs). 1 attaches the CEP movements table.

Track Release


# 1 · Sweep (SSA LIB + Hutchison DOCUMENT: SSA, TIMSA, LCT, ICAVE, EIT)
curl -X POST https://api.smartports.app/track/release -H "Content-Type: application/json" -d '{"api_key":"your_api_key","release_code":"REL123456"}'

# 2 · One terminal only
curl -X POST https://api.smartports.app/track/release -H "Content-Type: application/json" -d '{"api_key":"your_api_key","release_code":"REL123456","terminal":"SSA"}'
            

Look a release / liberación document up inside the port terminals. POST to https://api.smartports.app/track/release. Terminal lookup only — there is no mode.

QUERY PARAMETERS

FieldTypeDescription
api_keyStringRequired. Your API key.
release_codeStringRequired. The release document reference.
terminalStringOptional. One terminal short name. Omit to sweep.

Track Air Way Bill


# Air waybill tracking
curl -X POST https://api.smartports.app/track/awb -H "Content-Type: application/json" -d '{"api_key":"your_api_key","awb_code":"172-56546685"}'
            

Track an air waybill. POST to https://api.smartports.app/track/awb.

QUERY PARAMETERS

FieldTypeDescription
api_keyStringRequired. Your API key.
awb_codeStringRequired. The air waybill number.

Response Codes

The tracking endpoints use the following HTTP status codes:

CodeMeaning
200Data found. A normalized tracking record.
401Missing/invalid API key, a missing required field, or the source has no data yet (cached for the cache window).
503Transport failure or a pending adapter (e.g. login wall, missing APM keys). Never cached — retrying is meaningful.

Customs note: a POD outside the LOCODE table answers 200 with {"estado":"no_aplica"} — that port has no derivable Mexican customs; it is not an error.