Construct a request to HERE Geocoding & Search API v7
A request to the HERE Geocoding and Search API v7 includes the basic elements shown in the following table and, in
addition, may contain resource-specific parameters.
GET requests
Info
Most HERE Geocoding and Search endpoints are called with a
GETmethod.
| Element | Value / Example | Description |
|---|---|---|
Method https
Base URL
[service].search.hereapi.com
Base URL for the selected service. Endpoints are named after their related service.
For example, the Discover service is served by the /discover endpoint,
therefore the base URL is discover.search.hereapi.com.
Version
v1
Endpoint
/discover
Find places or locations using a free-form text query
/autosuggest
Get suggestions to build search queries
/geocode
Search for an address and return the corresponding geo-coordinates
/autocomplete
Get address completions for entered keystrokes
/revgeocode
Find the nearest address to specific geo-coordinates
/browse
Find places using names or{' '}
category IDs
/lookup
Find a place or location object by its identifier
Parameters
[key]=[value]&...
Endpoint-specific query parameters.Repeating the same parameter key results in a 400 error.See the API Reference for details. |
for instance the following URI
https://discover.search.hereapi.com/v1/discover?at=52.5228,13.4124&q=petrol+station&limit=5
is used to reach the \discover endpoint with the following parameters:
atset to the latitude52.5228and longitude13.4124qset to "petrol station"limitset to 5
POST requests
| Element | Value | Description |
|---|---|---|
| Method | POST |
|
| Scheme | https |
|
| Base URL |
[service].search.hereapi.comChina: signals.search.hereapi.cn
|
Base URL for the selected service. Endpoints are named after their related service.
For example, the multi-reverse geocode service is served by the
/multi-revgeocode
endpoint. Therefore, the base URL for the multi-reverse geocode service is
multi-revgeocode.search.hereapi.com.
|
| Version | v1 |
|
| Endpoint | /multi-revgeocode |
Retrieve multiple addresses or places with a single request |
| Parameters | [key]=[value]&... |
Endpoint-specific query parameters. Repeating the same parameter key results in a 400 error.See the API Reference for details. |
| Body | [key]=[value]&... |
POST body–specific parameters. Repeating the same parameter key results in a 400 error.See the API Reference for details. |
| Element | Value | Description |
|---|---|---|
| Method | POST |
|
| Scheme | https |
|
| Base URL |
signals.search.hereapi.comChina: signals.search.hereapi.cn
|
Base URL |
| Version | v1 |
|
| Endpoint | /signals |
Share information about a user action on a result item |
Request headers
Important context information is passed to the API using optional HTTP request headers. Wherever applicable the service relies on established and standardized headers, complementing these with some additional private headers. Some of these directly affect the results, while others help to optimize search results.
The following table describes the http request header.
| Header name | Description |
|---|---|
| Accept | Specifies which media types are acceptable for the response Accept header specification. The only value supported is application/json resulting in a standard JSON response. This value is also the default one. |
| Date | The user's local time, for example, "Mon, 08 Aug 2011 11:58:17 GMT" (see Date header specification). |
| User-Agent | A string identifying the client user agent (see User-Agent header specification), used for statistical purposes. If HERE Geocoding and Search is accessed from within a web browser, the browser should send this information automatically. For other applications, it may need to be explicitly set by the application. |
| Accept-Encoding | Allows clients to enable compressed transfer of responses. The only supported value is gzip-compression. Clients are strongly encouraged to make use of that option, as it can have a major impact on the responsiveness and performance of the client application (see Accept-Encoding header specification). |
| X-Request-ID | Allows a client to specify a different identifier for each query sent to HERE Geocoding and Search and get that ID back in the response header. This is useful for customers own data mining and logging analysis about the correlation of responses to requests and to communicate with HERE about potential issues. |
Response customization
HERE Geocoding and Search allows the customization of the response through the show query parameter. Check the dedicated chapter for details.