Loading the API reference…

Browse the API reference

Get a universe's current constituents

get https://quant-ws.prod.thinkalpha.io/universes/{idOrSlug}/constituents

Returns the members of a universe's current snapshot, one row per instrument, sorted by instrument (equities by symbol, then options).

Access. The caller must have read access to the universe (see GET /universes); a universe that does not exist and one the caller cannot read both return 404. idOrSlug accepts the universe's UUID or its slug.

Freshness. The snapshot is the latest accepted evaluation of the universe. Universes re-evaluate according to their refresh policy (every 5 minutes for streaming, on a period derived from the cron expression for scheduled, never on a schedule for static), whenever the membership, refresh policy, guards or OTC policy of their definition change (editing the name, description or tags does not re-evaluate, so the served snapshot is kept), and whenever a universe they reference changes, whatever their refresh policy. Evaluations run independently of requests; reading does not start one. This request returns the current snapshot immediately, however old it is. A universe that has no snapshot yet (see health in GET /universes) waits for the first one to be published, for at most 30 seconds, and then fails with 408. A frozen universe is not re-evaluated. If an evaluation is rejected by an update guard or fails, the previous snapshot stays in service.

Representation. The body is streamed in one of two formats, chosen by the Accept header:

  • application/json (the default, also chosen for no Accept, */* and application/*): one JSON array of constituent objects.
  • application/x-ndjson: newline-delimited JSON, one constituent object per line, each line ending in \n.

;charset=utf-8 is accepted on either type; any other media-type parameter makes that entry not match. When both types are acceptable, the one with the higher q value wins, and a tie goes to JSON. q=0 excludes a type. An Accept header that admits neither type returns 406. The format query parameter overrides Accept entirely, for clients that cannot set headers. Responses carry Vary: Accept. If the response fails after streaming has begun, the body ends early: a JSON array may be unterminated and an NDJSON body may end after a complete or incomplete line. Confirm that the HTTP body completed without error and that the number of parsed rows equals x-universe-count.

Snapshot metadata. Because the body is a bare row stream, the snapshot's metadata is returned in response headers:

  • x-universe-id: the universe's UUID.
  • x-universe-slug: the universe's slug.
  • x-universe-count: the number of rows in the body.
  • x-universe-timestamp: when the snapshot was evaluated (ISO 8601 instant, UTC).
  • x-universe-source-date: the business date of the underlying source data (ISO 8601 date); present only when the source is dated, such as ETF holdings.

Conditional requests. Every 200 carries a weak ETag computed from the snapshot's content and the chosen format, and Cache-Control: private, no-cache. The tag does not change when a re-evaluation produces identical members at the same source date; the evaluation time alone is not part of it, but a new source date is. Send it back in If-None-Match to receive 304 Not Modified with no body when the members are unchanged.

To list the instruments across every universe an identity can read, use GET /universes/allowed-instruments (objects) or GET /universes/allowed-symbols (canonical symbol strings). To evaluate an expression without saving a universe, use POST /universes/evaluate.

Authentication
Bearer token or Client credentials (HTTP Basic)

Path parameters

  • UniverseIdOrSlug required

    The universe's UUID or its slug. A UUID is matched case-insensitively; a slug is lowercase kebab-case and matched exactly.

Query parameters

  • format "array" | "ndjson"

    Response format, overriding the `Accept` header. `array`: a JSON array (`application/json`). `ndjson`: newline-delimited JSON, one object per line (`application/x-ndjson`). Omit to negotiate from `Accept`.

Responses

The universe's current members, sorted by instrument. Streamed as a JSON array (`application/json`) or as newline-delimited JSON (`application/x-ndjson`); snapshot metadata is in the `x-universe-*` response headers.

UniverseConstituent

One member of a universe. Only `key` is always present; the other fields are present when the member's source supplies them.