{"id":48636671,"url":"https://github.com/sigma-quantiphi/polymarket-pandas","last_synced_at":"2026-04-29T21:00:55.788Z","repository":{"id":321010681,"uuid":"1076151031","full_name":"sigma-quantiphi/polymarket-pandas","owner":"sigma-quantiphi","description":"Python SDK for Polymarket — every endpoint returns a pandas DataFrame. Sync + async HTTP, WebSockets, pandera schemas, order building \u0026 signing, on-chain CTF operations.","archived":false,"fork":false,"pushed_at":"2026-04-29T14:28:21.000Z","size":1602,"stargazers_count":2,"open_issues_count":9,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-29T15:40:00.758Z","etag":null,"topics":["api-client","async","betting","cryptocurrency","dataframe","defi","pandas","pandera","polygon","polymarket","prediction-markets","python","sdk","trading","websocket"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sigma-quantiphi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-14T13:23:26.000Z","updated_at":"2026-04-29T14:34:39.000Z","dependencies_parsed_at":"2025-10-27T10:14:57.165Z","dependency_job_id":"e2fe9c0c-ea93-4eb0-858c-978b11e5513c","html_url":"https://github.com/sigma-quantiphi/polymarket-pandas","commit_stats":null,"previous_names":["sigma-quantiphi/polymarket-pandas"],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/sigma-quantiphi/polymarket-pandas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigma-quantiphi%2Fpolymarket-pandas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigma-quantiphi%2Fpolymarket-pandas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigma-quantiphi%2Fpolymarket-pandas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigma-quantiphi%2Fpolymarket-pandas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sigma-quantiphi","download_url":"https://codeload.github.com/sigma-quantiphi/polymarket-pandas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigma-quantiphi%2Fpolymarket-pandas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32443576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","async","betting","cryptocurrency","dataframe","defi","pandas","pandera","polygon","polymarket","prediction-markets","python","sdk","trading","websocket"],"created_at":"2026-04-09T12:00:55.307Z","updated_at":"2026-04-29T21:00:55.777Z","avatar_url":"https://github.com/sigma-quantiphi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# polymarket-pandas\n\n[![PyPI](https://img.shields.io/pypi/v/polymarket-pandas)](https://pypi.org/project/polymarket-pandas/)\n[![Python](https://img.shields.io/pypi/pyversions/polymarket-pandas)](https://pypi.org/project/polymarket-pandas/)\n[![Downloads](https://img.shields.io/pypi/dm/polymarket-pandas)](https://pypistats.org/packages/polymarket-pandas)\n[![License](https://img.shields.io/pypi/l/polymarket-pandas)](https://github.com/sigma-quantiphi/polymarket-pandas/blob/main/LICENSE)\n[![CI](https://github.com/sigma-quantiphi/polymarket-pandas/actions/workflows/ci.yml/badge.svg)](https://github.com/sigma-quantiphi/polymarket-pandas/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/sigma-quantiphi/polymarket-pandas/branch/main/graph/badge.svg)](https://codecov.io/gh/sigma-quantiphi/polymarket-pandas)\n[![Code style: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Docs](https://img.shields.io/badge/docs-mkdocs-blue)](https://sigma-quantiphi.github.io/polymarket-pandas/)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/sigma-quantiphi/polymarket-pandas/main?labpath=notebooks%2F01_getting_started.ipynb)\n\nPandas-native Python client for the full [Polymarket](https://polymarket.com) API surface — REST, WebSocket, Relayer, and Bridge — with automatic type coercion and DataFrame output.\n\n**[Documentation](https://sigma-quantiphi.github.io/polymarket-pandas/)** | **[Getting Started](https://sigma-quantiphi.github.io/polymarket-pandas/getting-started/)** | **[API Reference](https://sigma-quantiphi.github.io/polymarket-pandas/api/markets/)** | **[Notebooks](https://mybinder.org/v2/gh/sigma-quantiphi/polymarket-pandas/main?labpath=notebooks%2F01_getting_started.ipynb)** | **[Changelog](https://sigma-quantiphi.github.io/polymarket-pandas/changelog/)**\n\n---\n\n## Features\n\n- **102 public methods** across 9 API mixins (Gamma, CLOB, Data, Rewards, Bridge, Relayer, CTF, XTracker)\n- **Every endpoint returns a `pd.DataFrame`** with automatic type coercion (datetimes, numerics, booleans)\n- **Sync + Async** HTTP clients — `PolymarketPandas` and `AsyncPolymarketPandas`\n- **WebSocket streaming** — real-time orderbook, prices, trades, sports, crypto feeds\n- **pandera schemas** for column documentation and optional runtime validation\n- **TypedDicts** for dict-returning endpoints with full IDE autocomplete\n- **Order building \u0026 EIP-712 signing** — `build_order`, `place_order`, `submit_orders` (DataFrame batch)\n- **On-chain CTF operations** — merge, split, redeem positions via web3\n- **Title parsers** — extract bracket bounds, directional thresholds, and sports lines from market titles\n- **Auto-pagination** — offset-based and cursor-based `_all()` methods\n- **Interactive Streamlit explorer** with 11 pages and Plotly charts\n- **MCP server** with 74 tools for Claude Code / Claude Desktop\n\n---\n\n## Installation\n\n```bash\npip install polymarket-pandas\n```\n\nOptional extras:\n\n```bash\npip install \"polymarket-pandas[ctf]\"       # on-chain merge/split/redeem (web3)\npip install \"polymarket-pandas[explorer]\"   # Streamlit dashboard (11 pages)\npip install \"polymarket-pandas[mcp]\"        # MCP server (74 tools)\n```\n\n---\n\n## Quick Start\n\n```python\nfrom polymarket_pandas import PolymarketPandas\n\nclient = PolymarketPandas()\n\n# Get active markets sorted by volume\nmarkets = client.get_markets(closed=False, order=\"volume24hr\", ascending=False, limit=20)\nprint(markets[[\"slug\", \"question\", \"volume24hr\", \"endDate\"]])\n\n# Orderbook for a token\ntoken_id = markets[\"clobTokenIds\"].iloc[0]\nbook = client.get_orderbook(token_id)\n\n# Price history\nprices = client.get_price_history(market=token_id, interval=\"1d\", fidelity=60)\n```\n\nSee the [Getting Started](https://sigma-quantiphi.github.io/polymarket-pandas/getting-started/) guide for a complete walkthrough.\n\n---\n\n## MCP Server\n\nQuery Polymarket data from any MCP client with 74 tools covering the full API surface.\n\n```bash\npolymarket-mcp           # stdio transport\npolymarket-mcp --sse     # SSE transport\n```\n\nAdd to Claude Code / Claude Desktop (`~/.claude/settings.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"polymarket\": {\n      \"command\": \"polymarket-mcp\"\n    }\n  }\n}\n```\n\nSee the [MCP Server guide](https://sigma-quantiphi.github.io/polymarket-pandas/guides/mcp-server/) for the full list of 74 tools and environment variables.\n\n---\n\n## Interactive Explorer\n\n```bash\npip install \"polymarket-pandas[explorer]\"\npolymarket-explore\n```\n\n11 pages covering Markets, Events, Series, Tags, Orderbook, Prices, Positions, Trades, Leaderboard, Rewards, and Bridge. Each page shows the raw DataFrame, an interactive Plotly chart, and the equivalent Python code.\n\n---\n\n## Configuration\n\nAll credentials are read from environment variables (or a `.env` file). No auth needed for public endpoints.\n\n```bash\nexport POLYMARKET_ADDRESS=0xYourProxyWallet\nexport POLYMARKET_API_KEY=your-api-key\nexport POLYMARKET_API_SECRET=your-secret\nexport POLYMARKET_API_PASSPHRASE=your-passphrase\n```\n\nOr derive API keys from your private key:\n\n```python\nclient = PolymarketPandas(private_key=\"0xYourKey\")\ncreds = client.derive_api_key()  # auto-sets L2 credentials\n```\n\nSee the [Configuration guide](https://sigma-quantiphi.github.io/polymarket-pandas/guides/configuration/) for all environment variables and authentication layers.\n\n---\n\n## Examples\n\n| Script | Description |\n|--------|-------------|\n| [`btc_5min.py`](examples/btc_5min.py) | Find BTC 5-min market, fetch orderbook and prices |\n| [`btc_5min_trade_merge.py`](examples/btc_5min_trade_merge.py) | Full trading flow: `submit_orders`, cancel, merge |\n| [`rewards_overview.py`](examples/rewards_overview.py) | All 7 CLOB rewards endpoints |\n| [`xtracker_overview.py`](examples/xtracker_overview.py) | All 7 XTracker endpoints |\n| [`market_structures.py`](examples/market_structures.py) | Event structures + title parsers demo |\n| [`post_only_buy.py`](examples/post_only_buy.py) | Post-only order example |\n| [`rtds_ws.py`](examples/rtds_ws.py) | Real-Time Data Streams via WebSocket |\n| [`user_ws.py`](examples/user_ws.py) | Private user channel — live order and trade events |\n\n---\n\n## Stability\n\nSee [STABILITY.md](STABILITY.md) for the semver commitment and deprecation policy. In short: symbols are deprecated for at least one minor release before removal, via `@typing_extensions.deprecated` (which IDEs and `DeprecationWarning` both surface).\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md). TL;DR: `uv sync --all-extras \u0026\u0026 uv run pre-commit install`, then the same `pytest` / `ruff` / `mypy` commands CI runs.\n\n## Security\n\nSee [SECURITY.md](SECURITY.md). Report vulnerabilities privately via [GitHub security advisories](https://github.com/sigma-quantiphi/polymarket-pandas/security/advisories/new).\n\n## License\n\nApache-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigma-quantiphi%2Fpolymarket-pandas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigma-quantiphi%2Fpolymarket-pandas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigma-quantiphi%2Fpolymarket-pandas/lists"}