Locations v1 / GeoIP
GeoIP — a given IP
Like the parameterless variant, but for an IP given in the path (/geoip/{ip}). Useful for checking any IP address, not just the caller's.
GET
https://oneapi.ro/api/locations/v1/geoip/{ip}
Path parameters
NameTypeDescriptionExample
iprequired
string
The IP address looked up, IPv4 or IPv6.
Query parameters
This route accepts no query parameters.
How it behaves
- Like
/geoip, but for an IP given in the path — checks any address, not just the caller's. - An IP in Romania → region/county/unit/locality from our data; outside Romania or private →
in_romania: false; an invalid IP → 422.
What it is for
- Enriching logs or leads with the approximate county of a collected IP.
- Geographic verification of an IP from a webhook or order before regional routing.
- Server-side filtering on an IP given in the path, not just the caller's.
Response structure
FieldTypeDescription
data.ip
string
The IP requested.
data.in_romania
boolean
Whether the IP falls inside Romania's borders. false → no other field.
data.regiune[]
mixed
The region the IP falls in; present only when the precision allowed administrative resolution.opțional
data.judet[]
mixed
The county the IP falls in; present only when the precision allowed resolution.opțional
data.uat[]
mixed
The administrative unit the IP falls in; present only when the precision allowed resolution.opțional
data.localitate[]
object[]
The locality the IP falls in; can be
null even when the county is known.opțional
data.localitate.distanta_m
integer
Distance from the IP point to the returned locality (metres).
meta.distanta
object
How the distances in the response are measured. Present on every response that carries a distance.
meta.distanta.metoda
string
Always
linie_dreapta (straight line): the geodesic distance over the Earth's surface, not by road.
meta.distanta.detaliu
string
The same information, in words.
Response examples
Resolved to Cluj-Napoca plus county/unit/locality.
GEThttps://oneapi.ro/api/locations/v1/geoip/188.27.0.1
{
"data": {
"ip": "188.27.0.1",
"in_romania": true,
"regiune": {
"cod": "RO11",
"nume": "Nord-Vest"
},
"judet": {
"cod": "CJ",
"nume": "Cluj"
},
"uat": {
"cod_siruta": 54975,
"nume": "Cluj-Napoca",
"tip": "municipiu"
},
"localitate": {
"cod_siruta": 54984,
"nume": "Cluj-Napoca",
"tip": "resedinta_municipiu",
"distanta_m": 3120
}
},
"meta": {
"sursa": "MaxMind GeoLite2",
"precizie": "aproximativa",
"atribuire": "This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com.",
"distanta": {
"metoda": "linie_dreapta",
"detaliu": "Distanţele sunt geodezice, în linie dreaptă pe suprafaţa Pământului (WGS84) — nu pe drum."
}
}
}
Outside Romania → in_romania false.
GEThttps://oneapi.ro/api/locations/v1/geoip/8.8.8.8
{
"data": {
"ip": "8.8.8.8",
"in_romania": false
},
"meta": {
"sursa": "MaxMind GeoLite2",
"precizie": "necunoscuta",
"atribuire": "This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com."
}
}
Unresolvable → in_romania false.
GEThttps://oneapi.ro/api/locations/v1/geoip/127.0.0.1
{
"data": {
"ip": "127.0.0.1",
"in_romania": false
},
"meta": {
"sursa": "MaxMind GeoLite2",
"precizie": "necunoscuta",
"atribuire": "This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com."
}
}
Error codes
| Code | Slug | When it occurs |
|---|---|---|
| 401 | neautentificat | Token missing, invalid, expired or revoked. |
| 403 | feature_indisponibil | The current plan does not include the feature the route depends on. |
| 404 | negasit | Nothing exists for the ip in the path. |
| 422 | ip_invalid | The IP address in the path is not valid. |
| 429 | cota_depasita | The plan's monthly quota has been exceeded (see Retry-After). |
All errors share the same shape. eroare.cod is stable and is the value you should branch on in code — not the text in mesaj, which may change.
{
"eroare": {
"cod": "ip_invalid",
"mesaj": "The IP address in the path is not valid.",
"detalii": {
"ip": [
"The value sent does not satisfy the parameter rule."
]
}
}
}