# Discover Available Prediction Market Exchanges and Markets

## Discover Available Prediction Market Exchanges and Markets

This tutorial shows you how to:

1. Pull the full list of supported **prediction market exchanges**
2. Fetch a **single exchange** by its `exchange_id`
3. Use that `exchange_id` to discover **markets** available on that exchange (full history list vs “active” IDs)

## What you need before you start

* ✅ A **FinFeedAPI API Key**
* ✅ Any HTTP client:
  * Terminal (`curl`)
  * Postman / Insomnia
  * Browser (for simple GET requests)

## Step 1 — List all supported exchanges

**Endpoint:** `GET /v1/exchanges`

### cURL example

```typescript
curl -sS"https://api.prediction-markets.finfeedapi.com/v1/exchanges" \
  -H"Authorization: <API_KEY>"
```

### What you get back

An array of exchanges, each including:

* `exchange_id` (example: `POLYMARKET`, `KALSHI`)
* `market_name_institution_description`
* `website`

Example entries shown in the docs include `KALSHI`, `POLYMARKET`, `MYRIAD`, `MANIFOLD`.

✅ **Save the `exchange_id`** you want to work with—you’ll use it in every exchange-scoped request.



## Step 2 — Get a specific exchange by `exchange_id`

**Endpoint:** `GET /v1/exchanges/:exchange_id`

### cURL example (Polymarket)

```typescript
curl -sS"https://api.prediction-markets.finfeedapi.com/v1/exchanges/:exchange_id" \
  -H"Authorization: <API_KEY>"
```

### Expected responses

* **200** with the exchange object (same fields as above)
* **404** if the exchange doesn’t exist / isn’t supported

## Step 3 — Discover markets on an exchange

Once you have an `exchange_id`, you have two common ways to discover markets:

### Option A: Get full market objects (history listing)

**Endpoint:** `GET /v1/markets/:exchange_id/history`

* Supports pagination:
  * `limit` (1–1000, default 100)
  * `page` (1-based, default 1)

```typescript
curl -sS"https://api.prediction-markets.finfeedapi.com/v1/markets/POLYMARKET/history?limit=100&page=1" \
  -H"Authorization: <API_KEY>"
```

Each item can include fields like:

* `market_id`, `title`, `description`, `outcome_name`, `price`, `status`
* `exchange_id`, `outcome_type`, `mechanism`, and optionally `source_specific_data`

### Option B: Get only “active” market IDs (lightweight)

**Endpoint:** `GET /v1/markets/:exchange_id/active`

This returns **only an array of market IDs** (because it’s derived from recent quotes/transactions). Use `/history` if you need full details.

```typescript
curl -sS"https://api.prediction-markets.finfeedapi.com/v1/markets/POLYMARKET/active?limit=100&page=1" \
  -H"Authorization: <API_KEY>"
```

## Practical workflow (recommended)

1. Call **`/v1/exchanges`** to get supported exchanges and pick one `exchange_id`.
2. (Optional) Validate it with **`/v1/exchanges/:exchange_id`**.
3. Use **`/v1/markets/:exchange_id/active`** to quickly discover what’s trading right now.
4. Use **`/v1/markets/:exchange_id/history`** when you need full market metadata (titles, outcome names, descriptions, status, etc.).

## Troubleshooting tips

* **404 on an exchange or markets request:** double-check the `exchange_id` exists by calling `/v1/exchanges` first.
* **400 with limit/page:** keep `limit` within **1–1000** and `page >= 1`.

## Next steps

Now that you can list exchanges and markets, you can plug `exchange_id` + `market_id` into other endpoints like **MarketActivity**, **Orderbooks**, or **OHLCV** (depending on what you want to build).

🚀 Happy building with Prediction Markets! Get your [**Free API Key**](https://console.apibricks.io/).