API concepts

URL structure

All data offered by the API is addressed with a simple URL:

https://consumer.qa.data.spglobal.com/namespace/Entity/service?format=json

For example, https://consumer.qa.data.spglobal.com/csbpd/Instrument/latest?format=json.

  • namespace identifies the dataset (see Model concepts).
  • Entity identifies the entity within the dataset.
  • service identifies the service, such as latest or timeseries.
  • The query string contains the request parameters, such as format, limit and after.

Namespace and entity names are case sensitive. Parameter names are not. All requests for data use HTTPS GET.

No side effects

Each call has no effect on subsequent calls, which keeps the API scalable and simple. The only exception is authentication: you obtain an API key once and use it in all subsequent requests.

Services

Depending on the dataset, the following services are available:

  • latest: the latest record of each instance of an entity.
  • timeseries: the historical records of an entity.
  • stream: all updates flowing through the platform for a dataset or entity.
  • batchrun: the records of a single batch run, and the list of batch runs.
  • archive: archived stream messages.
  • meta: the namespaces, entities and fields available to you.
  • Attachments: binary files that belong to an instance.

Data formats

The default format is JSON. XML and CSV are available for most services. HTML is intended for exploring the API in a browser. See the format parameter.

Paging

Results larger than the page size are returned in pages:

  1. Set limit to the number of records per page. Using limit is strongly recommended for any request that can return many records.
  2. Request the envelope of the response with envelope=true. The envelope contains an after value.
  3. Request the next page by repeating the request with the after parameter set to that value.
  4. Stop when a response contains no after value or no records.

Always use the after value exactly as returned. Its format depends on the service and on the API version and must not be constructed by the client.

For the stream service the process is different: keep polling with the returned after value, including after empty responses.

Adding nextUrl=true to the envelope request returns the full URL of the next page in a next field.

Requests, logging and support

Every response carries a requestId, in the envelope of data responses, in the body of error responses and in the X-Request-Id response header. Log it with your own request logs. If you contact S&P Global about a request, quote the requestId.

Exploring in the browser

Every URL can be opened in a browser with format=HTML. The HTML view shows the data, the fields of the entity and a form for the request parameters. Change format=HTML to format=JSON for a response suited to application integration.