Polymarket Scraper
Welcome Mac User!
This guide will walk you through installing and running the Polymarket Scraper on macOS. Follow each step carefully, and you'll be searching markets in no time.
Time needed: About 15-20 minutes
What You'll Need
- A Mac computer (macOS 10.13 or newer)
- Internet connection
- Administrator password (you'll need it for installation)
- The polymarket1.py file (the code you were given)
Step 1: Install Python
Python is the programming language that will run the script. Your Mac might already have Python, but we need Python 3 specifically.
Download Python
- Open Safari or your preferred web browser
- Go to python.org/downloads
- Click the big yellow button that says "Download Python 3.x.x"
- The file will download to your Downloads folder
- The filename will be something like
python-3.12.0-macos11.pkg
Install Python
- Open your Downloads folder (Cmd+Option+L or click Downloads in the Dock)
- Double-click the downloaded
.pkgfile - The installer will open - click Continue
- Read through the terms and click Continue
- Click Agree to accept the license
- Click Install
- Enter your Mac password when prompted
- Wait for installation to complete (takes 2-3 minutes)
- Click Close when installation is successful
Verify Python is Installed
Let's make sure Python installed correctly. We'll use Terminal:
Open Terminal:
- Press Cmd + Space to open Spotlight
- Type
Terminal - Press Return
A window will open with a command line interface. Type this command and press Return:
You should see something like:
python3 (not just python). Remember this - you'll use it throughout this guide!
Step 2: Install Required Library
The script needs a library called requests to download data from the internet.
Install the requests library
In your Terminal window (still open from Step 1), type this command and press Return:
You'll see text scrolling by as it downloads and installs. This takes about 10-20 seconds.
Step 3: Save the Script File
Now you need to save the Python code as a file on your Mac.
Create a Folder
- Right-click (or Control+click) on your Desktop
- Select New Folder
- Name the folder
PolymarketScraper(no spaces!) - Press Return
Save the Python Code
- Open TextEdit (press Cmd+Space, type "TextEdit", press Return)
- If TextEdit opens in "Rich Text" mode, go to Format → Make Plain Text (or press Cmd+Shift+T)
- Copy ALL of the polymarket1.py code (from the very first line to the very last line)
- Paste it into TextEdit
- Go to File → Save (or press Cmd+S)
- Navigate to your Desktop and select the
PolymarketScraperfolder - In the "Save As" field, type:
polymarket1.py - If you see a warning about using ".py", click "Use .py"
- Click Save
polymarket1.py!
Step 4: Run the Script
Now for the exciting part - running the script!
Open Terminal
If you closed Terminal, open it again:
- Press Cmd + Space
- Type
Terminal - Press Return
Navigate to Your Folder
Type these commands (press Return after each one):
cd means "change directory" - it's like opening a folder. We're telling Terminal to go to Desktop, then into the PolymarketScraper folder.
Run the Script
Type this command and press Return:
The script will start and ask you three questions:
Question 1: Enter categories
Type the categories you want to search, separated by commas:
Available categories: politics, crypto, geopolitics, tech, world, trump, elections
Press Return after typing.
Question 2: How many total markets to fetch?
Type a number (how many markets you want to see):
Press Return.
Question 3: Minimum volume filter?
Type 0 to see all markets, or a number like 10000 to only see markets with at least $10,000 in volume:
Press Return.
politics,crypto, 50 markets, 0 minimum volume. This will be quick and show you how it works!
The script will now fetch data from Polymarket. You'll see messages like "Fetching markets from Polymarket..." This takes 10-30 seconds.
Step 5: View Your Results
The script creates two files in your PolymarketScraper folder:
- polymarket_feed.html - Your beautiful results page!
- polymarket_data.json - Raw data (for advanced users)
Open the Results
- Go to your Desktop
- Open the PolymarketScraper folder
- Find the file named polymarket_feed.html
- Double-click it
- It will open in Safari (or your default browser)
What You'll See
- Markets organized by category (Politics, Crypto, Tech, etc.)
- For each market:
- The question/prediction
- Trading volume (how much money is in the market)
- Liquidity
- Current odds (YES/NO percentages)
- End date
- A link to view it on Polymarket.com
Running It Again
Want to update your data or search for different categories? Easy!
- Open Terminal (Cmd + Space, type "Terminal")
- Navigate to your folder:
cd Desktop/PolymarketScraper
- Run the script:
python3 polymarket1.py
- Answer the questions with your new preferences
- Go back to your browser and refresh the page (press Cmd + R) to see new results!
Troubleshooting Common Issues
Problem: 'python3: command not found'
Solution: Python isn't installed or isn't in your PATH. Try:
- Reinstall Python from python.org
- Or try using just
pythoninstead ofpython3
Problem: No module named 'requests'
Solution: The requests library isn't installed. Open Terminal and run:
Problem: Permission denied
Solution: You might need to use sudo (administrator privileges):
You'll be asked for your Mac password. Type it (it won't show as you type - that's normal) and press Return.
Problem: TextEdit saves with wrong formatting
Solution: Make sure TextEdit is in Plain Text mode:
- Open TextEdit
- Go to Format → Make Plain Text (or press Cmd+Shift+T)
- Paste your code again and save
Problem: Error fetching markets
Solution: This usually means:
- Your internet connection is down - check your WiFi
- Polymarket's API might be temporarily down - try again in a few minutes
Problem: No markets found
Solution:
- Your volume filter might be too high - try setting it to 0
- Try different categories (politics and crypto usually have the most markets)
- Increase the number of markets to fetch (try 200)
Understanding Your Results
What Do the Numbers Mean?
Volume: The total amount of money traded on this market. Higher volume = more people betting = usually more accurate odds. A market with $500,000 volume is more reliable than one with $1,000.
Liquidity: How easy it is to buy or sell positions in this market. Higher liquidity means you can trade without affecting the price much.
YES/NO Odds: The current probability of each outcome according to the market. For example:
- "YES 65% / NO 35%" means traders think there's a 65% chance it will happen
- "YES 20% / NO 80%" means traders think there's only a 20% chance it will happen
End Date: When the market closes and the outcome is determined. After this date, the market resolves to either YES or NO.
Pro Tips for Mac Users
- Add to Dock: Drag the PolymarketScraper folder to your Dock for quick access
- Quick Terminal: Add Terminal to your Dock too - you'll use it often
- Keyboard Shortcuts: Learn Cmd+Space (Spotlight) and Cmd+R (refresh browser) - they're lifesavers
- Save Multiple Versions: Before running the script again, rename your old HTML file (like
polymarket_feed_oct21.html) to keep historical data - Automator: Advanced users can create an Automator workflow to run the script with one click
- Share Results: AirDrop the HTML file to your iPhone/iPad - it works great on mobile Safari
Next Steps
Now that you've successfully run the script, you can:
- Experiment with different categories (try all 7 categories!)
- Adjust volume filters to focus on high-activity markets
- Track how specific markets change over time
- Share your HTML reports with friends interested in prediction markets
- Visit Polymarket.com to learn more and potentially trade
- Use AirDrop to share results with other Apple devices