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
- Type: stringnullablesearch
Text to look for, matched anywhere in the fields the endpoint searches, ignoring case. Omit to list everything.
- Type: integerlimitgreater than:0max:100
How many results to return, 1 to 100.
- Type: integeroffsetmin:0
How many results to skip, for the next page: the previous offset plus limit.
- Type: "asc" or "desc"enumorder
Sort direction for order_by.
- Type: "created_at" or "updated_at"enumorder
_by Which date to sort by: when the record was added or last changed.
- Type: booleansee
_more deprecatedNo 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
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'
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"
}
}
}
