> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# Prediction Market Data

> Mounted Polymarket and Kalshi discovery/trade-history data for autonomous agents.

[View on GitHub →](https://github.com/AIsa-team/agent-skills/tree/main/financial/prediction-market-data)

**Prediction-market discovery data for autonomous agents.** One `AISA_API_KEY` reads mounted Polymarket and Kalshi endpoints for market discovery, event lookup, activity, and Kalshi trade history.

## Install

```bash npx skills theme={null}
npx skills add AIsa-team/agent-skills --skill prediction-market-data
```

```bash AIsa CLI theme={null}
npm install -g @aisa-one/cli
aisa skills install prediction-market-data
```

Start a new agent session after installing so the skill loads.

## What can agents do with it?

> [card] Market discovery
>
> "Find Polymarket and Kalshi markets related to a topic."

> [card] Event lookup
>
> "Browse Polymarket event groups and associated markets."

> [card] Trade history
>
> "Pull recent Kalshi trade records with optional ticker and block-trade filters."

> [card] Activity checks
>
> "Inspect Polymarket activity for a specific user over a time range."

> [card] Liquidity triage
>
> "Use volume and liquidity fields from market discovery responses to prioritize deeper venue checks."

> [card] Research workflows
>
> "Build candidate sets before using venue-native tools for pricing, orderbooks, or execution."

## Core capabilities

* **Market discovery** — fetch Polymarket and Kalshi markets with provider-supported filters.
* **Event index** — fetch Polymarket event/group data.
* **Trade history** — fetch Kalshi trades using `limit`, `cursor`, `ticker`, `min_ts`, `max_ts`, and `is_block_trade`.
* **Activity lookup** — fetch Polymarket user activity with `user` and optional time/market filters.

> [!WARNING]
>
> AIsa currently mounts the endpoints listed below. Older examples for AIsa-hosted price, orderbook, wallet, candlestick, and matching-market endpoints were removed because authenticated probes returned `api endpoint not found`.

## Quick start

```bash theme={null}
export AISA_API_KEY="your-key"
```

### Polymarket

```bash theme={null}
# Market discovery
curl "https://api.aisa.one/apis/v1/polymarket/markets?limit=5" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Events
curl "https://api.aisa.one/apis/v1/polymarket/events?limit=5" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Activity for a specific user address
curl "https://api.aisa.one/apis/v1/polymarket/activity?user=WALLET_ADDRESS&limit=5" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### Kalshi

```bash theme={null}
# Market discovery
curl "https://api.aisa.one/apis/v1/kalshi/markets?limit=5&status=open" \
  -H "Authorization: Bearer $AISA_API_KEY"

# Trades
curl "https://api.aisa.one/apis/v1/kalshi/trades?limit=5&is_block_trade=false" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

## Python client

```bash theme={null}
# Polymarket
python3 scripts/prediction_market_client.py poly markets --limit 5
python3 scripts/prediction_market_client.py poly events --limit 5
python3 scripts/prediction_market_client.py poly activity --user WALLET_ADDRESS --limit 5

# Kalshi
python3 scripts/prediction_market_client.py kalshi markets --limit 5 --status open
python3 scripts/prediction_market_client.py kalshi trades --limit 5 --is-block-trade false
```

## Endpoint reference

| Endpoint | Method | Purpose |
| - | - | - |
| `/polymarket/markets` | GET | [Polymarket markets](https://aisa.one/docs/api-reference/prediction-market/get_polymarket-markets.md) |
| `/polymarket/events` | GET | [Polymarket events](https://aisa.one/docs/api-reference/prediction-market/get_polymarket-events.md) |
| `/polymarket/activity` | GET | [Activity](https://aisa.one/docs/api-reference/prediction-market/get_polymarket-activity.md) |
| `/kalshi/markets` | GET | [Kalshi markets](https://aisa.one/docs/api-reference/prediction-market/get_kalshi-markets.md) |
| `/kalshi/trades` | GET | [Kalshi trades](https://aisa.one/docs/api-reference/prediction-market/get_kalshi-trades.md) |

## Get started

1. Sign up at [aisa.one](https://aisa.one) and create an API key in the console.
2. Set it in your shell: `export AISA_API_KEY="your-key"`.
3. Install the skill with one of the commands under [Install](#install), then start a new agent session.

## Related

> [card] [Prediction Market API reference](https://aisa.one/docs/api-reference/prediction-market/get_polymarket-markets.md)
>
> Mounted Polymarket and Kalshi discovery endpoints.

> [card] [Arbitrage skill](https://aisa.one/docs/agent-skills/prediction-market-arbitrage.md)
>
> Candidate discovery for cross-platform market research.

> [card] [Error Codes](https://aisa.one/docs/api-reference/errors.md)
>
> Handling upstream exchange errors.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.