List events
/scripts/{slug}/eventsReturns a definition's stored events, oldest first, filtered by instrument, timeframe, event, time, version and payload. These are the events studies read, from every time the definition ran over history in the app or the API.
Scope | Heavy call | Long poll | CLI |
|---|---|---|---|
| No | No |
|
Guidance
Stored events come only from running the definition over history. A run of a definition returns that run's events and stores nothing here. If a list comes back empty, check Summarise events and Run a definition over history for the instrument and timeframe you want.
totalcounts every event that matches the filters, across every page. Read it first to decide whether to page through everything.Filter on the server rather than in your code:
wheretakes up to 10 payload filters, and an event must match all of them.[{"key":"range","op":"gt","value":10}]keeps events whoserangeis above 10.Pass
versionto see only what one version found. Without it, events from every version come back together.A CSV answer carries no
next_cursor. To page CSV, pass the number of rows already read ascursor, and stop at a page shorter thanlimit.The path is your own definition's bare slug. A
@Nsuffix is accepted and ignored, and a study that shares the slug is ignored here.
Path parameters
Name | Type | Description |
|---|---|---|
| string | Your definition's slug |
Query parameters
Name | Type | Required | Default | Description |
|---|---|---|---|---|
| string | No | All | Canonical or short symbol |
| string | No | All | One of the timeframes |
| string | No | All | A declared event id |
| string | No | None | RFC 3339. Keeps events that start at or after it |
| string | No | None | RFC 3339. Keeps events that end at or before it |
| integer | No | All | Keeps events found by this version of the definition |
| string | No | None | Payload filters as a JSON array, URL-encoded. Fields below |
| string | No |
|
|
| integer | No | 100 | Most 1,000 |
| string | No | None | From the previous page's |
where filter object
Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | A payload key: letters, digits, |
| string | Yes |
|
| any | For every op but | The value to compare with. The lower bound for |
| any | For | The upper bound |
Response
200 with:
Field | Type | Description |
|---|---|---|
| array of Event | This page of events |
| integer | How many events match the filters, across every page |
| string or null | Pass it back as |
With format=csv, the answer is text/csv with a header row event,intent,instrument,timeframe,start,end,bar_index,payload and one row per event on this page. payload is a JSON string.
Status codes
Status | Code | Meaning |
|---|---|---|
| - | A page of events. |
|
| The slug is not valid, |
|
| No instrument matches |
|
|
|
|
| You have no definition with that slug, or it has no such |
