Resources/Both venues·Data engineering

Prediction Market Data Downloads: CSV, Parquet and API Exports

A downloadable dataset is useful only if its format preserves the evidence the analysis needs. Flattening a ladder into one price can make a small file and a dishonest backtest.

By DepthFeed··8 min read

Use CSV for inspection and small flat extracts, Parquet for large columnar research and REST for bounded or incremental queries. Whichever delivery method you choose, keep market identifiers, source and receive timestamps, bid/ask price-size arrays, settlement fields and explicit gaps. The format should change how bytes are delivered, not the meaning of the recorded market.

Choose the delivery path

Sample first. Automate only when the schema fits.

Use Explorer for a bounded inspection, the API for repeatable slices, or an export workflow for larger research jobs. Keep timestamps, identifiers and ladder arrays intact.

JSON
API responses
L2
book depth retained
UTC
epoch timestamps

Match the format to the workload

FormatBest forWatch for
CSVManual inspection and small interoperable samplesNested ladders require a documented encoding or child table
ParquetLarge scans, column pruning and research warehousesSchema evolution and partition keys must be stable
REST JSONBounded queries, applications and incremental pullsPagination, limits and retry semantics
WebSocketCurrent updates and live systemsReconnects, sequence gaps and complete-book seeding

Fields not to lose

  • Venue, event, market and outcome identifiers in their native and normalized forms.
  • Exchange/source time and receive/observation time as separate fields.
  • Bid prices, bid sizes, ask prices and ask sizes at matching array positions.
  • Capture method, interval or event sequence needed to interpret cadence.
  • Settlement outcome and reference values stored without leaking into earlier rows.
  • A stable null or missing convention that never silently becomes zero.

Partition for the questions you actually ask

Large depth archives should be partitioned by high-selectivity fields such as venue and date, then by a stable market or asset key where it matches the workload. A million tiny files can be as costly as one unpartitioned export, so measure the query engine rather than copying a generic lake layout.

Keep a manifest beside bulk exports. It should record schema version, generation time, requested filters, row or observation counts and any incomplete partitions. That manifest turns an opaque download into a reproducible research input.

DepthFeed delivery choices

DepthFeed's regular research path is REST for filtered historical windows and WebSocket for current normalized frames. Desk workflows can use the full archive and columnar delivery patterns for large studies. The browser tools use the same underlying schema, so an idea can move from a sample to a reproducible backtest without redefining the book.

Start with the smallest representative slice: one venue, one market window and enough observations to test parsing, ordering and a sized fill. Scale only after those invariants pass.

Two valid order-book file models

A nested snapshot model stores one observation per row with arrays for bid prices, bid sizes, ask prices and ask sizes. It is compact, preserves book boundaries and maps naturally to Parquet list columns or JSON. The consumer must validate that each price array matches its size array and that the arrays are correctly ordered.

A normalized levels model stores one row per observation, side and price level. It is convenient for SQL aggregation but multiplies row counts and requires a stable observation identifier to reconstruct a complete book. Neither model is universally better; the manifest should state which one is used and how deletions, empty books and partial observations are represented.

CSV schema for a small extract

FieldExample meaningValidation
venuepolymarket or kalshiControlled vocabulary
market_idNative stable market or token keyNon-empty and source-traceable
observed_at_msCollector observation timeInteger epoch milliseconds
source_at_msSource event time when suppliedNever silently substituted
bid_prices / bid_sizesMatching ordered arraysEqual lengths; descending prices
ask_prices / ask_sizesMatching ordered arraysEqual lengths; ascending prices
schema_versionContract for parsing the rowPinned in the file and manifest
coverage_statusobserved, gap or unavailableMissing is not encoded as zero

Parquet layout for analytical workloads

For large historical-depth studies, Parquet usually reduces storage and scan cost because timestamps, identifiers and numeric arrays compress efficiently and query engines can skip unrelated partitions. Partition first by fields that consistently narrow reads, commonly venue and date, then test whether asset or market family improves the real workload.

Avoid encoding every market into its own tiny file. Small-file overhead can dominate query planning and object-store requests. Compact files to a measured target, keep row groups large enough for efficient scans, and publish checksums so a research run can prove exactly which objects it consumed.

Download quality-control checklist

  • Compare manifest row counts with the sum of file or partition counts.
  • Verify checksums before parsing and preserve the original manifest with the research output.
  • Check timestamp monotonicity within each market without assuming all venues share one cadence.
  • Reject mismatched price-size arrays, out-of-range prices and unexplained crossed books.
  • Quantify duplicate observations, empty books, gaps and markets with no settlement mapping.
  • Run a sample depth-walk and reconcile its VWAP against an independent implementation.
  • Pin the schema version and record every transformation applied after download.

When to use a download, REST or WebSocket

Use a bulk download when the study repeatedly scans a large fixed historical range or must run close to the compute engine. Use REST when filters can substantially reduce the payload, when the workflow is exploratory, or when pagination and reproducible requests are more useful than local storage. Use WebSocket for current monitoring and forward collection, not as a substitute for an already retained archive.

Many serious workflows use all three: a versioned historical base in columnar files, REST for targeted refreshes and metadata, and WebSocket for the live tail. The critical design choice is a common identifier and ladder schema so the historical base and live continuation can be joined without rewriting the strategy.

Key takeaways

  • 01CSV, Parquet, REST and WebSocket are delivery choices, not interchangeable data meanings.
  • 02Preserve full price-size ladders and both source and receive timestamps.
  • 03A bulk export needs a schema version and manifest to remain reproducible.
  • 04Explicit nulls and gaps are safer than synthetic zeroes or fills.
  • 05Validate one representative market before scaling a download.

Validate identifiers, timestamps and ladder shape on a small historical slice. Free Explorer tier, no card.

Get a data sampleView pricing

Questions, answered.

CSV is practical for small flat extracts, but full ladders need a documented nested encoding or a separate levels table. For large depth history, a columnar format such as Parquet is usually more efficient.

Start backtesting Polymarket & Kalshi on real depth.

Free to start, no card. Upgrade when your strategy is ready for the full book.

Start free