Skip to content
Back to skills

Polymarket Sdk

ASecurity

Interact with Polymarket US prediction markets. Use when the user wants to: browse/search prediction markets, check market prices and odds, view portfolio positions and balances, place or cancel trades, check order status, look up events or sports markets, or get market settlement info. Requires the polymarket-us Python package and optionally API keys for trading.

  • 81 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 7, 2026
securitypythongobashapi

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 6 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add jiayaoqijia/cryptoskill --skill polymarket-sdk --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Polymarket Sdk?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Polymarket Sdk
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jiayaoqijia-polymarket-sdk/badge)](https://www.skillsdirectory.com/skills/jiayaoqijia-polymarket-sdk)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: polymarket
description: "Interact with Polymarket US prediction markets. Use when the user wants to: browse/search prediction markets, check market prices and odds, view portfolio positions and balances, place or cancel trades, check order status, look up events or sports markets, or get market settlement info. Requires the polymarket-us Python package and optionally API keys for trading."
---

# Polymarket US

Trade and browse prediction markets via the Polymarket US API using the Python SDK.

## Setup

Ensure the SDK is installed:
```bash
pip install polymarket-us
```

API keys are needed only for trading/portfolio endpoints. Generate at https://polymarket.us/developer

Store credentials as environment variables:
- `POLYMARKET_KEY_ID` — API key UUID
- `POLYMARKET_SECRET_KEY` — Ed25519 private key (base64)

## Usage

Write and execute Python scripts using the `polymarket_us` SDK. For full API details, read [references/api_reference.md](references/api_reference.md).

### Public Data (no auth)

```python
from polymarket_us import PolymarketUS
client = PolymarketUS()

# Search markets
results = client.search.query({"query": "bitcoin", "limit": 5})

# Browse trending markets
markets = client.markets.list({"limit": 10, "orderBy": ["volumeNum"], "orderDirection": "desc"})

# Check price
bbo = client.markets.bbo("market-slug")

client.close()
```

### Trading (auth required)

```python
import os
from polymarket_us import PolymarketUS

client = PolymarketUS(
    key_id=os.environ["POLYMARKET_KEY_ID"],
    secret_key=os.environ["POLYMARKET_SECRET_KEY"],
)

# Check balance
balances = client.account.balances()

# View positions
positions = client.portfolio.positions()

# Preview then place order
preview = client.orders.preview({"request": {
    "marketSlug": "some-market",
    "intent": "ORDER_INTENT_BUY_LONG",
    "type": "ORDER_TYPE_LIMIT",
    "price": {"value": "0.55", "currency": "USD"},
    "quantity": 100,
}})

# Place order (ALWAYS confirm with user before executing)
order = client.orders.create({
    "marketSlug": "some-market",
    "intent": "ORDER_INTENT_BUY_LONG",
    "type": "ORDER_TYPE_LIMIT",
    "price": {"value": "0.55", "currency": "USD"},
    "quantity": 100,
    "tif": "TIME_IN_FORCE_GOOD_TILL_CANCEL",
})

client.close()
```

## Key Rules

1. **Always preview orders before placing** — show the user what they're about to trade
2. **Always confirm with the user before placing any order** — never auto-trade
3. **Price is always the YES side** — to buy NO at $0.40, set price to $0.60 (1.00 - 0.40)
4. **In market slugs**: first team = YES, second team = NO
5. **Valid price range**: 0.001 to 0.999
6. **Handle errors gracefully** — catch `AuthenticationError`, `BadRequestError`, `RateLimitError`, etc.

## Formatting Results

When presenting market data to the user:
- Show market title/question clearly
- Display YES/NO prices as percentages (e.g., 55¢ = 55% implied probability)
- For positions, show P&L and current value
- Keep it conversational — this is prediction markets, make it fun

Files in this skill

  • SKILL.md3 KB
  • SOURCE.md250 B
  • TRUST.auto.yaml2.1 KB
  • _meta.json133 B
  • references/api_reference.md4.4 KB
  • skill-card.md2.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.