Multi Geocode API
The purpose of this last endpoint is to return geographical coordinates from multiple addresses, either complete or partial.
- List of parameters
- Example 1 – Searching for coordinates of two or more addresses in the same request
To make the request to Multi Geocode you need to send the request using the POST method to the following endpoint:
List of parameters
Mandatory parameters
id
– Text with the identifier of the searched address.
It is compulsory to enter at least one of the parameters below. It is not necessary to inform everyone. However, the more information you provide, the more accurate the result will be.
road
– Name of the street or part of it;number
– Street number. DO NOT enter the complement data.city
– Name of city;state
– State;country
– Country;district
– Name of the neighborhood;zipcode
– Zip code;
For addresses outside Brazil, you will need to add the query param globalSearch
in the URL, as follows:
https://api.maplink.global/geocode/v1/geocode?globalSearch=true
Optional parameter
type
– Limits the type of research. Only for addresses in Brazil and if the parameterglobalSearch
is not entered. Possible values:ZIPCODE
– Zip code;STATE
– State;CITY
– City;DISTRICT
– Neighborhood.
Note: There is a limit of 200 points for submission in a single request.
Example 1 – Searching for coordinates of two or more addresses in the same request
In this example, we’re going to look for two different addresses in the same request. To do this, we need to identify each address with the parameter id
.
The first will be "Address1"
and the second "Address2"
. The full request can be seen below:
[ { "id": "Address1", "road": "Leopoldo Hess", "number": 75, "district": "São João", "zipcode": "88304-260", "city": "Itajai", "state": "SC" }, { "id": "Address2", "road": "Alameda Campinas", "number": 579, "zipcode": "01419-001", "city": "São Paulo", "state": "SP" } ]
In the response, the following information is returned:
found
– Number of records returned.results
– Array of objects with all the results found:id
– Identifier of the address entered in the request;address
– Object with address information:road
– Route name;district
– Neighborhood;zipCode
– Zip code;city
– City;state
– State;mainLocation
– Geographical coordinates atlatitude
/longitude
;
type
– Indicates the best element found in the map base for returning the geographic coordinate;score
– Reference score for the result of the geocoding process;label
– Complete address found used in the geocoding process.
Nota: Quanto maior o score
, maior será a relevância do resultado para o endereço solicitado.
The full response can be found below:
{ "found": 2, "results": [ { "id": "Address1", "address": { "road": "Rua Leopoldo Hess", "number": "75", "district": "São João", "zipCode": "88304260", "city": "Itajaí", "state": { "code": "SC", "name": "Santa Catarina" }, "mainLocation": { "lat": -26.90314282963394, "lon": -48.68023153051618 } }, "type": "ROAD", "score": 154.34358, "label": "Rua Leopoldo Hess, 75, São João,Itajaí, Santa Catarina, SC" }, { "id": "Address2", "address": { "road": "Alameda Santos", "district": "Cerqueira César", "zipCode": "01419001", "city": "São Paulo", "state": { "code": "SP", "name": "São Paulo" }, "mainLocation": { "lat": -23.568495, "lon": -46.650085 } }, "type": "ZIPCODE", "score": 48.98619, "label": "Alameda Santos, Cerqueira César,São Paulo, São Paulo, SP" } ] }