Download Collection

    Download Postman

        https://www.postman.com/downloads/
                            

Download the Postman Collection so you can test it ASAP:
https://api.smartports.app/TrackingSmartports.postman_collection.json

Get your API KEY

    API ROOT

        https://api.smartports.app/
                

You can get your API KEY from the your profile page. Log into your account and click on the top right corner on your profile to retrieve your secret API KEY.

To use this API, you need an API key. Please contact us at [email protected] if you run into any trouble with your KEY.

Track Bill of Lading


# Here is a curl example
curl \
-X POST https://api.smartports.app/track/bl \
-F 'api_key=your_api_key' \
-F 'bl_code=222709941' \
-F 'shipping_line=MAEU' \
                

To track the Bill of Lading you need to make a POST call to the following url and send the parameters as BODY [form-data]:
https://api.smartports.app/track/bl



Result example :

{
  query:{
    bl_code: "222709941",
    shipping_line: "MAEU"
  }
  result: [
    {
        "route": {
          "pod": {
            "date": "2022-12-03 04:14:00",
            "actual": true,
            "location": 1
          },
          "pol": {
            "date": "2022-11-10 13:44:00",
            "actual": true,
            "location": 2
          },
          "prepol": {
            "date": null,
            "actual": null,
            "location": 2
          },
          "postpod": {
            "date": "2022-12-03 04:14:00",
            "actual": true,
            "location": 1
          }
        },
        "vessels": [
          {
            "id": 1,
            "imo": 9437050,
            "flag": "LR",
            "mmsi": 636020984,
            "name": "GSL TINOS",
            "call_sign": "5LBR6"
          }
        ],
        "locations": [
          {
            "id": 1,
            "lat": 19.11695,
            "lng": -104.34214,
            "name": "Manzanillo",
            "state": "Estado de Colima",
            "locode": "MXZLO",
            "country": "Mexico",
            "country_code": "MX"
          },
          {
            "id": 2,
            "lat": 31.366365,
            "lng": 121.61475,
            "name": "Shanghai",
            "state": "Shanghai Shi",
            "locode": "CNSHG",
            "country": "China",
            "country_code": "CN"
          },
          {
            "id": 3,
            "lat": 30.8703,
            "lng": 120.0933,
            "name": "Huzhou",
            "state": "Zhejiang Sheng",
            "locode": "CNHZH",
            "country": "China",
            "country_code": "CN"
          }
        ],
        "containers": [
          {
            "events": [
              {
                "date": "2022-11-07 16:29:00",
                "type": "land",
                "actual": true,
                "status": "CEP",
                "vessel": null,
                "voyage": null,
                "location": 3,
                "description": "Gate out Empty"
              },
              {
                "date": "2022-11-09 00:30:00",
                "type": "land",
                "actual": true,
                "status": "LTS",
                "vessel": null,
                "voyage": null,
                "location": 2,
                "description": "Gate in"
              },
              {
                "date": "2022-11-10 13:44:00",
                "type": "land",
                "actual": true,
                "status": "CGI",
                "vessel": null,
                "voyage": null,
                "location": 2,
                "description": "Gate in"
              },
              {
                "date": "2022-11-12 13:58:00",
                "type": "sea",
                "actual": true,
                "status": "CLL",
                "vessel": 1,
                "voyage": "246S",
                "location": 2,
                "description": "Load"
              },
              {
                "date": "2022-12-03 04:14:00",
                "type": "sea",
                "actual": true,
                "status": "CDD",
                "vessel": 1,
                "voyage": "246S",
                "location": 1,
                "description": "Discharge"
              },
              {
                "date": "2022-12-09 04:25:00",
                "type": "land",
                "actual": true,
                "status": "CGO",
                "vessel": null,
                "voyage": null,
                "location": 1,
                "description": "Gate out"
              }
            ],
            "number": "GCXU5781866",
            "iso_code": "42G0"
          }
        ]
      }
  ]
}
                

QUERY PARAMETERS

Field Type Description
api_key String Your API key.
bl_code String The Bill of Lading number/code.
shipping_line String The shipping line code from the json file.

Track Container


# Here is a curl example
curl \
-X POST https://api.smartports.app/track/container \
-F 'api_key=your_api_key' \
-F 'container_code=MRKU6333050' \
                

To track the container you need to make a POST call to the following url and send the parameters as BODY [form-data], the container call will return an OBJECT instead of an ARRAY as from the track BL call :
https://api.smartports.app/track/container



Result example :

{
  query:{
    container_code: "MRKU6333050",
  }
  result: [
    {
        "route": {
          "pod": {
            "date": "2023-01-23 02:31:00",
            "actual": true,
            "location": 1
          },
          "pol": {
            "date": "2022-12-11 05:01:00",
            "actual": true,
            "location": 5
          },
          "prepol": {
            "date": null,
            "actual": null,
            "location": 5
          },
          "postpod": {
            "date": "2023-02-15 15:25:00",
            "actual": true,
            "location": 2
          }
        },
        "vessels": [
          {
            "id": 1,
            "imo": 9456977,
            "flag": "LR",
            "mmsi": 636091883,
            "name": "MERKUR ARCHIPELAGO",
            "call_sign": "A8UC5"
          },
          {
            "id": 2,
            "imo": 9928188,
            "flag": "PA",
            "mmsi": 352002065,
            "name": "MAERSK ACADIA",
            "call_sign": "3E3754"
          }
        ],
        "container": {
          "events": [
            {
              "date": "2022-12-08 14:03:00",
              "type": "land",
              "actual": true,
              "status": "CEP",
              "vessel": null,
              "voyage": null,
              "location": 4,
              "description": "Gate out Empty"
            },
            {
              "date": "2022-12-11 05:01:00",
              "type": "land",
              "actual": true,
              "status": "CGI",
              "vessel": null,
              "voyage": null,
              "location": 5,
              "description": "Gate in"
            },
            {
              "date": "2022-12-16 05:41:00",
              "type": "sea",
              "actual": true,
              "status": "CLL",
              "vessel": 1,
              "voyage": "249E",
              "location": 5,
              "description": "Load"
            },
            {
              "date": "2022-12-18 03:06:00",
              "type": "sea",
              "actual": true,
              "status": "CDT",
              "vessel": 1,
              "voyage": "249E",
              "location": 3,
              "description": "Discharge"
            },
            {
              "date": "2022-12-30 21:47:00",
              "type": "sea",
              "actual": true,
              "status": "CLT",
              "vessel": 2,
              "voyage": "252S",
              "location": 3,
              "description": "Load"
            },
            {
              "date": "2023-01-23 02:31:00",
              "type": "sea",
              "actual": true,
              "status": "CDD",
              "vessel": 2,
              "voyage": "252S",
              "location": 1,
              "description": "Discharge"
            },
            {
              "date": "2023-02-03 11:20:00",
              "type": "land",
              "actual": true,
              "status": "CGO",
              "vessel": null,
              "voyage": null,
              "location": 1,
              "description": "On rail"
            },
            {
              "date": "2023-02-15 15:25:00",
              "type": "land",
              "actual": true,
              "status": "CDC",
              "vessel": null,
              "voyage": null,
              "location": 2,
              "description": "Off rail"
            }
          ],
          "number": "MRKU6333050",
          "iso_code": "42G0"
        },
        "locations": [
          {
            "id": 1,
            "lat": 17.97066,
            "lng": -102.22124,
            "name": "Lazaro Cardenas",
            "state": "Estado de Michoacan de Ocampo",
            "locode": "MXLZC",
            "country": "Mexico",
            "country_code": "MX"
          },
          {
            "id": 2,
            "lat": 19.28786,
            "lng": -99.65324,
            "name": "Toluca",
            "state": "Estado de Mexico",
            "locode": "MXTLC",
            "country": "Mexico",
            "country_code": "MX"
          },
          {
            "id": 3,
            "lat": 35.10168,
            "lng": 129.03004,
            "name": "Busan",
            "state": "Busan",
            "locode": "KRPUS",
            "country": "South Korea",
            "country_code": "KR"
          },
          {
            "id": 4,
            "lat": 30.29365,
            "lng": 120.16142,
            "name": "Hangzhou",
            "state": "Zhejiang Sheng",
            "locode": "CNHAZ",
            "country": "China",
            "country_code": "CN"
          },
          {
            "id": 5,
            "lat": 29.87819,
            "lng": 121.54945,
            "name": "Ningbo",
            "state": "Zhejiang Sheng",
            "locode": "CNNGB",
            "country": "China",
            "country_code": "CN"
          }
        ]
    }
    ]
}
                

QUERY PARAMETERS

Field Type Description
api_key String Your API key.
container_code String The container number/code.

Track Air Way Bill


# Here is a curl example
curl \
-X POST https://api.smartports.app/track/awb \
-F 'api_key=your_api_key' \
-F 'awb_code=172-56546685' \
                

To track the air way bill you need to make a POST call to the following url and send the parameters as BODY [form-data]:
https://api.smartports.app/track/awb



Result example :

{
  query:{
    awb_code: "172-56546685",
  }
  result: [
        {
            {
                "piece": 2,
                "origin": "LIN",
                "weight": "260K",
                "awb_number": "172-56546685",
                "last_event": "2022-12-20 16:00:00, 2 pieces delivered, MEX, CV6684",
                "track_info": [
                  {
                    "event": "2 pieces delivered",
                    "piece": "2",
                    "status": "DLV",
                    "weight": "",
                    "station": "MEX",
                    "plan_date": "2022-12-19 13:46:00",
                    "actual_date": "2022-12-20 16:00:00",
                    "flight_number": "CV6684"
                  },
                  {
                    "event": "2 pieces documents delivered",
                    "piece": "2",
                    "status": "AWD",
                    "weight": "",
                    "station": "MEX",
                    "plan_date": "2022-12-15 22:46:00",
                    "actual_date": "2022-12-15 15:00:00",
                    "flight_number": "CV6684"
                  },
                  {
                    "event": "2 pieces ready to be picked up",
                    "piece": "2",
                    "status": "NFD",
                    "weight": "",
                    "station": "MEX",
                    "plan_date": "2022-12-15 22:46:00",
                    "actual_date": "2022-12-15 14:20:00",
                    "flight_number": "CV6684"
                  },
                  {
                    "event": "2 pieces received on CV6684",
                    "piece": "2",
                    "status": "RCF",
                    "weight": "",
                    "station": "MEX",
                    "plan_date": "2022-12-15 21:46:00",
                    "actual_date": "2022-12-15 14:10:00",
                    "flight_number": "CV6684"
                  },
                  {
                    "event": "2 pieces arrived on CV6684",
                    "piece": "2",
                    "status": "ARR",
                    "weight": "",
                    "station": "MEX",
                    "plan_date": "2022-12-15 13:26:00",
                    "actual_date": "2022-12-15 13:46:00",
                    "flight_number": "CV6684"
                  },
                  {
                    "event": "2 pieces departed on CV6684",
                    "piece": "2",
                    "status": "DEP",
                    "weight": "",
                    "station": "LUX",
                    "plan_date": "2022-12-15 08:20:00",
                    "actual_date": "2022-12-15 08:48:00",
                    "flight_number": "CV6684"
                  },
                  {
                    "event": "2 pieces received on CV9951B",
                    "piece": "2",
                    "status": "RCF",
                    "weight": "",
                    "station": "LUX",
                    "plan_date": "2022-12-14 15:21:00",
                    "actual_date": "2022-12-14 19:37:00",
                    "flight_number": "CV9951B"
                  },
                  {
                    "event": "2 pieces arrived on CV9951B",
                    "piece": "2",
                    "status": "ARR",
                    "weight": "",
                    "station": "LUX",
                    "plan_date": "2022-12-14 13:21:00",
                    "actual_date": "2022-12-14 17:00:00",
                    "flight_number": "CV9951B"
                  },
                  {
                    "event": "2 pieces departed on CV9951B",
                    "piece": "2",
                    "status": "DEP",
                    "weight": "",
                    "station": "LIN",
                    "plan_date": "2022-12-13 22:00:00",
                    "actual_date": "2022-12-13 17:51:00",
                    "flight_number": "CV9951B"
                  },
                  {
                    "event": "2 pieces accepted",
                    "piece": "2",
                    "status": "RCS",
                    "weight": "",
                    "station": "LIN",
                    "plan_date": "2022-12-13 19:30:00",
                    "actual_date": "2022-12-13 17:20:00",
                    "flight_number": "CV9951"
                  }
                ],
                "destination": "MEX",
                "flight_info": [
                  {
                    "depart_time": "2022-12-13 22:00:00",
                    "arrival_time": "2022-12-14 13:21:00",
                    "flight_number": "CV9951B",
                    "depart_station": "LIN",
                    "arrival_station": "LUX",
                    "plan_depart_time": "2022-12-13 22:00:00",
                    "plan_arrival_time": "2022-12-14 13:21:00"
                  },
                  {
                    "depart_time": "2022-12-15 08:20:00",
                    "arrival_time": "2022-12-15 13:26:00",
                    "flight_number": "CV6684",
                    "depart_station": "LUX",
                    "arrival_station": "MEX",
                    "plan_depart_time": "2022-12-15 08:20:00",
                    "plan_arrival_time": "2022-12-15 13:26:00"
                  }
                ],
                "airline_info": {
                  "url": "https://www.cargolux.com/",
                  "name": "Cargolux Airlines",
                  "track_url": "https://cvtnt.champ.aero/trackntrace?awbnumber=172-56546685"
                },
                "status_number": 4,
                "flight_way_station": [
                  "LIN",
                  "LUX",
                  "MEX"
                ]
            }
        }
    ]
}
                

QUERY PARAMETERS

Field Type Description
api_key String Your API key.
awb_code String The air way bill number/code.

Shipping Lines

Download the full json with over 140 shipping lines at:
https://api.smartports.app/ShippingLines.json



Download {
    https://api.smartports.app/ShippingLines.json
{
  
  result: [
    {
			"carrier_code": "APLU",
			"carrier_name": "American President Lines (APL)"
		},
		{
			"carrier_code": "BURU",
			"carrier_name": "BAL Container Line"
		},
		{
			"carrier_code": "CMDU",
			"carrier_name": "CMA CGM"
		},
		{
			"carrier_code": "COSU",
			"carrier_name": "COSCO"
		},
		{
			"carrier_code": "EGLV",
			"carrier_name": "Evergreen"
		},
		{
			"carrier_code": "SUDU",
			"carrier_name": "Hamburg Sud"
		},
		{
			"carrier_code": "HLCU",
			"carrier_name": "Hapag-Lloyd"
		},
		{
			"carrier_code": "HDMU",
			"carrier_name": "Hyundai Merchant Marine (HMM)"
		},
		{
			"carrier_code": "MAEU",
			"carrier_name": "Maersk"
		},
    ......
                

Errors

The Smartports API uses the following error codes:

Error Code Meaning
X000 Some parameters are missing. This error appears when you don't pass every mandatory parameters.
X001 Unknown or unvalid api_key. This error appears if you use an unknow API key or if your API key expired.
X002 Unvalid api_key for this domain. This error appears if you use an API key non specified for your domain. Developper or Universal API keys doesn't have domain checker.