Suggestions API
The complete response can be checked below: The purpose of this third endpoint, Suggestions, is to return the geographic coordinates from an address provided in the URL itself.
To make the request to Suggestions, it is necessary to send the request using the GET method to the following endpoint:
All parameters to obtain the geographic coordinates and address suggestions will be sent in the URL itself.
Note: Currently returning only to directions located in Brazil.
The Suggestions API has been updated to V2. The endpoint https://api.maplink.global/geocode/v1/suggestions will still work, but it is recommended to use the new endpoint for more accurate results and because new features will be exclusive to the new version.
Parameter list
Mandatory parameter
q
– Provide the address or part of it.
Optional parameters
center
– Reference coordinates for the search results. Format:center=-23.552088765,-46.6341653162
;radius
-Specifies the search radius, in meters, from the central point defined in center. If not entered, the default value is 5,000,000 meters (5,000 km).
Example 1 – Search for suggestions from free text
In this example, we want to get suggestions for the text "Alameda Campinas, 01404100, Jardim Paulista"
. The request is below:
Note: It is recommended to describe the address with the greatest amount of information, ordering the most important elements (Street, Number, Zip Code, District, City State) and without abbreviations for greater assertiveness of results.
In the response, the following information is returned:
found
– Number of records returned.results
– Array of objects with all the results found:id
– Address identifier provided in the request;address
– Object with address information:road
– Name of the road;district
– District;zipCode
– Zipcode;city
– City;state
– State;mainLocation
– Object with the geographic coordinates of the point:lat
– Latitude;lon
– Longitude;
type
– Indicates the best element found in the cartographic database for returning the geographic coordinate;score
– Reference score of the result of the geocoding process;label
– Complete address found used in the geocoding process.
Note: The higher the score, the more relevant the result will be to the requested address.
The full response can be found below:
{ "results": [ { "id": "6684353bf0662a1541ff6385", "address": { "road": "ALAMEDA CAMPINAS", "district": "JARDIM PAULISTA", "zipCode": "01404100", "city": "SÃO PAULO", "state": { "name": "SÃO PAULO", "code": "SP" }, "mainLocation": { "lat": -23.56631144908, "lon": -46.65360036597 } }, "type": "ROAD", "label": "ALAMEDA CAMPINAS, 01404100, JARDIM PAULISTA, SÃO PAULO, SP", "score": 85.4173641545432 }, { "id": "6684353bf0662a1541ff63a2", "address": { "road": "ALAMEDA CAMPINAS", "district": "JARDIM PAULISTA", "zipCode": "01404200", "city": "SÃO PAULO", "state": { "name": "SÃO PAULO", "code": "SP" }, "mainLocation": { "lat": -23.56714829171, "lon": -46.65440337412 } }, "type": "ROAD", "label": "ALAMEDA CAMPINAS, 01404200, JARDIM PAULISTA, SÃO PAULO, SP", "score": 67.51744304384503 }, { "id": "6684353bf0662a1541ff635d", "address": { "road": "ALAMEDA CAMPINAS", "district": "JARDIM PAULISTA", "zipCode": "01404000", "city": "SÃO PAULO", "state": { "name": "SÃO PAULO", "code": "SP" }, "mainLocation": { "lat": -23.5663551335, "lon": -46.65364273168 } }, "type": "ROAD", "label": "ALAMEDA CAMPINAS, 01404000, JARDIM PAULISTA, SÃO PAULO, SP", "score": 67.51744304384503 }, { "id": "6684353bf0662a1541ff63a3", "address": { "road": "ALAMEDA CAMPINAS 150", "district": "JARDIM PAULISTA", "zipCode": "01404900", "city": "SÃO PAULO", "state": { "name": "SÃO PAULO", "code": "SP" }, "mainLocation": { "lat": -23.56343039334, "lon": -46.6507807755 } }, "type": "ROAD", "label": "ALAMEDA CAMPINAS 150, 01404900, JARDIM PAULISTA, SÃO PAULO, SP", "score": 63.98775935173035 }, { "id": "6684353bf0662a1541ff637b", "address": { "road": "ALAMEDA CAMPINAS", "district": "JARDIM PAULISTA", "zipCode": "01404001", "city": "SÃO PAULO", "state": { "name": "SÃO PAULO", "code": "SP" }, "mainLocation": { "lat": -23.56880844109, "lon": -46.65604091167 } }, "type": "ROAD", "label": "ALAMEDA CAMPINAS, 01404001, JARDIM PAULISTA, SÃO PAULO, SP", "score": 62.547320382935666 }, { "id": "6684353bf0662a1541ff63b9", "address": { "road": "ALAMEDA CAMPINAS", "district": "JARDIM PAULISTA", "zipCode": "01404002", "city": "SÃO PAULO", "state": { "name": "SÃO PAULO", "code": "SP" }, "mainLocation": { "lat": -23.57150846699, "lon": -46.65863824537 } }, "type": "ROAD", "label": "ALAMEDA CAMPINAS, 01404002, JARDIM PAULISTA, SÃO PAULO, SP", "score": 62.36442055021014 }, { "id": "6684353bf0662a1541ff637c", "address": { "road": "ALAMEDA CAMPINAS", "district": "JARDIM PAULISTA", "zipCode": "01404003", "city": "SÃO PAULO", "state": { "name": "SÃO PAULO", "code": "SP" }, "mainLocation": { "lat": -23.5727482959, "lon": -46.65984093151 } }, "type": "ROAD", "label": "ALAMEDA CAMPINAS, 01404003, JARDIM PAULISTA, SÃO PAULO, SP", "score": 62.36442055021014 }, { "id": "66842f7b6969121fb9f0de4e", "address": { "road": "ALAMEDA CAMPINAS", "district": "JARDIM PAULISTA", "zipCode": "12947480", "city": "ATIBAIA", "state": { "name": "SÃO PAULO", "code": "SP" }, "mainLocation": { "lat": -23.141018593, "lon": -46.557696254 } }, "type": "ROAD", "label": "ALAMEDA CAMPINAS, 12947480, JARDIM PAULISTA, ATIBAIA, SP", "score": 60.32122203281947 }, { "id": "6684353bf0662a1541ff6359", "address": { "road": "ALAMEDA CAMPINAS, 433", "district": "JARDIM PAULISTA", "zipCode": "01404901", "city": "SÃO PAULO", "state": { "name": "SÃO PAULO", "code": "SP" }, "mainLocation": { "lat": -23.56550964281, "lon": -46.65281726051 } }, "type": "ROAD", "label": "ALAMEDA CAMPINAS, 433, 01404901, JARDIM PAULISTA, SÃO PAULO, SP", "score": 58.74167782919748 }, { "id": "6684343ef0662a1541f5003c", "address": { "road": "ALAMEDA SARUTAIÁ", "district": "JARDIM PAULISTA", "zipCode": "01403010", "city": "SÃO PAULO", "state": { "name": "SÃO PAULO", "code": "SP" }, "mainLocation": { "lat": -23.5689407, "lon": -46.6549067 } }, "type": "ROAD", "label": "ALAMEDA SARUTAIÁ, 01403010, JARDIM PAULISTA, SÃO PAULO, SP", "score": 55.39309246199472 } ], "found": 10 }