Locations v1 / GeoIP
GeoIP — the caller's IP
Says whether the IP the request comes from falls inside Romania and, if so, where it sits in our administrative hierarchy (region/county/unit/locality). MaxMind GeoLite2 is used only internally, to get the approximate point; no MaxMind data is exposed. An IP outside Romania, private or unresolvable → in_romania: false.
GET
https://oneapi.ro/api/locations/v1/geoip
Query parameters
This route accepts no query parameters.
How it behaves
- Says whether the IP the request came from falls inside Romania and, if so, where it sits in our administrative hierarchy: region/county/unit/locality — all from OUR data.
- MaxMind GeoLite2 (memory-mapped locally, no external call) is used only INTERNALLY, to get the IP's approximate point; no MaxMind field is exposed.
- An IP outside Romania, private or unresolvable →
in_romania: false, with no further fields. - The Romania determination is indicative (the IP point is approximate, city level) — it can be wrong near borders. An IP is personal data: we do not store it raw.
What it is for
- Prefilling county and locality in a form from the visitor's IP.
- Serving Romania-localised content or pricing without asking for the location explicitly.
- An anti-fraud signal at checkout: checking whether the request comes from Romania.
Response structure
All fields below live inside data.
FieldTypeDescription
ip
string
The IP the lookup was performed for.
in_romania
boolean
Whether the IP falls inside Romania's borders (ANCPI). false → no other field.
regiune[]
mixed
The region the IP falls in; present only when the precision allowed administrative resolution.opțional
judet[]
mixed
The county the IP falls in; present only when the precision allowed resolution.opțional
uat[]
mixed
The administrative unit the IP falls in; present only when the precision allowed resolution.opțional
localitate[]
object[]
The locality the IP falls in; can be
null even when the county is known.opțional
localitate.distanta_m
Distance from the IP point to the returned locality (metres).
Response examples
Resolves the request's IP (in the docs, generated server-side).
GEThttps://oneapi.ro/api/locations/v1/geoip
{
"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. |
| 422 | validare | The route takes no parameters apart from lang: any other parameter returns 422 instead of being ignored. |
| 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": "validare",
"mesaj": "The route takes no parameters apart from lang: any other parameter returns 422 instead of being ignored."
}
}