Geocoder API China - BETA Developer's Guide

Location for a Free-form Address

The user wants to retrieve the latitude, longitude and complete address details of 'Beijing, East Qianmen Ave, China' 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.hereapi.cn/6.2/geocode.json
  ?app_id={YOUR_APP_ID}
  &app_code={YOUR_APP_CODE}
  ?searchtext=Beijing,%20East%20Qianmen%20Ave,%20China

Response

The response to the request contains the following information blocks:
  • metadata about the request
  • information about the address, including
    • match quality
    • location information
    • address information
{
  "Response": {
  "MetaInfo": {
    "Timestamp": "2018-11-30T10:52:23.138+0000"
  },
  "View": [
    {
    "_type": "SearchResultsViewType",
    "ViewId": 0,
    "Result": [
      {
      "Relevance": 0.81,
      "MatchLevel": "street",
      "MatchQuality": {
        "Country": 1,
        "City": 1,
        "Street": [
        0.68
        ]
      },
      "Location": {
        "LocationId": "NT_LocGSLxJNTd5k6dMN4ncOB",
        "LocationType": "address",
        "DisplayPosition": {
        "Latitude": 39.89426,
        "Longitude": 116.40095
        },
        "NavigationPosition": [
        {
          "Latitude": 39.89426,
          "Longitude": 116.40095
        }
        ],
        "MapView": {
        "TopLeft": {
          "Latitude": 39.9002,
          "Longitude": 116.39973
        },
        "BottomRight": {
          "Latitude": 39.89205,
          "Longitude": 116.40113
        }
        },
        "Address": {
        "Label": "中国北京市东城区前门东路",
        "Country": "CHN",
        "State": "北京市",
        "City": "北京市",
        "District": "东城区",
        "Street": "前门东路",
        "AdditionalData": [
          {
          "value": "中国",
          "key": "CountryName"
          },
          {
          "value": "北京市",
          "key": "StateName"
          }
        ]
        }
  ...
}