Skip to main content
POST
/
api
/
osm
/
geocode
/
search
/osm/geocode/search
curl --request POST \
  --url https://api.anysite.io/api/osm/geocode/search \
  --header 'Content-Type: application/json' \
  --header 'access-token: <api-key>' \
  --data '
{
  "count": 20,
  "timeout": 300,
  "query": "Eiffel Tower, Paris",
  "amenity": "<string>",
  "street": "<string>",
  "city": "<string>",
  "county": "<string>",
  "state": "<string>",
  "country": "<string>",
  "postalcode": "<string>",
  "countrycodes": "us,de",
  "viewbox": "-0.5,51.3,0.3,51.7",
  "bounded": false,
  "layer": [],
  "address_details": true,
  "extra_tags": true,
  "name_details": true,
  "polygon_geojson": false,
  "dedupe": true,
  "exclude_place_ids": "<string>",
  "accept_language": "en"
}
'
[
  {
    "@type": "OsmPlace",
    "place_id": 123,
    "osm_type": "<string>",
    "osm_id": 123,
    "latitude": 123,
    "longitude": 123,
    "category": "<string>",
    "place_type": "<string>",
    "place_rank": 123,
    "importance": 123,
    "addresstype": "<string>",
    "name": "<string>",
    "display_name": "<string>",
    "address": {
      "@type": "OsmAddress",
      "house_number": "<string>",
      "road": "<string>",
      "quarter": "<string>",
      "neighbourhood": "<string>",
      "suburb": "<string>",
      "borough": "<string>",
      "city_district": "<string>",
      "city": "<string>",
      "municipality": "<string>",
      "county": "<string>",
      "state_district": "<string>",
      "state": "<string>",
      "region": "<string>",
      "postcode": "<string>",
      "country": "<string>",
      "country_code": "<string>",
      "iso3166_2": "<string>"
    },
    "extratags": {},
    "namedetails": {},
    "boundingbox": [],
    "geojson": {},
    "source_url": "<string>"
  }
]

Authorizations

access-token
string
header
required

API token from the dashboard

Headers

access-token
string
required

Body

application/json
count
integer
required

Max number of results

Required range: 1 <= x <= 40
timeout
integer
default:300

Max scrapping execution timeout (in seconds)

Required range: 20 <= x <= 1500
query
string | null

Free-text place/address query

Minimum string length: 1
Example:

"Eiffel Tower, Paris"

amenity
string | null

Structured: name/type of a POI or amenity

street
string | null

Structured: house number and street name

city
string | null

Structured: city name

county
string | null

Structured: county name

state
string | null

Structured: state name

country
string | null

Structured: country name

postalcode
string | null

Structured: postal code

countrycodes
string | null

Comma-separated ISO 3166-1 alpha-2 country codes to restrict results

Example:

"us,de"

viewbox
string | null

Preferred area as 'lon1,lat1,lon2,lat2' to bias results toward

Example:

"-0.5,51.3,0.3,51.7"

bounded
boolean
default:false

Restrict results strictly to the viewbox area

layer
enum<string>[] | null

Restrict results to one or more data layers

Available options:
address,
poi,
railway,
natural,
manmade
featuretype
enum<string> | null

Restrict results to a feature type

Available options:
country,
state,
city,
settlement
address_details
boolean
default:true

Include a structured address breakdown

extra_tags
boolean
default:true

Include additional OSM tags (website, phone, opening hours…)

name_details
boolean
default:true

Include the full set of name/label variants

polygon_geojson
boolean
default:false

Include the object geometry as a GeoJSON object

dedupe
boolean
default:true

Remove near-duplicate results

exclude_place_ids
string | null

Comma-separated place ids to exclude from results

accept_language
string | null

Preferred language(s) for names and labels

Example:

"en"

Response

Successful Response

@type
string
default:OsmPlace
place_id
integer | null
osm_type
string | null
osm_id
integer | null
latitude
number | null
longitude
number | null
category
string | null
place_type
string | null
place_rank
integer | null
importance
number | null
addresstype
string | null
name
string | null
display_name
string | null
address
object | null
extratags
object
namedetails
object
boundingbox
number[]
geojson
object | null
source_url
string | null