Skip to main content

Helpers for exporting Polymarket series data

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

pm-api-fetcher

Focused helpers for downloading Polymarket series data and exporting the open events/markets to JSON so they can be consumed elsewhere.

Features

  • Fetch Event Summary: Get active markets and token IDs for a specific event by slug (get_event_summary_with_slug).
  • Fetch Series Events: Retrieve all open events and their markets for a Polymarket series (get_series_open_events_with_id).

Quickstart

cd pm-api-fetcher
uv sync --group dev
uv run pytest

Usage

Fetch Event Summary by Slug

Fetch a single event and its active markets using its slug.

from pm_api_fetcher import get_event_summary_with_slug

slug = "democratic-presidential-nominee-2028"
summary = get_event_summary_with_slug(slug)

print(f"Event: {summary['event_id']}")
for market in summary['markets']:
    print(f"- {market['question']} (Yes: {market['yes_token']})")

Fetch All Open Events in a Series

Fetch all active events and markets for a given series ID.

from pm_api_fetcher import get_series_open_events_with_id

# Series 35 is typically the main series
events = get_series_open_events_with_id(series_id=35)

for event in events:
    print(f"Event: {event['title']}")
    print(f"Active Markets: {len(event['markets'])}")

Tooling

  • uv run pre-commit install – enable the linting pipeline locally
  • uv run pylint src – static analysis
  • uv run mypy --config-file mypy.toml src – type checking

Releasing

  1. Update the version in both pyproject.toml and src/pm_api_fetcher/__init__.py.
  2. Run the local gates before tagging:
    uv run pytest
    uv build
    
  3. Create an annotated tag that matches the new version (e.g. git tag -a v0.3.0 -m "v0.3.0"), then push it with git push origin v0.3.0.
  4. Push git push origin release-v0.3.0. The GitHub Action ci-cd will re-run tests, build the wheel/sdist, and automatically upload to PyPI via Trusted Publisher (OIDC).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pm_api_fetcher-0.3.0.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pm_api_fetcher-0.3.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file pm_api_fetcher-0.3.0.tar.gz.

File metadata

  • Download URL: pm_api_fetcher-0.3.0.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pm_api_fetcher-0.3.0.tar.gz
Algorithm Hash digest
SHA256 35410105806ec8daa7f2b016e4a8e0fd6db291e63e257540bb7916fc359e16c1
MD5 ced6f99918be6fa57fc887d2fcbf1fa0
BLAKE2b-256 12e9996d565271587e35db9f1f9adad5acd8a6c1ac8799b3ed5aa604b634b0d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pm_api_fetcher-0.3.0.tar.gz:

Publisher: release.yml on hz-cyberspace/pm-api-fetcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pm_api_fetcher-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pm_api_fetcher-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pm_api_fetcher-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81ce34f65e11d45b9db0c2ef83c5203f430467bc833ed2d9c8d8b3a2458d6a15
MD5 4538ff3c0cf362d64280363e1f1e1217
BLAKE2b-256 dd9ac73c8360a354514fbfa19a1bda380f62c8faf4541b4b4789c8d52a22057f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pm_api_fetcher-0.3.0-py3-none-any.whl:

Publisher: release.yml on hz-cyberspace/pm-api-fetcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page