osrmroute-com Geocoding API
The Geocoding API API from osrmroute-com — 1 operation(s) for geocoding api.
The Geocoding API API from osrmroute-com — 1 operation(s) for geocoding api.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/osrmroute-com:osrmroute-com-geocoding-api-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: OSRMRoute Geocoding API
version: 1.1.0
description: 'OSRMRoute — Maps, Routing, Truck Routing, Search, Road Data, Studio and integration APIs. Use `Authorization: Bearer ` unless an operation documents another flow. Legacy APIs also accept the key query parameter; New geospatial APIs, MCP and private map delivery require Bearer authentication. Mobile challenge/token endpoints use device attestation instead. Coordinates and units are documented per operation: GeoJSON uses longitude,latitude; some legacy and background-job inputs use latitude,longitude. Examples are illustrative, not guaranteed current results. Guides · Mobile Access · MCP · Postman collection.'
contact:
name: OSRMRoute Support
url: https://osrmroute.com/contact
email: support@osrmroute.com
termsOfService: https://osrmroute.com/terms
servers:
- url: https://osrmroute.com
security:
- bearerAuth: []
- apiKeyQuery: []
tags:
- name: Geocoding API
paths:
/api/1/geocode:
get:
tags:
- Geocoding API
summary: Geocoding API
description: 'The Geocoding API converts free-text addresses into precise coordinates (forward) and coordinates back into readable addresses (reverse). Forward search runs on a self-hosted Photon engine for fast, typo-tolerant, multilingual autocomplete that covers streets, addresses and points of interest; reverse runs on Nominatim for accurate structured results. Relevance controls — location bias, bounding box, category and strict country and city filters — let you tune results for any use case.
Source hits expose source_localities and postal_city as source observations; city remains reserved for verified city metadata. Source building groups retain an actual representative source ID/coordinate, address_group=building, unit_records (unit-bearing source rows, not a surveyed apartment count), and representative_unit. Exact unit results retain unit. Distinct source points, buildings and apartments remain stored.
Without country, search is global. country=AZ restricts results to Azerbaijan; country=AZ&city=Bakı restricts them to Baku in Azerbaijan. No match returns HTTP 200 with an empty list, without expanding to another area. A city without a country or an invalid country code returns HTTP 400 InvalidGeocodeFilter. lat/lon only affect proximity ranking and cannot override these filters. Records without confirmed city metadata are excluded from city-filtered results.'
operationId: get_geocoding
parameters:
- name: q
in: query
required: false
description: The address to search (e.g. "Nizami Street, Baku").
schema:
type: string
example: Nizami street, Baku
- name: reverse
in: query
required: false
description: Must be true to perform reverse geocoding (searching from coordinate to address).
schema:
type: boolean
example: false
- name: point
in: query
required: false
description: Coordinate (lat,lng) to reverse geocode into an address. Required when reverse=true.
schema:
type: string
example: 40.3755,49.8516
- name: limit
in: query
required: false
description: Maximum number of results to return (1–20, default 5).
schema:
type: integer
example: 5
- name: lang
in: query
required: false
description: Preferred language for result names (e.g. en, az, ru). Defaults to en.
schema:
type: string
example: en
- name: lat
in: query
required: false
description: Latitude to bias results toward (nearby matches rank first). Pair with lon.
schema:
type: number
example: 40.3755
- name: lon
in: query
required: false
description: Longitude to bias results toward. Pair with lat.
schema:
type: number
example: 49.8516
- name: bbox
in: query
required: false
description: 'Restrict results to a bounding box: minLon,minLat,maxLon,maxLat.'
schema:
type: string
example: 49.75,40.30,49.95,40.45
- name: osm_tag
in: query
required: false
description: Filter by OSM tag, e.g. place (settlements) or amenity:cafe. Prefix with ! to exclude.
schema:
type: string
example: amenity:restaurant
- name: country
in: query
required: false
description: ISO 3166-1 alpha-2 country code, for example AZ. Returns results only within that country.
schema:
type: string
example: AZ
- name: city
in: query
required: false
description: Strict city filter, for example Baku. Requires exactly one country code.
schema:
type: string
example: Bakı
- name: elastic
in: query
required: false
description: Elastic (fuzzy, high-recall) search — default true. Tolerates typos, missing diacritics (ə↔e), reordered words, generic words (metro, rayonu) and house numbers. Set false for strict exact matching.
schema:
type: boolean
example: 'true'
- name: locality
in: query
required: false
schema:
type: string
maxLength: 120
description: Exact observed locality/postal-city name; requires one country. Matches source_localities or structured upstream locality fields, without asserting that every source level is an administrative city. Applied before source candidate limits.
- name: postcode
in: query
required: false
schema:
type: string
maxLength: 32
description: Exact postal code; requires one country. Missing or conflicting postcode records are excluded.
- name: unit
in: query
required: false
schema:
type: string
maxLength: 80
description: Exact apartment/unit from the source. Applied before source candidate limits; full house number remains in q.
- name: address_mode
in: query
required: false
schema:
type: string
enum:
- buildings
- units
default: buildings
description: Default groups co-located source unit records before limiting. Units lists individual observations. A unit filter implies units; do not combine unit with buildings.
responses:
'200':
description: Matching results within all supplied filters. No match returns an empty list; scope is never expanded.
content:
application/json:
examples:
success:
summary: Illustrative abbreviated response; values vary with input and map data.
value:
hits:
- name: Nizami Street
city: Baku
country: Azerbaijan
countrycode: AZ
point:
lat: 40.3777
lng: 49.8516
took: 12
noMatch:
value:
hits: []
took: 1
'400':
description: 'InvalidGeocodeFilter: invalid country code, or city without exactly one country. Invalid filters do not consume credits.'
content:
application/json:
schema:
type: object
properties:
code:
type: string
error:
type: string
example:
code: InvalidGeocodeFilter
error: city requires exactly one country, for example country=AZ&city=Bakı.
'401':
description: Error Codes (HTTP 401)
content:
application/json:
examples:
auth:
value:
error: Invalid API Key
'402':
description: Error Codes (HTTP 402)
content:
application/json:
examples:
balance:
value:
error: 'Insufficient balance: this request costs 1 credit and your balance is 0 credits. Top up your account to continue.'
'403':
description: Error Codes (HTTP 403)
content:
application/json:
examples:
plan:
value:
error: This API Key is disabled
'422':
description: Error Codes (HTTP 422)
content:
application/json:
examples:
NoNearbyAddress:
value:
code: NoNearbyAddress
error: No indexed address or place within 1 km.
'429':
description: Error Codes (HTTP 429)
content:
application/json:
examples:
rate:
value:
error: 'Rate limit exceeded: more than 60 requests per minute. Please slow down.'
'500':
description: Error Codes (HTTP 500)
content:
application/json:
examples:
upstream:
value:
error: Internal Server Error
x-credit-cost: 1 credit
x-request-limits:
- 'limit: 1–20'
- 'reverse: max_distance_m = 1000'
- 'city: exactly 1 country'
components:
securitySchemes:
apiKeyQuery:
type: apiKey
in: query
name: key
bearerAuth:
type: http
scheme: bearer