Search UN locations

​

Find the UN/LOCODE of a port or place, to use as an origin or destination in a rate search or an LCL rate request.

search matches, ignoring case, anywhere in the country code, place name, port name, UN/LOCODE, alias, and your organization's own port codes. Results come best match first: an exact code, then codes starting with what you typed, then exact and starting place names, then the rest. Within each of those, commonly used (priority) locations come first, then order_by.

Only active locations are listed. Page with limit (at most 100) and offset; meta.pagination.total_count is the number of matches across every page.

API key scope required: rates:read.

Query Parameters

  • Text to look for, matched anywhere in the fields the endpoint searches, ignoring case. Omit to list everything.

  • How many results to return, 1 to 100.

  • How many results to skip, for the next page: the previous offset plus limit.

  • Sort direction for order_by.

  • Which date to sort by: when the record was added or last changed.

  • No longer changes the results: every active location is searched either way. Accepted so existing callers keep working.

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for get/unlocations
curl 'https://api-dev.highqube.ai/unlocations?search=Shanghai&limit=100&offset=0&order=asc&order_by=created_at&see_more=false' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
Search for Shanghai

GET /unlocations?search=Shanghai&limit=2

{
  "success": true,
  "message": "UN locations fetched successfully",
  "data": [
    {
      "id": 20083,
      "country_name": "CN",
      "state": "Shanghai Shi",
      "city_name": "Shanghai",
      "port_name": "Shanghai",
      "port_code": "CNSGH",
      "alias": null,
      "is_priority": false,
      "is_active": true,
      "custom_port_code": null
    },
    {
      "id": 19967,
      "country_name": "CN",
      "state": "Shanghai Shi",
      "city_name": "Shanghai Pudong International Apt",
      "port_name": "Shanghai Pudong International Apt",
      "port_code": "CNPVG",
      "alias": null,
      "is_priority": false,
      "is_active": true,
      "custom_port_code": null
    }
  ],
  "errors": null,
  "meta": {
    "pagination": {
      "limit": 2,
      "offset": 0,
      "total_count": 6,
      "returned_count": 2,
      "order_by": "created_at"
    }
  }
}
Preview. Everything here runs against the sandbox, api-dev.highqube.ai, with test keys. Get a key