Urgent.News

What's breaking now, across thousands of outlets.

Tech

Polymarket API in Python - odds, volume and order books to CSV without writing a scraper

Polymarket prices are probabilities: a YES share at $0.69 means the market gives the event about a 69% chance. That makes them handy for dashboards, newsletters, research and model features. Polymarket's own APIs are public and free: the Gamma API for markets and events, the CLOB API for order books and price history, and a Data API for trades. If you're writing a trading bot, use them directly.…

Polymarket offers probabilities for events as odds, which can be used in various applications such as dashboards, newsletters, research, and model features. They provide APIs for markets, events, order books, and price history, as well as trades data. When fetching data directly from the APIs, outcomes, outcomePrices, and clobTokenIds are returned as JSON strings nested within JSON and require an additional parsing step.

The endpoint limits the number of markets per page to 100, necessitating pagination. There is no server-side search functionality on /markets, and sorting top markets by volume through /events does not yield market rankings but rather events, causing small side-markets of popular events to potentially appear higher in the list. The API consolidates data into a single record per market, making it easier to import into a CSV file.

The required Python libraries include csv, os, and requests. After running the script, a CSV file named polymarket.csv is generated, containing fields such as question, yes_probability, volume_24h, liquidity, closes, and url. For instance, on 2026-09-18, the CSV includes entries like "Will the price of Bitcoin be above $76,000 on September 18?" with a 98.9% yes probability, "Will the price of Bitcoin be above $72,000 on September 18?" with a 100% yes probability, and "Will Bitcoin reach $80,000 in September?" without specifying search criteria, resulting in the 100 most traded open markets sorted by 24-hour volume.

Each record in the CSV includes details like the question, outcomes (names and their respective prices and implied probabilities), yesPrice and noPrice, impliedProbability, volume, volume_24h, liquidity, bestBid and bestAsk, spread, lastTradePrice, closeTime, status, result, eventTitle, and tags.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

CNPJ alfanumérico: o que muda no seu sistema e como validar o dígito

Desde 2026 a Receita Federal emite CNPJs alfanuméricos. As oito posições da raiz e as quatro da ordem podem conter letras e dígitos. Os dois dígitos verificadores continuam numéricos.

  • CNPJs alfanuméricos will be issued by Receita Federal starting 2026
  • Both numeric and alphanumeric formats are valid
  • Digits verification follows Módulo 11 rule with two passes

OWC's Best Mac Accessories Are on Sale Just for MacRumors Readers

MacRumors has partnered with OWC to bring our readers big savings on the retailer's best Thunderbolt docks, USB-C cables, and external storage enclosures. These exclusive deals will run through September 30 at 12:00 a.m. CST, so you have just over a week to shop. Note: MacRumors is an affiliate partner with OWC.

More from Monday 21 September →