Geocoder API Developer's Guide

Multi Reverse Geocode Request

Multi Reverse Geocoding Example

Retrieve street address or area information for up to one hundred coordinates with one multi reverse geocoding HTTP POST request. The method is synchronous which means that the reverse geocoding results are contained in the response.

The body of the HTTP POST request contains the coordinates and optional radius in the prox parameter and an optional numeric identifier in the id parameter as plain text, one line per pair of coordinates. The identifier associates each result with the corresponding input. If no id is provided the system creates one starting with 0.

The number of coordinate pairs per request is limited to 100. Requests with more than 100 coordinate pairs result in an error response.

All further reverse geocoding parameters except prox and id can be specified in the URL as usual.

Retrieve Multiple Addresses with One Request

This example shows a request for one address (maxresults=1, mode=retrieveAddresses) for ten sets of latitude, longitude and radius.

Set the body of the POST request to the file containing the ten sets of coordinates and ids,
id=0001&prox=52.5309792,13.3845797,50
id=0002&prox=50.1618996,8.5334997,50
id=0003&prox=40.72962607104243,-73.98685008095087,50
id=0004&prox=47.609877297128094,-122.34250277090143,50
id=0005&prox=-22.98040197212022,-43.189731399601726,50
id=0006&prox=-8.494347821639211,115.25337974172669
id=0007&prox=28.63383758137441,77.21917444061432,50
id=0008&prox=-33.92046215720197,18.42085660357364,50
id=0009&prox=21.00272769618338,-89.62247149160008,50
id=0010&prox=24.660771905240175,46.71228298253175,50

and the URL of the post request to:

https://reverse.geocoder.cit.api.here.com/6.2/multi-reversegeocode.xml
?mode=retrieveAddresses
&maxresults=1
&app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&gen=9

The following example shows a complete request using curl. The coordinates are in the text file postfile.txt and the response is written to response.txt.

curl -X POST -H "Content-Type: text/plain" --data-binary @postfile.txt -o response.txt"https://reverse.geocoder.cit.api.here.com
  /6.2/multi-reversegeocode.xml
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&gen=9
&mode=retrieveAddresses
&maxresults=1"

Make sure to add the content type header Content-Type: text/plain and the --data-binary parameter.

The following code shows part of the response. The <ItemId> element links the output <Item> with the input id.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:MultiSearch>
  <Response>
    <MetaInfo>
      <Timestamp>2015-09-15T06:34:14.645Z</Timestamp>
    </MetaInfo>
    <Item>
      <ItemId>1</ItemId>
      <Result>
        <Relevance>1.0</Relevance>
        <Distance>0.1</Distance>
        <MatchLevel>houseNumber</MatchLevel>
        <MatchQuality>
          <Country>1.0</Country>
          <State>1.0</State>
          <County>1.0</County>
          <City>1.0</City>
          <District>1.0</District>
          <Street>1.0</Street>
          <HouseNumber>1.0</HouseNumber>
          <PostalCode>1.0</PostalCode>
        </MatchQuality>
        <MatchType>pointAddress</MatchType>
        <Location>
        <LocationId>NT_5v-U9-t5AZa5VsRdV06lLB_xEjN</LocationId>
        <LocationType>address</LocationType>
          <DisplayPosition>
            <Latitude>52.53086</Latitude>
            <Longitude>13.38469</Longitude>
          </DisplayPosition>
          <NavigationPosition>
            <Latitude>52.53098</Latitude>
            <Longitude>13.38458</Longitude>
          </NavigationPosition>
          <MapView>
            <TopLeft>
              <Latitude>52.5319842</Latitude>
              <Longitude>13.3828421</Longitude>
            </TopLeft>
            <BottomRight>
              <Latitude>52.5297358</Latitude>
              <Longitude>13.3865379</Longitude>
            </BottomRight>
          </MapView>
          <Address>
            <Label>Invalidenstraße 116, 10115 Berlin, Deutschland</Label>
            <Country>DEU</Country>
            <State>Berlin</State>
            <County>Berlin</County>
            <City>Berlin</City>
            <District>Mitte</District>
            <Street>Invalidenstraße</Street>
            <HouseNumber>116</HouseNumber>
            <PostalCode>10115</PostalCode>
            <AdditionalData key="CountryName">Deutschland</AdditionalData>
            <AdditionalData key="StateName">Berlin</AdditionalData>
            <AdditionalData key="CountyName">Berlin</AdditionalData>
          </Address>
        </Location>
      </Result>
    </Item>
    <Item>
      <ItemId>2</ItemId>
      <Result>
      ...
      </Result>
    </Item>
    ...
  </Response>
</ns2:MultiSearch>
          

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.