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 locallyuv run pylint src– static analysisuv run mypy --config-file mypy.toml src– type checking
Releasing
- Update the version in both
pyproject.tomlandsrc/pm_api_fetcher/__init__.py. - Run the local gates before tagging:
uv run pytest uv build
- Create an annotated tag that matches the new version (e.g.
git tag -a v0.3.0 -m "v0.3.0"), then push it withgit push origin v0.3.0. - Push
git push origin release-v0.3.0. The GitHub Actionci-cdwill re-run tests, build the wheel/sdist, and automatically upload to PyPI via Trusted Publisher (OIDC).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35410105806ec8daa7f2b016e4a8e0fd6db291e63e257540bb7916fc359e16c1
|
|
| MD5 |
ced6f99918be6fa57fc887d2fcbf1fa0
|
|
| BLAKE2b-256 |
12e9996d565271587e35db9f1f9adad5acd8a6c1ac8799b3ed5aa604b634b0d5
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pm_api_fetcher-0.3.0.tar.gz -
Subject digest:
35410105806ec8daa7f2b016e4a8e0fd6db291e63e257540bb7916fc359e16c1 - Sigstore transparency entry: 708764859
- Sigstore integration time:
-
Permalink:
hz-cyberspace/pm-api-fetcher@403c64421dea49bf686639f95eb471b1455287ab -
Branch / Tag:
refs/tags/release-v0.3.0 - Owner: https://github.com/hz-cyberspace
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@403c64421dea49bf686639f95eb471b1455287ab -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81ce34f65e11d45b9db0c2ef83c5203f430467bc833ed2d9c8d8b3a2458d6a15
|
|
| MD5 |
4538ff3c0cf362d64280363e1f1e1217
|
|
| BLAKE2b-256 |
dd9ac73c8360a354514fbfa19a1bda380f62c8faf4541b4b4789c8d52a22057f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pm_api_fetcher-0.3.0-py3-none-any.whl -
Subject digest:
81ce34f65e11d45b9db0c2ef83c5203f430467bc833ed2d9c8d8b3a2458d6a15 - Sigstore transparency entry: 708764865
- Sigstore integration time:
-
Permalink:
hz-cyberspace/pm-api-fetcher@403c64421dea49bf686639f95eb471b1455287ab -
Branch / Tag:
refs/tags/release-v0.3.0 - Owner: https://github.com/hz-cyberspace
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@403c64421dea49bf686639f95eb471b1455287ab -
Trigger Event:
push
-
Statement type: