Skip to content

add order history download script#137

Open
bigrosss wants to merge 1 commit intoPolymarket:mainfrom
bigrosss:scripts/download-order-history
Open

add order history download script#137
bigrosss wants to merge 1 commit intoPolymarket:mainfrom
bigrosss:scripts/download-order-history

Conversation

@bigrosss
Copy link

@bigrosss bigrosss commented Jan 6, 2026

Adds a script to fetch all orders via the API and write them to a JSON file, allowing users to archive their trading history.


Note

Adds a new script to export full order history

  • New scripts/python/download_order_history.py uses Polymarket().get_all_orders() to fetch orders and writes [o.as_dict()] to data/order_history_download.json
  • Ensures output directory exists and prints a summary count
  • Requires API credentials via environment

Written by Cursor Bugbot for commit 48e7668. This will update automatically on new commits. Configure here.

Adds a script to fetch all orders via the API and write them to a JSON file, allowing users to archive their trading history.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to Polymarket Agents. Thank you for creating your first PR. Cheers!


def main() -> None:
client = Polymarket()
orders = client.get_all_orders() # type: ignore
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Script calls nonexistent get_all_orders method

The script calls client.get_all_orders() on the Polymarket instance, but this method does not exist in the Polymarket class. The Polymarket class has methods like get_all_markets() and get_all_events(), but no get_all_orders() method was ever implemented. The # type: ignore comment suppresses the type checker warning that would have caught this, so the script will crash at runtime with an AttributeError.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant