Sync your data
This workflow moves your data into your own systems: a warehouse, a data pipeline or an application. Pick the grain you need:
PDPs are the record of your reads: one per product page read, kept as it was read. The rest is the model written from them, kept current. See the Data model for how they relate.
Export each finished Run
When a Run finishes, export its PDPs in one file, Parquet or JSON Lines, rather than paging through them.
-
Subscribe a webhook to
run.completed,run.stoppedandrun.failed, since a Run that stopped or failed keeps the PDPs it saved. Or pollGET /v1/runs?finished_since=with the last finish time you processed (see Syncing finished Runs). -
Download the Run's PDPs:
-
Load the file. Its columns are the PDP fields, with SKUs and their offers nested:
Each PDP's id is unique within your organization and orders PDPs by time, so
it is the key to load on. A stopped or failed Run you restart finishes again,
and its export then holds the PDPs of every execution: loaded by id, the
second file adds only the new ones.
A webhook is delivered at least once and in no guaranteed order: deduplicate
on the event's id, and read the Run before acting on it. Answer within 10
seconds and do the export afterwards, for example from a queue.
Read the current state
The model holds what each store sells and charges now, as of its latest read.
GET /v1/marketslists the Variants of a country with each one's lowest, median and highest price across your Stores, one category, brand or Store at a time. Page withcursoruntilnext_cursorisnull.GET /v1/variants/{variant_id}/offerslists one Variant's current offers, Store by Store.GET /v1/storesreturns each Store's current Listings, offers and cheapest share.
"Current" means each Store's latest read, not a synchronized snapshot: each
row carries latest_observed_at. See Products.
Follow Changes
GET /v1/changes lists the Changes observed in a window, newest first, each
with a stable id. To follow them as a feed:
- Read a window that ends at a fixed
to, and page withcursoruntilnext_cursorisnull, keepingtoand every filter unchanged. - Next time, read a window that overlaps the last one, and skip the Changes
whose
idyou already have.
A Change keeps the time its read observed it, and is written a little after, so one can land in a window you already read: the overlap catches it. Changes are never retracted.
The run.changes and import.changes webhooks tell you when a Run or Import
found price, stock or catalog Changes, so you read only then. See
Changes.
Keep it efficient
- Use a read-only API key for a sync that only reads.
- Prefer exports and server-side filters to paging through everything.
- Space out polling, or use webhooks: see Rate limits.
- Reading your data never uses credits.