Location for a Free-form Address
The user wants to retrieve the latitude, longitude and complete address details of 200 S Mathilda Ave, Sunnyvale, CA based on a free-form text input.
Request
The following GET request uses the parameter searchtext
to specify the encoded value of the free-form address.
https://geocoder.ls.hereapi.com/6.2/geocode.json
?apiKey={YOUR_API_KEY}
&searchtext=200%20S%20Mathilda%20Sunnyvale%20CA
Response
- metadata about the request
- information about the address, including
- match quality
- location information
- address information
{"Response": {
"MetaInfo": {"Timestamp": "2016-11-09T10:17:23.943+0000"},
"View": [{
"_type": "SearchResultsViewType",
"ViewId": 0,
"Result": [{
"Relevance": 1,
"MatchLevel": "houseNumber",
"MatchQuality": {
"State": 1,
"City": 1,
"Street": [0.9],
"HouseNumber": 1
},
"MatchType": "pointAddress",
"Location": {
"LocationId": "NT_nL.dzNwdSJgdcF4U8dYEiC_yADM",
"LocationType": "point",
"DisplayPosition": {
"Latitude": 37.37634,
"Longitude": -122.03405
},
"NavigationPosition": [{
"Latitude": 37.37643,
"Longitude": -122.03444
}],
"MapView": {
"TopLeft": {
"Latitude": 37.3774642,
"Longitude": -122.0354646
},
"BottomRight": {
"Latitude": 37.3752158,
"Longitude": -122.0326354
}
},
"Address": {
"Label": "200 S Mathilda Ave, Sunnyvale, CA 94086, United States",
"Country": "USA",
"State": "CA",
"County": "Santa Clara",
"City": "Sunnyvale",
"District": "Heritage District",
"Street": "S Mathilda Ave",
"HouseNumber": "200",
"PostalCode": "94086",
"AdditionalData": [
{
"value": "United States",
"key": "CountryName"
},
{
"value": "California",
"key": "StateName"
},
{
"value": "Santa Clara",
"key": "CountyName"
},
{
"value": "N",
"key": "PostalCodeType"
}
]
}
}
}]
}]
}}