Prediction data request
To request predicted GNSS navigation models, send an HTTP GET request to
the /v2/prediction endpoint on the HERE GNSS Data API.
Base URL
https://gnss.hereapi.com/v2/prediction
Authentication
The prediction endpoint supports the same authentication methods as the assistance endpoint.
See Assistance data request for details.
Query parameters
Unlike the assistance endpoint, the prediction endpoint uses separate query parameters for
each GNSS system. Each parameter specifies the start time for the prediction data.
| Parameter | Type | Required | Description |
|---|---|---|---|
gps | integer or now | No | Requests GPS predictions starting from the specified time. The value is a Unix time or GPS time in seconds, or the special value now for the current time. If omitted, the response does not include GPS predictions. |
glo | integer or now | No | Requests GLONASS predictions starting from the specified time. The value is a Unix time or GLONASS time in seconds, or the special value now for the current time. If omitted, the response does not include GLONASS predictions. |
gal | integer or now | No | Requests Galileo predictions starting from the specified time. The value is a Unix time or Galileo time in seconds, or the special value now for the current time. If omitted, the response does not include Galileo predictions. |
bds | integer or now | No | Requests BeiDou predictions starting from the specified time. The value is a Unix time or BeiDou time in seconds, or the special value now for the current time. If omitted, the response does not include BeiDou predictions. |
encoding | string | No | Specifies the encoding format for the LPP messages. Supported values: uper (default), jer. See JER encoding for details. |
lpp | string | No | Specifies the LPP ASN.1 root element. Use data (default) for A-GNSS-ProvideAssistanceData or full for LPP-Message. |
billingTag | string | No | A list of up to six billing tags, separated by +. Length: 4–101 characters. |
NoteAt least one GNSS system parameter (
gps,glo,gal, orbds) must be specified.
Request headers
| Header | Required | Description |
|---|---|---|
X-Request-ID | No | User-provided token to trace a request or a group of requests. Can be any string; UUID is recommended. The value is echoed in the response. |
Accept | No | Preferred media type for the response. For JER encoding, supported values are application/json-seq (default for JER), application/json, and application/x-ndjson. For UPER encoding, the only accepted value is multipart/mixed. If encoding=uper and a JSON content type is requested, the server responds with 406 Not Acceptable. |
Accept-Encoding | No | Preferred content encodings for response compression. Supported values: gzip, deflate, br (and identity for no compression). The server uses content negotiation to select the best option and indicates the choice in the Content-Encoding response header. |
48-hour batching and follow-up requests
The service returns up to 48 hours of prediction data per request.
To download predictions for the full prediction period (up to 14 days for GPS/GLONASS
or 7 days for Galileo/BeiDou), the client sends follow-up requests.
The response includes an X-Prediction-Next header containing the query parameters
for the next request. The client can use this value directly to build the next request URL.
Step-by-step process
- Send the initial request with
nowas the start time for each desired GNSS system. - Read the
X-Prediction-Nextheader from the response. - Send a follow-up request using the value of
X-Prediction-Nextin the query parameters. - Repeat the follow-up requests until the desired length of predictions have been downloaded
or until theX-Prediction-Nextheader is no longer present in the response,
which indicates that all available prediction data has been downloaded.
Example flow
Initial request:
GET /v2/prediction?gps=now&glo=now&apiKey={YOUR_API_KEY} HTTP/1.1
Host: gnss.hereapi.com
The response contains prediction data for GPS and GLONASS and includes the header:
X-Prediction-Next: gps=1772395200&glo=1772395200
Follow-up request:
GET /v2/prediction?gps=1772395200&glo=1772395200&apiKey={YOUR_API_KEY} HTTP/1.1
Host: gnss.hereapi.com
Repeat this process until X-Prediction-Next is no longer present.
NoteInstead of using the
X-Prediction-Nextheader, the client can also manually calculate
the start time for the next request. For each GNSS system, add theX-Validity-Start
andX-Validity-Durationvalues of the last received LPP message for that system.
Using theX-Prediction-Nextheader is recommended for simplicity.
JER encoding
When encoding=jer is specified, the response contains LPP messages in ASN.1
JSON Encoding Rules (JER) format. The Accept request header controls the specific
JSON content type.
Prediction data can be large, so compression is recommended.
Use the Accept-Encoding request header to indicate preferred compression methods.
The server selects the best option using content negotiation (RFC 9110) and reports
its choice in the Content-Encoding response header.
NoteUse UPER encoding to optimize the response size. UPER is a compact binary format that
reduces bandwidth usage and avoids the overhead of JSON parsing on the client.
If JER encoding is preferred, consider using streaming JSON formats
(application/json-seqorapplication/x-ndjson) instead ofapplication/json.
These formats can be parsed incrementally, avoiding the overhead of loading one
large JSON document before processing starts.
For details on JER response formats and content types, see
Response encoding and formats.
Examples
Request GPS predictions starting from now
GET /v2/prediction?gps=now&apiKey={YOUR_API_KEY} HTTP/1.1
Host: gnss.hereapi.com
Request GPS and Galileo predictions with a specific start time
GET /v2/prediction?gps=1772380800&gal=1772380800&apiKey={YOUR_API_KEY} HTTP/1.1
Host: gnss.hereapi.com
Request predictions in JER encoding
GET /v2/prediction?gps=now&encoding=jer&apiKey={YOUR_API_KEY} HTTP/1.1
Host: gnss.hereapi.com
Request predictions with bearer token
GET /v2/prediction?gps=now&glo=now HTTP/1.1
Host: gnss.hereapi.com
Authorization: Bearer {YOUR_BEARER_TOKEN}
Related information
Updated 4 days ago