Getting started
Concepts
- Model concepts
- API concepts
- API versions
- Entitlements
- Filters
- Request parameters
- Usage quota
- Error codes
Services
Parameters
- after
- aggregate
- aggregateIncrementFrom
- cursor
- dateFormat
- descending
- entity
- envelope
- fields
- format
- from
- groupBy
- groupById
- groupByIdAndTime
- groupByTo
- includeMetaData
- inline
- inlineLatest
- inlineTimeseries
- limit
- modulus
- nextUrl
- part
- pivot
- rankBy
- requestTimeout
- returnPreSignedUrl
- showMessage
- showStreamCursor
- to
- trace
- verifyLinks
- wait
Deprecated parameters
Datasets
- ECR: timeseries and observations
- ECR: usage patterns
- fiindices: retrieving index data
- Parsing: asset classes
- Parsing: best practices
Samples
API versions
The API is available in two versions, 1 and 2. Both versions are available on every host. Each host has a default version that applies when a request does not select one.
Recommended: use API version 2 for all new applications, and migrate existing applications to it. Version 2 pages through large results more efficiently and needs fewer requests. See Migrating from version 1.
This page was requested using API version 2.
Selecting a version
Select the version with a /v1 or /v2 prefix in the path, for example:
https://api-qa.ihsmarkit.com/v2/namespace/Entity/latest
Recommended: always use the
/v1or/v2path prefix to select the version.
When no version is specified in the path, the default version of the host applies. The version can also be selected with the hidden v query parameter (1 or 2), though the path prefix takes precedence and is recommended.
Any other version is rejected with an error. Specify the version explicitly, because your application depends on version-specific behaviour.
Why version 2
Version 2 is designed around efficient paging through large results.
- The server chooses the order. Sorting a large result page by page, in an order other than the internal order of the database, is slow. Reading the data in the internal order of the database is much faster. If your application needs the records in a particular order, sort them in your application after you have received them.
- You do not have to choose the best order. The best order for a request depends on the entity, the filters and how the data is stored. Version 1 introduced
sortBy=autoto let the server choose. In version 2 this is the only behaviour on the latest service, sosortByis not needed there. - The position of the next page is given explicitly. Because the order is chosen by the server, the position of the next page cannot be derived from the last record of a response. The server returns it as the after value instead. To make that value easy to find, the envelope that carries it is on by default. The value is opaque, so that applications use it exactly as returned and do not depend on its content.
- One request less per result. In version 1 the last page of a result is usually followed by a request that returns no records. In version 2
afteris only returned when more records can follow, so the absence ofaftertells you that you have everything, without an extra request.
Differences between versions
| Behaviour | Version 1 | Version 2 |
|---|---|---|
| envelope | Off unless envelope=true. | On unless envelope=false. |
| after returned for latest, timeseries and batchrun | With every response that contains records. The next response can be empty. | Only when the page is full, that is when more data can follow. |
Format of after | Readable. | Opaque. Use the value exactly as returned. |
| sortBy on latest | Supported, including auto. | Not supported: the order is always chosen automatically. Use rankBy to return top results sorted by a field. |
| sortBy on timeseries | Supported, including auto. | A named sort order is supported; auto is not, because the order is chosen automatically when sortBy is absent. |
| Filter of a timeseries on the latest value of a field | Plain field name. | Prefix the field with latest.. |
| stream message types | BATCH_RUN_EVENT and EMPTY. | The underlying event names, for example BATCHRUN_START, BATCHRUN_COMPLETE and BATCHRUN_CANCEL. |
| Default dateFormat | ISO8601 (dates include Z, for example YYYY-MM-DDZ). | ISO8601-2 (dates have no time zone, for example YYYY-MM-DD). |
Migrating from version 1
- Select version 2 explicitly with the
/v2path prefix, so that a change of the host default does not affect your application. - Remove
sortByfrom latest requests, includingsortBy=auto; version 2 refuses it. Use rankBy if you need the top results sorted by a field. On timeseries requests, removesortBy=autoand keep a named sort order only if S&P Global advised it. - Sort in your application if you depend on the order of the records. Do not rely on the order in which the server returns them.
- Read the envelope. Read the data from the field named after the service (for example
latest) and theaftervalue from the envelope. If you parsed a plain JSON array, either adapt the parser or setenvelope=false, but then you cannot page. - Treat
afteras opaque. Pass it back exactly as returned. Do not store it beyond the paging of one result, construct it, or compare it. - Stop paging when
afteris absent. Do not request another page after a response withoutafter. - Prefix latest filters on timeseries requests with
latest., for examplelatest.country=NL. See timeseries. - On the stream, handle the version 2 message types, such as
BATCHRUN_STARTandBATCHRUN_COMPLETE, instead ofBATCH_RUN_EVENT. - Check date parsing. Version 2 defaults dateFormat to
ISO8601-2(YYYY-MM-DD), without the trailingZthat version 1 includes (ISO8601,YYYY-MM-DDZ). SetdateFormat=ISO8601if your application expects the version 1 format.
A client that always sets envelope=true, always follows after, and stops when after is absent or the page is empty works with both versions. That makes it possible to migrate step by step.