Search for places by name or coordinates, with fast prefix-matching and geographic filters.
Get results quickly with typo‑tolerant prefix search.
Find by city, bounding box or radius.
Return OSM identifiers, population, display name & more.
POST https://api.yeb.to/v1/place/find-by-name
Parameter | Type | Required | Description |
---|---|---|---|
api_key |
string | yes | Your API key |
q |
string | yes | Search text (city, village, etc) |
country_code |
string | opt | 2-letter ISO country filter |
limit |
int | opt | Max results (1-100, default 20) |
offset |
int | opt | Pagination offset |
curl -X POST https://api.yeb.to/v1/place/find-by-name \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_KEY",
"q": "sofia",
"country_code": "BG",
"limit": 5
}'
curl -X POST https://api.yeb.to/v1/place/find-by-name \
-H "Content-Type: application/json" \
-d '{"api_key":"YOUR_KEY","q":"sofia","country_code":"BG","limit":5}'
$r = Http::post('https://api.yeb.to/v1/place/find-by-name', [
'api_key' => 'YOUR_KEY', 'q' => 'sofia', 'country_code' => 'BG', 'limit' => 5
]);
echo $r->json();
fetch('https://api.yeb.to/v1/place/find-by-name', {
method:'POST',
headers:{'Content-Type':'application/json'},
body:JSON.stringify({api_key:'YOUR_KEY',q:'sofia',country_code:'BG',limit:5})
}).then(r=>r.json()).then(console.log);
import requests, json
payload = {"api_key":"YOUR_KEY","q":"sofia","country_code":"BG","limit":5}
r = requests.post('https://api.yeb.to/v1/place/find-by-name', headers={'Content-Type':'application/json'}, data=json.dumps(payload))
print(r.json())
{
"query": "sofia",
"count": 1,
"places": [
{
"id": 727011,
"name": "Sofia",
"country_code": "BG",
"osm_id": 240109189,
"osm_type": "relation",
"type": "city",
"population": 1286383,
"lat": 42.6977,
"lng": 23.3219,
"bbox": {
"min_lat": 42.582,
"max_lat": 42.815,
"min_lng": 23.042,
"max_lng": 23.461
},
"address": {
"city": "Sofia",
"state": "Sofia City Province",
"country": "Bulgaria"
},
"display_name": "Sofia, Bulgaria"
}
]
}
{
"error": "Missing place name (q)",
"code": 400
}
Code | Description |
---|---|
200 Success | Request processed OK. |
400 Bad Request | Input validation failed. |
401 Unauthorized | Missing / wrong API key. |
403 Forbidden | Key inactive or not allowed. |
429 Rate Limit | Too many requests. |
500 Server Error | Unexpected failure. |
POST https://api.yeb.to/v1/place/find-by-coord
Parameter | Type | Required | Description |
---|---|---|---|
api_key |
string | yes | Your API key |
lat |
float | yes | Latitude of centre point |
lng |
float | yes | Longitude of centre point |
radius |
float | opt | Radius in kilometers (default: 10) |
limit |
int | opt | Max results (1-100, default 10) |
offset |
int | opt | Pagination offset |
curl -X POST https://api.yeb.to/v1/place/find-by-coord \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_KEY",
"lat": 42.6977,
"lng": 23.3219,
"radius": 25,
"limit": 3
}'
curl -X POST https://api.yeb.to/v1/place/find-by-coord \
-H "Content-Type: application/json" \
-d '{"api_key":"YOUR_KEY","lat":42.6977,"lng":23.3219,"radius":25,"limit":3}'
$r = Http::post('https://api.yeb.to/v1/place/find-by-coord', [
'api_key' => 'YOUR_KEY', 'lat' => 42.6977, 'lng' => 23.3219, 'radius' => 25, 'limit' => 3
]);
echo $r->json();
fetch('https://api.yeb.to/v1/place/find-by-coord', {
method:'POST',
headers:{'Content-Type':'application/json'},
body:JSON.stringify({api_key:'YOUR_KEY',lat:42.6977,lng:23.3219,radius:25,limit:3})
}).then(r=>r.json()).then(console.log);
import requests, json
payload = {"api_key":"YOUR_KEY","lat":42.6977,"lng":23.3219,"radius":25,"limit":3}
r = requests.post('https://api.yeb.to/v1/place/find-by-coord', headers={'Content-Type':'application/json'}, data=json.dumps(payload))
print(r.json())
{
"lat": 42.6977,
"lng": 23.3219,
"radius_km": 25,
"count": 3,
"places": [
{
"id": 729530,
"name": "Bankya",
"country_code": "BG",
"osm_id": 168422,
"osm_type": "relation",
"type": "town",
"population": 10833,
"lat": 42.706,
"lng": 23.152,
"dist_km": 12.3,
"display_name": "Bankya, Sofia City Province, Bulgaria"
}
]
}
{
"error": "Missing lat/lng",
"code": 400
}
Code | Description |
---|---|
200 Success | Request processed OK. |
400 Bad Request | Input validation failed. |
401 Unauthorized | Missing / wrong API key. |
403 Forbidden | Key inactive or not allowed. |
429 Rate Limit | Too many requests. |
500 Server Error | Unexpected failure. |