Polymarket Scraper
Welcome Linux User!
This guide will walk you through installing and running the Polymarket Scraper on Linux. Since you're using Linux, you probably have some tech experience, but we'll keep this beginner-friendly.
Time needed: About 10-15 minutes
What You'll Need
- A Linux system (Ubuntu, Debian, Fedora, Arch, etc.)
- Internet connection
- Terminal access
- The polymarket1.py file (the code you were given)
Step 1: Install Python
Most Linux distributions come with Python pre-installed. Let's check if you have Python 3:
Check Python Version
Open your terminal (Ctrl+Alt+T on most distros) and run:
If you see something like Python 3.x.x, you're good to go! Skip to Step 2.
If Python 3 isn't installed, use your distribution's package manager:
Ubuntu / Debian / Linux Mint
Fedora / RHEL / CentOS
Arch Linux / Manjaro
openSUSE
python3 --version. You should see a version number like 3.x.x.
Step 2: Install Required Library
The script needs the requests library to fetch data from Polymarket's API.
Install via pip
Or if you prefer using your system package manager:
Ubuntu / Debian
Fedora
Arch Linux
sudo pip3 install requests or add --user flag: pip3 install --user requests
Step 3: Save the Script File
Now let's save the Python code as a file.
Create a Directory
Save the Python Code
You have several options:
Option 1: Using a Text Editor (Recommended for Beginners)
- Open your favorite text editor (gedit, kate, nano, vim, etc.)
- Copy ALL of the polymarket1.py code
- Paste it into the editor
- Save as
polymarket1.pyin the PolymarketScraper folder
Option 2: Using nano (Terminal-based)
Paste the code, then press Ctrl + O to save and Ctrl + X to exit.
Option 3: Using vim
Press i for insert mode, paste the code, press Esc, type :wq and press Enter.
ls -l polymarket1.py
Step 4: Run the Script
Time to run the scraper!
Navigate to Your Directory
If you're not already there:
Run the Script
The script will 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 Enter after typing.
Question 2: How many total markets to fetch?
Type a number (how many markets you want to see):
Press Enter.
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 Enter.
politics,crypto, 50 markets, 0 minimum volume for a quick test!
The script will fetch data from Polymarket. You'll see progress messages. This takes 10-30 seconds.
Step 5: View Your Results
The script creates two files:
- polymarket_feed.html - Beautiful results page
- polymarket_data.json - Raw JSON data
Open the HTML File
You can open it several ways:
Method 1: Default Browser
Method 2: Specific Browser
Or use: chromium, google-chrome, brave, etc.
Method 3: File Manager
Navigate to ~/PolymarketScraper in your file manager and double-click polymarket_feed.html
What You'll See
- Markets sorted by category (Politics, Crypto, Tech, etc.)
- For each market:
- The prediction question
- Trading volume and liquidity
- Current odds (YES/NO percentages)
- End date
- Link to Polymarket.com
Running It Again
To update data or change search parameters:
Answer the prompts with your new preferences. Refresh your browser (F5 or Ctrl+R) to see updated results!
polymarket to run it anytime!
Troubleshooting Common Issues
Problem: python3: command not found
Solution: Python 3 isn't installed. Install it using your package manager (see Step 1).
Problem: No module named 'requests'
Solution: Install the requests library:
Or use --user flag: pip3 install --user requests
Problem: Permission denied when installing
Solutions:
- Use sudo:
sudo pip3 install requests - Or install for user only:
pip3 install --user requests
Problem: Error fetching markets
Solution:
- Check your internet connection:
ping google.com - Check if firewall is blocking Python
- Polymarket API might be temporarily down - wait and retry
Problem: No markets found
Solution:
- Lower your volume filter to 0
- Try different categories (politics and crypto are most active)
- Increase the number of markets to fetch
Problem: Can't open HTML file
Solution: Try different commands:
Understanding Your Results
What Do the Numbers Mean?
Volume: Total amount of money traded. Higher volume = more reliable odds. Markets with $500,000+ volume have better price discovery.
Liquidity: How easy it is to trade without affecting prices. Higher is better for actual trading.
YES/NO Odds: Market-implied probabilities:
- "YES 65% / NO 35%" = 65% probability the event happens
- "YES 20% / NO 80%" = only 20% probability it happens
End Date: When the market resolves. After this, the outcome is determined.
jq:
Pro Tips for Linux Users
- Bash Alias: Add to ~/.bashrc for quick access:
alias pm='cd ~/PolymarketScraper && python3 polymarket1.py' - Cron Job: Automate daily updates:
0 9 * * * cd ~/PolymarketScraper && python3 polymarket1.py(runs at 9 AM) - JSON Processing: Use
jqto parse the JSON output for custom analysis - Version Control: Track changes with git:
git init && git add . && git commit -m "Initial commit" - Virtual Environment: Keep dependencies isolated:
python3 -m venv venv && source venv/bin/activate - Backup Results:
cp polymarket_feed.html "feed_$(date +%Y%m%d).html"before each run
Advanced: Automation & Customization
Create a Bash Script
Save this as run_polymarket.sh:
Make it executable:
Schedule with Cron
Edit crontab:
Add this line for daily 9 AM updates:
Parse JSON with jq
Next Steps
Now that you're up and running:
- Experiment with all 7 categories
- Adjust filters to find niche markets
- Track market changes over time
- Automate with cron jobs
- Parse JSON data for custom analysis
- Share HTML reports with non-Linux users (it's cross-platform!)
- Visit Polymarket.com to explore further