Skip to content

Common patterns

The examples below use cURL. The API reference documents each route's parameters, statuses and schemas.

Waiting for a Run

Runs are asynchronous. Poll until finished is true, then read status for the outcome: completed, stopped, or failed. The Run's PDPs are saved while it runs, so you can read them before it finishes. A materializing Run was interrupted before its analytics were complete: it has saved every PDP, and its analytics are being finished.

To be told when a Run finishes instead of polling, register a webhook.

# Repeat with a delay until `finished` is true.
curl -s "https://api.extralt.com/v1/runs/$RUN_ID" \
  -H "Authorization: Bearer $EXTRALT_API_KEY" | jq '{finished, status}'

Syncing finished Runs

To pick up every Run that finished since your last sync, pass finished_since to GET /v1/runs. The list then holds only finished Runs, oldest finish first, with finished_at at or after that time. Save the last finished_at you processed and pass it next time; the bound is inclusive, so deduplicate on id. A Run that is restarted is unfinished again and reappears when it next finishes.

curl -s "https://api.extralt.com/v1/runs" \
  --url-query "finished_since=2026-01-31T00:00:00Z" \
  -H "Authorization: Bearer $EXTRALT_API_KEY" \
  | jq '.data[] | {id, status, finished_at}'

Pagination

Routes that page return next_cursor. Pass a non-null next_cursor as the cursor query parameter for the next page; null means the last page.

# Pass the previous page's next_cursor until it is null.
curl -s "https://api.extralt.com/v1/pdps" \
  --url-query "run_id=$RUN_ID" --url-query "cursor=$NEXT_CURSOR" \
  -H "Authorization: Bearer $EXTRALT_API_KEY" \
  | jq '{next_cursor, count: (.data | length)}'

Treat cursors as opaque. Do not decode, construct, or replace one with a resource id. Keep the same route, filters, and sort across pages; the next request may choose a different valid limit. A cursor used with another route or changed filters returns 400.

Pagination reads live data rather than holding a database transaction across HTTP requests. On unchanged data, cursors traverse deterministically. Rows written between requests can affect the remaining pages, so start again without a cursor when you need a fresh traversal.

Each route's default and maximum page size is in Page sizes.

Time windows

Every point in time, in requests and responses, is an RFC 3339 timestamp such as 2026-01-31T00:00:00Z. Explore routes take their time window in different ways:

RouteWindowLongest
GET /v1/changeswindow: 1h, 1d, 1w or 1m (30 days), ending at to. to is exclusive and defaults to now30 days
GET /v1/activity, /v1/activity/eventsFrom from to to. to is exclusive and defaults to now90 days
GET /v1/analyses/price-movements, /availability-changesfrom only; the window always ends now90 days
GET /v1/analyses/price-position, /assortment-overlapNo window: they compare current prices and assortment
GET /v1/variants/{id}/history, /price-seriesfrom and to, both required; to is exclusive366 days

GET /v1/activity also returns at most 400 buckets, so a long window needs a coarser bucket.

When you page through GET /v1/changes, pass the to the first page returned with every later page, so the window stays fixed. A Change keeps the time it was observed, so one written later can land in a window you already read: re-read overlapping windows and deduplicate on id. See Changes.

Bulk PDP export

Use the PDP export route instead of paginating when you need all PDPs of one Run or Import as JSONL or Parquet. Stream the response to disk rather than loading the entire file in memory. See PDPs.