Extraction guide

Build a product price history

Keep observations without overwriting yesterday's evidence.

01 / INPUTDated product/variant JSON
02 / YOUR WORKFLOWAppend by source + variant + time
03 / OUTPUTComparable observation history

Keep the right fields.

Workflow field map
Build a product price history field map
Field / stepInputRule
Observation keystorefront_id + variant.id + retrieved_atUse strings for identifiers.
Priceamount + currencyStore decimals; preserve the original currency.
Completenessrun completeness + warningsRetain partial and missing-value flags.
Synthetic catalog data · not a retrieval result
02 / Inspect the example
Fictional product variants created for this example
VariantSKUExample priceExample availability
Small / NavyDEMO-TEE-S-NVUSD 32.00Example: available
Medium / NavyDEMO-TEE-M-NVUSD 32.00Example: available
Medium / SandDEMO-TEE-M-SDUSD 34.00Example: unavailable
Large / NavyDEMO-TEE-L-NVUSD 32.00Example: unknown

All names, identifiers, prices and availability values are fictional. They do not describe a merchant’s catalog or inventory.

Store observations, not just the latest price.

Keep a source namespace, stable variant identity and retrieval timestamp in every row. Re-importing the same observation must not create a second measurement.

Scroll to compare →

Store observations, not just the latest price.
KeepRecordDecision
Primary keyStorefront + product ID + variant ID + retrieval timeA retry of the same saved result becomes a no-op.
Price representationSource decimal text + ISO currencyAvoid binary floating-point storage; use decimal arithmetic for calculations.
Comparison basisMarket + pack + condition + seller where applicableAdd these fields when adapting the recipe to marketplace offers.
EvidenceSource URL + completeness + warning JSONRetain the original export alongside the normalized observation table.
HistoryAppend a newly retrieved observationDo not overwrite yesterday's record when today's value is unchanged.

Run the synthetic price-history exercise.

Download the Python recipe and the two fictional JSON records below into one folder. The product, merchant URL, timestamps and prices are invented to demonstrate the import and comparison rules. The recipe uses Python’s standard SQLite and decimal libraries; no API key or live request is needed.

Example
python price-history.py history.sqlite price-history-example-first.json price-history-example-later.json

One price changes; three stay the same.

In this fictional exercise, Small / Navy changes from 32.00 to 34.00 USD between two invented timestamps. The other three prices stay the same. An unchanged price still produces a new observation, while re-importing either file must not duplicate it.

Scroll to compare →

One price changes; three stay the same.
VariantFirst observationLater observation
Small / Navy32.00 USD34.00 USD · change +2.00
Medium / Navy32.00 USD32.00 USD · unchanged
Medium / Sand34.00 USD34.00 USD · unchanged
Large / Navy32.00 USD32.00 USD · unchanged

Extend the recipe deliberately.

The illustration uses one fictional merchant and a stable option tuple. Marketplace offers need additional identity and delivery fields before comparisons are meaningful.

Scroll to compare →

Extend the recipe deliberately.
KeepRecordDecision
Collection scheduleYour scheduler starts a bounded extractionSave the run ID before yielding and keep a spending ceiling.
Result retentionRetrieve all result pages, then persist your own copyThe extraction service is not a permanent historical-price archive.
CorrectionsKeep the original observation and append a correction recordDo not silently edit raw evidence after downstream decisions use it.
Currency conversionSeparate rate, source and effective dateKeep the original price unchanged; do not mix conversions into raw history.

Content reviewed 2026-10-07.

Before you use the output

Schedule collection in your application. A saved extraction does not create recurring monitoring. Compare the same variant, market and currency before calculating a change.

Check one record first.

Start with the smallest useful scope. Compare the returned record with its source, confirm variant identity and inspect missing fields before applying the mapping to a larger dataset.

Keep extraction warnings and the retrieval timestamp with downstream output. When a required field is missing, leave it unresolved or return to the source; do not fill it from an assumption.

Continue this workflow