Skip to content

harish-garg/Polymarket-Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Polymarket Scripts

A collection of Python scripts for interacting with Polymarket's API to fetch market data, comments, and other information.

Prerequisites

  • Python 3.7 or higher
  • requests library

Installation

  1. Clone or download this repository

  2. Install required dependencies:

pip install requests

Scripts

1. Get Polymarket Market Comments

File: get-polymarket-market-comments.py

Fetches all comments from a Polymarket event and saves them to JSON files.

Usage:

python get-polymarket-market-comments.py <polymarket_url>

Example:

python get-polymarket-market-comments.py https://polymarket.com/event/will-trump-release-epstein-files-by?tid=1765631877125

What it does:

  • Extracts the event slug from the provided URL
  • Fetches event metadata and all associated markets
  • Retrieves all comments from the event (with pagination)
  • Displays the first 20 comments in the console
  • Saves all comments to a JSON file named {slug}_event_comments.json
  • If specific markets are found (e.g., "December 19"), fetches and saves those separately

Output files: All output files are saved to the output/ directory:

  • output/{slug}_event_comments.json - All comments for the entire event
  • output/{slug}_dec19_comments.json - Comments for specific market (if found)

More Scripts Coming Soon

This repository will be expanded with additional scripts for:

  • Market data analysis
  • Price tracking
  • Trading history
  • And more...

API Reference

These scripts use Polymarket's Gamma API:

  • Base URL: https://gamma-api.polymarket.com
  • Endpoints used:
    • /events - Get event and market information
    • /comments - Get comments for events and markets

Contributing

Feel free to add more scripts to interact with Polymarket's API. Follow the existing code structure and update this README with new scripts.

License

This project is open source and available for personal use.

About

Misc. Scripts for interacting with Polymarket

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages