Appearance
UN/LOCODE
11 endpoints at a glance
| Method | Path | Summary |
|---|---|---|
POST | /atlas/unlocode/refresh/ | Refresh Unlocode |
GET | /unlocode/ | Search |
GET | /unlocode/{code}/ | Get Code |
GET | /unlocode/{code}/changes/ | List Changes |
GET | /unlocode/{code}/neighbors/ | Get Neighbors |
GET | /unlocode/anchor-fqdn/ | Anchor Fqdn |
GET | /unlocode/function-classifiers/ | Function Classifiers |
GET | /unlocode/imports/ | List Imports |
GET | /unlocode/imports/{import_id}/ | Get Import |
POST | /unlocode/imports/run | Run Import |
GET | /unlocode/status/ | Get Status |
unlocode
Get Status
List Imports
GET
/unlocode/imports/
Newest-first import-run rows. since / until inclusive
YYYY-MM-DD bounds on started_at.
Parameters
Header Parameters
authorization
x-api-key
Query Parameters
since
until
trigger
limit
Type
integer
Default
100Responses
Successful Response
application/json
JSON { "additionalProperties": "string" }
[
]
Get Import
Run Import
POST
/unlocode/imports/run
Queue the import. Returns immediately; the serial worker picks
it up and writes the running audit row. 403 when the dataset
is disabled.
Parameters
Header Parameters
authorization
x-api-key
Query Parameters
force
Re-run even if the source commit is unchanged (otherwise the import skips a no-op download).
Type
boolean
Default
falseResponses
Successful Response
application/json
JSON "additionalProperties": "string"
{
}
Function Classifiers
Anchor Fqdn
GET
/unlocode/anchor-fqdn/
Derive candidate anchor FQDN(s) from the nearest UN/LOCODE(s)
to (lat, lon).
Public — no auth gate (pure derivation over open UN/LOCODE
reference data + a public-FQDN existence flag; same posture as the
public /series/ reads). Unlike the other /unlocode reads
this one is intentionally unauthenticated.
For each of the n nearest UN/LOCODE records (by great-circle
distance over the coords-bearing subset) we assemble
<cc>-<loc>-as<asn>.anchors.atlas.ripe.net and flag whether an
anchor with that exact FQDN already exists (one batched
db.anchors lookup). Pure read — no writes, no RIPE calls; the
caller decides what to do with a collision (we don't guess RIPE's
multi-anchor numbering). Declared before /{code}/ so the
literal segment wins. 400 on out-of-range lat/lon/asn/n.
Parameters
Query Parameters
lat*
Type
Requirednumber
Maximum
90Minimum
-90lon*
Type
Requirednumber
Maximum
180Minimum
-180asn*
AS number for the as
Type
Requiredinteger
Minimum
1n
how many nearest candidates
Type
integer
Maximum
25Minimum
1Default
1asn_holder
True/omitted = anchor host holds the ASN (plain hostname). False = host is a client → append '-client' to the hostname label.
Type
boolean
Default
trueResponses
Successful Response
application/json
JSON "additionalProperties": "string"
{
}
Search
GET
/unlocode/
Lookup by country / name-or-code / alias / nearest.
Parameters
Header Parameters
authorization
x-api-key
Query Parameters
country
ISO cca2 filter
q
code / name / alias prefix
near
"lat,lon" nearest
limit
Type
integer
Default
50Responses
Successful Response
application/json
JSON "additionalProperties": "string"
{
}
List Changes
GET
/unlocode/{code}/changes/
Per-record change history (newest-first).
Parameters
Header Parameters
authorization
x-api-key
Path Parameters
code*
Type
Requiredstring
Query Parameters
since_ts
until_ts
skip
Type
integer
Default
0limit
Type
integer
Default
100Responses
Successful Response
application/json
JSON "additionalProperties": "string"
{
}
Get Neighbors
GET
/unlocode/{code}/neighbors/
The code plus its limit nearest other UN/LOCODEs (for the
detail-view map: the selected location + its closest neighbours).
404 when unknown or coordinate-less (nothing to plot). Declared
before /{code}/ so the literal segment wins.
Parameters
Header Parameters
authorization
x-api-key
Path Parameters
code*
Type
Requiredstring
Query Parameters
limit
how many nearest others
Type
integer
Maximum
25Minimum
1Default
10Responses
Successful Response
application/json
JSON "additionalProperties": "string"
{
}
Get Code
Refresh Unlocode
POST
/atlas/unlocode/refresh/
Queue an improved-UN/LOCODE import (ops companion to the admin
panel's Run button). Returns immediately — the serial worker does
the ~13 MB code-list + ~17 MB aliases parse off-thread and writes
the audit row. ?force=true re-runs even if the upstream commit
is unchanged (default skips a no-op download).
Authorizations
APIKeyQuery
Type
API Key (query: api-key)
or
APIKeyHeader
Type
API Key (header: x-api-key)
Parameters
Query Parameters
force
Type
boolean
Default
falseResponses
Successful Response
application/json
JSON
[
]