Wemap Geocoding Services
Wemap Geocoding Services live on the following host: https://api.getwemap.com
Geocoding / Reverse Geocoding
Geocoding allows you to perform geocoding or reverse geocoding.
Geocoding converts a place name or address into geographic coordinates,
e.g.,"Hôtel de ville, Montpellier"
→latitude: 43.598604, longitude: 3.8969825
.Reverse geocoding converts geographic coordinates into a human-readable address,
e.g.,latitude: 43.6117881, longitude: 3.8801634
→"39 Bd Bonne Nouvelle, 34000 Montpellier, France"
.
GET
/v3.0/geocoding/geocode?{parameter=value}
Request parameters
- latitude (integer) – latitude.
- longitude (integer) – longitude.
- address (string) – address.
- country (string) – restricts results to a specific country. (optional)
- extra_provider (boolean) – uses an alternative geocoding provider. (optional)
- language (string) – sets language for the response data. (optional)
- many (boolean) – returns all responses. (optional)
Required parameters
Please note that either address or latitude & longitude are required:
address
: if provided, geocoding will be performedlatitude
andlongitude
: if provided, reverse geocoding will be performed.
Optional parameters
extra_provider
: when set totrue
, geocoding and reverse geocoding will be performed using an alternative provider, which returns results you may prefer. The default value isfalse
.country
restricts query results to a specific country. A country is defined according to the two-letter codes from the ISO-3166 standard. Please note that these codes do not always accurately reflect the political reality of certain countries or territories. For example, French overseas departments, regions, and collectivities have specific ones1.
When using default geocoding provider, only one country code can be specified ; when using the alternative provider (extra_provider=true
), multiple country codes can be provided (OR logic) : in this case, they must be specified as a comma separated list, e.g. :country=fr,gp,mq
language
sets the language for translatable response fields, e.g. the city name"Paris"
will be translated to"Parigi"
iflanguage
is set toit
(italian). A language is specified using ISO-639 language codes.many
indicates whether a single result or multiple results should be returned (see below for response example).
Request examples
geocoding
GET /v3.0/geocoding/geocode?address=avenue%20du%20bonheur%2C%20Camprieu HTTP/1.1
Authorization: Bearer 0a1b2c3d4e5f
reverse geocoding
GET /v3.0/geocoding/geocode?longitude=3.4847668&latitude=44.1140578 HTTP/1.1
Authorization: Bearer 0a1b2c3d4e5f
reverse geocoding with extra_provider
GET /v3.0/geocoding/geocode?longitude=3.4847668&latitude=44.1140578&extra_provider=true HTTP/1.1
Authorization: Bearer 0a1b2c3d4e5f
geocoding restricted to one specific country, many results
GET /v3.0/geocoding/geocode?address=fort%20de%20france&country=fr&many=true HTTP/1.1
Authorization: Bearer 0a1b2c3d4e5f
geocoding restricted to many countries (extra_provider=true
)
GET /v3.0/geocoding/geocode?address=fort%20de%20france&country=fr,mq&extra_provider=true HTTP/1.1
Authorization: Bearer 0a1b2c3d4e5f
geocoding, result in german
GET /v3.0/geocoding/geocode?address=paris&language=de HTTP/1.1
Authorization: Bearer 0a1b2c3d4e5f
Response object
Each response consists of a JSON object (or a list of such objects) containing the following fields:
- address (string) – the complete formatted address of the location. This may include, when available, street, number, postal code, city, and country.
- bbox (array) – an array of
[minLon,minLat,maxLon,maxLat]
reflecting the spatial extent of areas like cities, regions, or landmarks. - country (string) – the country where the location is situated
- latitude (integer) – latitude.
- longitude (integer) – longitude.
- locality (string) – the city, town, or village where the location is situated.
- postal_code (string) – the ZIP or postal code associated with the location.
- street_number_route (string) – a combination of the street number (when available) and the street name (route), e.g.
"55 Rue de la Paix"
.
Response examples
with many=false
(default)
HTTP/1.1 200 OK
Content-Type: application/json
{
"address": "33 Bd de la Liberté, 35000 Rennes, France",
"bbox": [
-1.682087680291502,
48.1060298697085,
-1.679389719708498,
48.1087278302915
],
"country": "France",
"latitude": 48.1073583,
"locality": "Rennes",
"longitude": -1.6807283,
"postal_code": "35000",
"street_number_route": "33 Boulevard de la Liberté"
}
with many=true
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"address": "95270 Saint-Martin-du-Tertre, France",
"bbox": [
2.3084535,
49.0768168,
2.3621296,
49.1248558
],
"country": "France",
"latitude": 49.107764,
"locality": "Saint-Martin-du-Tertre",
"longitude": 2.35001,
"postal_code": "95270",
"street_number_route": ""
},
{
"address": "Chemin De Saint-Martin Du Tertre, 95270 Asnières-sur-Oise, France",
"bbox": null
"country": "France",
"latitude": 49.128924,
"locality": "Asnières-sur-Oise",
"longitude": 2.357006,
"postal_code": "95270",
"street_number_route": "Chemin De Saint-Martin Du Tertre"
}
]
- Status Codes
- 200 OK – success
- 400 Bad Request – for instance a required field is missing
- 401 Unauthorized – you did not provide authentication
- 403 Forbidden – you tried to access a forbidden resource
Timezone
Timezone allows you to return the timezone for the given coordinates.
GET
/v3.0/geocoding/timezone
Request parameters
- latitude (integer) – latitude. (Required)
- longitude (integer) – longitude. (Required)
Example timezone request:
GET /v3.0/geocoding/timezone?longitude=3.4847668&latitude=44.1140578 HTTP/1.1
Authorization: Bearer 0a1b2c3d4e5f
Example timezone response
HTTP/1.1 200 OK
Content-Type: application/json
"Europe/Paris"
- Status Codes
- 200 OK – success
- 400 Bad Request – for instance a required field is missing
- 401 Unauthorized – you did not provide authentication
- 403 Forbidden – you tried to access a forbidden resource
- Metropolitan France
fr
, French Guianagf
, Guadeloupegp
, Martiniquemq
, La Réunionre
, Mayotteyt
, Saint Barthélemybl
, Saint Martinmf
, Saint Pierre and Miquelonpm
, French Polynesiapf
, French Southern Territoriestf
, New Caledonianc
, Wallis and Futunawf
. Any request targeting all these territories must explicitly includeextra_provider=true&country=fr,gf,gp,mq,re,yt,bl,mf,pm,pf,tf,nc,wf
.↩