You can export Polymarket market data in Python without scraping the website: use Polymarket’s official polymarket-client SDK and its public market-data workflow. First identify the specific market and outcome token, then retrieve the price, book or activity data you need and save timestamped, clearly labeled rows to CSV. Public discovery and market-data reads do not require wallet credentials.
Use the current official Python SDK
Polymarket describes polymarket-client as its “Official Python SDK for Polymarket.” For a small scheduled export, its synchronous PublicClient is the straightforward starting point; use AsyncPublicClient if you are gathering many markets concurrently or integrating with an asynchronous application. Install the package with:
python -m pip install polymarket-client
For a repeatable project, pin the package version in your dependency file and check the current SDK documentation or repository for the exact method signatures. SDK interfaces can change, so do not assume an older tutorial still matches the current client.
Avoid the archived legacy client
Polymarket’s py-clob-client repository was archived on May 25, 2026. Its maintenance notice says: “The client is no longer functional and should not be used for new or existing integrations.” Use the unified SDK rather than starting a new integration with that legacy library.
Recommended Free Tools
#1 Best Overall
Find the market and the outcome token
Polymarket separates event discovery from market data. An event may contain one or several markets; a market is a tradable question, and each outcome has its own token ID. For a two-outcome market, YES and NO therefore have separate IDs. Price and order-book requests need the token ID for the outcome you intend to export.
Use the SDK’s public discovery functions to look up a known event or market by ID, slug or Polymarket URL, or to list and filter public events and markets. Gamma API examples in Polymarket’s documentation cover event and market discovery; CLOB market-data examples cover prices, books and related data. Keep those roles distinct. A multi-market event is not interchangeable with one of its individual questions: select the specific market, then the outcome token.
Rank #2
- Install
polymarket-clientand create aPublicClientusing the current official SDK interface. - Use public event or market discovery to find the event and individual market you want.
- Inspect that market’s outcomes and record the token ID for each outcome you plan to query.
- Request prices, order-book data and any relevant activity or volume fields for the selected market or token.
- Normalize the returned objects into rows with identifiers, outcome labels and a retrieval timestamp before writing them to CSV.
This read-only workflow does not call for a wallet private key. Do not add account credentials just to retrieve public market data.
Choose what “odds” means before exporting
A token price is a current traded quote for that outcome, not a permanent forecast. Different price fields answer different questions, so label the measure you export rather than calling every figure simply “odds.” Polymarket’s documentation distinguishes price reads and order-book measures including midpoint and spread.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Last trade: a price at which a trade occurred; it may not match the quotes available now.
- Best bid: the highest displayed price buyers are currently offering.
- Best ask: the lowest displayed price sellers are currently asking.
- Midpoint: the midpoint measure returned or calculated from the relevant bid and ask; it is not itself necessarily a traded price.
- Spread: best ask minus best bid, as defined in Polymarket’s documentation.
Each API read is a point-in-time snapshot and may be stale as soon as it is retrieved. Include a UTC retrieval time, market identity, token ID, outcome label and metric name so a row cannot be mistaken for an undated or timeless probability.
Export order-book depth without losing its structure
An order book contains resting bids and asks, each represented by a price-size level. Polymarket’s documentation says bids are ordered ascending and asks descending; accordingly, the best quote is the final entry in each corresponding array. The response also includes state metadata such as a hash, which can be compared with the prior response to check whether the book changed.
For a full-depth export, use one row per level in a separate long-form CSV. Preserve the side and level number so bids and asks remain distinguishable after flattening. If you keep only best bid and best ask, or calculate a spread, name that reduction explicitly; do not present it as the full book.
| CSV | Useful columns | Purpose |
|---|---|---|
| Quote snapshot | retrieved_at_utc, event_id, market_id, market_slug, condition_id when available, token_id, outcome, metric, price |
One row per outcome and selected quote metric at a retrieval time. |
| Book levels | retrieved_at_utc, market_id, token_id, outcome, side, level, price, size |
One row per bid or ask level, retaining the book’s visible depth. |
These are practical CSV layouts, not schemas mandated by Polymarket. Retain any available condition ID and the book hash in your own export if they help identify or compare snapshots.
Best Value
Define volume and activity precisely
“Volume” can refer to a market-level published volume measure or to a total you calculate from matched trades. Those are not automatically the same figure. Label which source field or aggregation rule you used, its units, time window and whether it describes one market or a broader event.
Polymarket’s analytics documentation describes recent matched-trade records with fields including side, price, size, outcome, wallet and timestamp, sorted newest first. A list of recent trades is not a precomputed volume total. If you calculate a total from trades, state the filtering window and aggregation rule, and retain the original records or enough logic to reproduce it. Include a retrieval timestamp for the resulting data.
Write normalized rows with Python’s CSV module
Once you have mapped the SDK responses into plain dictionaries, Python’s standard csv module can write them without adding a dataframe dependency. This example handles the export step; populate quote_rows and book_rows from the current SDK responses and your chosen normalization rules.
import csv
quote_fields = [
"retrieved_at_utc", "event_id", "market_id", "market_slug",
"condition_id", "token_id", "outcome", "metric", "price",
"volume_value", "volume_unit", "volume_window",
]
book_fields = [
"retrieved_at_utc", "market_id", "token_id", "outcome",
"side", "level", "price", "size",
]
with open("polymarket_quotes.csv", "w", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=quote_fields, extrasaction="ignore")
writer.writeheader()
writer.writerows(quote_rows)
with open("polymarket_order_book.csv", "w", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=book_fields, extrasaction="ignore")
writer.writeheader()
writer.writerows(book_rows)
Use a consistent UTC timestamp format, such as an ISO 8601 timestamp ending in Z. If a field is unavailable for a row, represent that explicitly in your data-handling policy rather than silently substituting a different measure. Keep event and market scope consistent when comparing outcomes, and compare the same price metric and retrieval window.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCheck these details before comparing exports
- Are you comparing the same or equivalent market question, rather than one market against an event-wide aggregate?
- Do the rows refer to the same outcome side and the intended token IDs?
- Are price metrics consistent—for example, midpoint versus midpoint rather than midpoint versus last trade?
- For books, are spread and visible depth being compared at stated levels and snapshot times?
- For volume, are the source, units, market scope and aggregation period identical?
Polymarket’s official market-data documentation and SDK guidance were accessed on October 4, 2026. Its retrieved documentation pages did not state publication dates, so verify current SDK method names and API fields against the official documentation before relying on an integration. No live end-to-end execution is established here.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




