Polymarket CLI Commands and Features: A Full Guide for Traders, Scripts, and AI Agents
A practical guide to Polymarket CLI commands and features. Install it, browse markets, read order books, place orders, and pipe JSON output for scripts and AI agents.

This guide walks through the Polymarket CLI commands and features you need to trade prediction markets from your terminal. The Polymarket CLI is the official command line tool from Polymarket, written in Rust. It lets you browse markets, read live order books, place and cancel orders, track positions, and run onchain token operations without opening a browser. Developer Suhail Kakar built it under the Polymarket GitHub organization, and it runs on macOS and Linux. Every command returns a clean table or raw JSON, so traders, script writers, and AI agents wire it into their workflows with single line calls.
Here are the main Polymarket CLI commands and features List:
- Installation
- Wallet setup and configuration
- Market and event browsing
- Order book pricing and market data
- Trading: order placement and management
- Rewards and API keys
- Portfolio data and leaderboards
- Contract approvals and CTF onchain operations
- Bridge deposits
- Interactive shell mode
- JSON output and automation
Each section below breaks down the Polymarket CLI commands and features in that group, with the exact syntax and why it helps.
- Learn More: https://github.com/Polymarket/polymarket-cli
- Learn More: https://polymart.app/polymarket-cli
How to Install the Polymarket CLI
You have three install paths. Pick the one that matches your setup.
| Method | Command | Best for |
|---|---|---|
| Homebrew | brew tap Polymarket/polymarket-cli https://github.com/Polymarket/polymarket-cli then brew install polymarket |
Mac and Linux users who want the fastest setup |
| Shell script | curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | sh |
A one line install without Homebrew |
| Build from source | git clone https://github.com/Polymarket/polymarket-cli then cd polymarket-cli then cargo install --path . |
People who want the latest code |
After the install finishes, run polymarket --version and polymarket --help to confirm it works. The binary is small and starts fast.
Wallet Setup and Configuration
Browsing needs no wallet. Placing orders, checking balances, and onchain actions do. The Polymarket CLI keeps private keys local and supports three signature styles.
polymarket wallet create # generate a new key
polymarket wallet import 0xKEY # import an existing key
polymarket wallet show # view current wallet details
polymarket wallet address # print your address
A new wallet writes to ~/.config/polymarket/config.json, which also stores the chain id and signature type. The CLI reads your private key in this order:
- The
--private-keyflag - The
POLYMARKET_PRIVATE_KEYenvironment variable - The config file
Command line flags can land in shell history, so agent runtimes and CI setups often inject the key through the environment variable instead. The three signature types match different account setups:
| Signature type | What it does | Use case |
|---|---|---|
proxy (default) |
Uses Polymarket's proxy wallet system | Most users, often lower gas |
eoa |
Signs directly with your private key | Direct control from one address |
gnosis-safe |
Signs for a Safe multisig | Team or treasury accounts |
Override the type with --signature-type or the matching environment variable. Keep some MATIC on Polygon for gas before any onchain step. Reset your config with polymarket wallet reset if you need a clean slate.
Market and Event Browsing
Research works without a wallet, which makes this the daily driver for scanners and monitoring scripts.
List and filter markets
polymarket markets list --limit 10
polymarket markets list --active true --order volume_num
polymarket markets list --closed false --limit 50 --offset 25
Flags control limit, offset, sort order, ascending or descending, active status, and closed status. Good for a volume ranked dashboard.
Get one market or search
polymarket markets get 12345
polymarket markets get will-bitcoin-hit-100k
polymarket markets search "bitcoin" --limit 5
polymarket markets tags 12345
A single market returns full metadata: the question, outcomes, volume, liquidity, and CLOB token ids.
Events and other discovery commands
Events group related markets, such as an election with many yes/no questions.
polymarket events list --tag politics --active true
polymarket events get 500
polymarket tags list
polymarket series list --limit 10
polymarket comments list --entity-type market --entity-id ID
polymarket sports teams --league nfl --limit 20
Add -o json to any of these to pipe results into other tools.
Order Book Pricing and Market Data
The clob group talks to the central limit order book. All read commands work without a wallet.
polymarket clob ok # health check
polymarket clob price TOKEN_ID --side buy # best bid or ask
polymarket clob midpoint TOKEN_ID # midpoint
polymarket clob spread TOKEN_ID # spread
polymarket clob book TOKEN_ID # full order book
polymarket clob last-trade TOKEN_ID # last trade
polymarket clob price-history TOKEN_ID --interval 1d --fidelity 30
Batch reads fetch many tokens in one call, which suits a multi market dashboard:
polymarket clob batch-prices "TOKEN1,TOKEN2" --side buy
polymarket clob midpoints "TOKEN1,TOKEN2"
polymarket clob books "TOKEN1,TOKEN2"
Price history intervals include 1m, 1h, 6h, 1d, 1w, and max. Fidelity sets how many data points come back, which feeds charting scripts.
Trading: Place and Manage Orders
The trading commands and features sit under clob too. Fund the wallet and set approvals first.
polymarket clob create-order --token TOKEN_ID --side buy --price 0.50 --size 10
polymarket clob market-order --token TOKEN_ID --side buy --amount 5
polymarket clob post-orders --tokens "TOKEN1,TOKEN2" --side buy --prices "0.40,0.60" --sizes "10,10"
A limit order supports four order types. Add --post-only for maker only orders.
| Type | Meaning |
|---|---|
GTC (default) |
Good til canceled, rests on the book |
FOK |
Fill or kill, all or nothing right away |
GTD |
Good til a set time |
FAK |
Fill and kill, fill what it can, cancel the rest |
Cancel and query commands cover the full order lifecycle:
polymarket clob cancel ORDER_ID
polymarket clob cancel-all
polymarket clob orders --market CONDITION_ID
polymarket clob trades
polymarket clob balance --asset-type collateral
Scripts can create, cancel, and reprice orders in milliseconds through this same interface, so an AI agent runs a strategy without any extra library.
Rewards and API Keys
Liquidity providers track earnings and manage keys here.
polymarket clob rewards --date 2026-06-15
polymarket clob earnings --date 2026-06-15
polymarket clob current-rewards
polymarket clob market-reward CONDITION_ID
polymarket clob api-keys
polymarket clob create-api-key
polymarket clob account-status
Create an API key once, then reuse it for higher rate limits or an external bot. The reward commands show daily earnings and scoring, so you can see which markets pay the most for liquidity.
Portfolio Data and Leaderboards
The data group pulls public onchain and platform stats for any address.
polymarket data positions 0xWALLET
polymarket data closed-positions 0xWALLET
polymarket data value 0xWALLET
polymarket data activity 0xWALLET
polymarket data holders CONDITION_ID
polymarket data open-interest CONDITION_ID
polymarket data leaderboard --period month --order-by pnl --limit 10
Leaderboard reads show top performers by PnL or volume over a week or month. Holders and open interest give you whale tracking and market depth. Together these power a smart money scanner or copy trading research with no extra infrastructure.
Contract Approvals and CTF Operations
Approve the exchange contracts before your first trade. Then you can split, merge, and redeem conditional tokens.
polymarket approve check
polymarket approve set # runs the full approval suite, costs gas
polymarket ctf split --condition CONDITION_ID --amount 10
polymarket ctf merge --condition CONDITION_ID --amount 10
polymarket ctf redeem --condition CONDITION_ID
An agent that rebalances or redeems a winning position after resolution does it with one call.
Bridge Deposits
Move funds onto Polygon from other chains without leaving the terminal.
polymarket bridge deposit 0xYOUR_POLYGON_ADDRESS
polymarket bridge supported-assets
polymarket bridge status DEPOSIT_ADDRESS
You get deposit addresses for EVM chains, Solana, Bitcoin, and more, and you can check status anytime.
Interactive Shell Mode
Type the binary name once and stay inside the tool.
polymarket shell
Inside the shell you drop the polymarket prefix, and command history works. This fits a long research session where you jump between markets, books, and positions.
JSON Output for Scripts and AI Agents
Every command accepts -o json or --output json. In JSON mode, errors return as a JSON object on stdout, so scripts parse both success and failure the same way.
# Pull every market question in one line
polymarket -o json markets list --limit 100 | jq '.[].question'
# Check a balance with error handling
if ! result=$(polymarket -o json clob balance --asset-type collateral 2>/dev/null); then
echo "Failed to fetch balance"
exit 1
fi
echo "Balance: $(echo "$result" | jq -r '.balance') USDC"
This design is why the Polymarket CLI became a common interface for AI agents. An agent spawns the binary, requests data or places a trade, parses the response, and loops. Token usage stays low because the tool is tiny and fast.
Safety Notes
The project ships as early experimental software, and the README says as much:
"This is early, experimental software."
Commands and APIs can change without notice. Start with a small size, verify every onchain transaction on a block explorer, and keep private keys out of shared environments. Prefer environment variables over config files. The MIT license lets you fork and extend the code, and many builders already wrap it for dashboards and trading bots. Nothing here is financial advice, so do your own research before you trade.
Start Using the Polymarket CLI Commands Today
You now have the full map of Polymarket CLI commands and features, from market browsing to onchain redemption. Install the tool with Homebrew or the shell script, run polymarket markets list and polymarket clob book TOKEN_ID, then wire the JSON output into your next script or agent. You get prediction market data and trade execution from a single terminal window. Grab it from the Polymarket GitHub repository and run your first market scan in under a minute.





