> For the complete documentation index, see [llms.txt](https://docs.flash.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flash.im/docs/for-institutions/prediction-markets.md). Agents can also search and read this documentation through its [MCP server](https://docs.flash.im/~gitbook/mcp).

# Prediction Markets

Attach the news that fits each contract, and mark the closely related news on its probability chart.

A contract page already holds a question, its outcomes, and a probability. FLASH adds the news that belongs to that question: one call per contract, built from what your contract data already holds.

## What you build

* **A news rail on every contract page.** The latest news that fits the contract, updated as new stories are analyzed
* **Markers on the probability chart.** The stories most closely tied to the contract, placed at the moment they were published

## What you need

* An API key ([Quick Start](https://docs.flash.im/docs/quick-start.md))
* For each contract, one of: its question, its asset (short-term crypto price contracts), or its Polymarket or Kalshi number

## Ask for a contract's news

Pick the way that fits the contract. All three are `GET /v1/news`, and the response has the same shape.

| Your contract                      | Send                                                             | Example                                             |
| ---------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------- |
| A contract you list                | The question as-is in `sentence`, outcome names in `subEntities` | `sentence=Will the Fed cut rates in December 2026?` |
| A short-term crypto price contract | The asset in `keyword`                                           | `keyword=Bitcoin,BTC`                               |
| A Polymarket or Kalshi contract    | Its number in `contract`                                         | `contract=polymarket:770450`                        |

### 1. A contract you list: send the question

```
GET /v1/news?sentence={question}&category={category}&subEntities={outcome 1},{outcome 2}&limit={count}
```

| Your contract already has                     | You send                                                                            |
| --------------------------------------------- | ----------------------------------------------------------------------------------- |
| The question                                  | `sentence=` as-is, URL-encoded. English only                                        |
| Outcome names (candidates, companies, assets) | `subEntities=`, comma-separated, up to 50                                           |
| Its market                                    | `category=` as the FLASH category: `crypto`, `economy`, `politics` or `geopolitics` |

Filled in:

```bash
curl "https://api.flash.im/v1/news?sentence=Will%20the%20Fed%20cut%20rates%20in%20December%202026%3F&category=economy&limit=10" \
  -H "Authorization: Bearer sk_live_..."
```

```
GET /v1/news?sentence=2028%20Republican%20presidential%20nominee&category=politics&subEntities=J.D.%20Vance,Marco%20Rubio,Ron%20DeSantis&limit=10
```

* **Send the outcome names whenever the question does not name them.** "2028 Republican presidential nominee" names no candidate, so the names in `subEntities` are what the matching runs on. Without them such a question returns `no_match`
* **When FLASH tracks the same question, you get that contract's record.** FLASH tracks the leading Polymarket and Kalshi contracts. If your question is one of them, the answer comes from that contract's record, with `topicId` and a `relation` on each story (see What comes back). The Fed question above returns the same stories as `contract=polymarket:770450`
* **One URL per event.** Every outcome market of one event can call the same URL, share the cache, and show the same news

### 2. A short-term crypto price contract: send the asset

Contracts such as "Bitcoin up or down in the next 15 minutes" or "Bitcoin above $X today" open and close within minutes to a day, and what they ask about is the asset's price. Ask for the asset, the way an asset page does:

```
GET /v1/news?keyword=Bitcoin,BTC&category=crypto&limit=10
```

Send the asset's name and its ticker, the ticker in upper case. For the chart on these contracts, follow the price chart guidance in [Exchanges and Aggregators](https://docs.flash.im/docs/for-institutions/exchanges-and-aggregators.md).

### 3. A Polymarket or Kalshi contract: send its number

```
GET /v1/news?contract=polymarket:770450&limit=10
GET /v1/news?contract=kalshi:KXPRESPERSON-28&limit=10
```

`contract` is `<market>:<id>`, and any identifier the market uses works:

| Market       | Accepted `id`                                                                |
| ------------ | ---------------------------------------------------------------------------- |
| `polymarket` | Event number, event slug, market number, condition ID (`0x...`), market slug |
| `kalshi`     | Event ticker or market ticker, upper or lower case                           |

`contract` cannot be combined with `keyword`. A contract FLASH does not track yet returns `no_match` (with `category`, the fallback still fills the list), and FLASH starts tracking it: see [Which contracts FLASH tracks](#which-contracts-flash-tracks).

## What comes back

The same `items` envelope as the news feed. A contract answer adds two fields:

* **`topicId`** at the top: the contract's topic in FLASH. Contracts on the same question, on Polymarket and on Kalshi, share one `topicId`
* **`relation`** on each story, whatever `fields` you ask for:

| `relation` | Meaning                                            |
| ---------- | -------------------------------------------------- |
| `direct`   | About the contract's question itself               |
| `adjacent` | Not the question itself, but the context around it |
| `broad`    | Background on the same subject                     |

**Order.** `direct` and `adjacent` stories come together, newest first, then `broad` stories. When `direct` and `adjacent` stories fill your `limit`, no `broad` story is included, so in practice the list reads newest first.

```
GET /v1/news?contract=polymarket:770450&fields=headline,impact,eventType,publishedAt&limit=2
```

```json
{
  "matchStatus": "matched",
  "topicId": "e48491b8-42c9-4ce3-b909-a1311691ab0d",
  "items": [
    {
      "id": "ZQmXkXz6n7",
      "headline": "Fed faces prospect of prolonged tightening as inflation pressures spread",
      "impact": 2,
      "eventType": "analysis-commentary",
      "publishedAt": "2026-11-12T16:55:07.000Z",
      "relation": "direct"
    },
    {
      "id": "Sqnl5WZxnL",
      "headline": "Treasury yields climb as expectations for a Fed rate increase stay strong",
      "impact": 3,
      "eventType": "market-move",
      "publishedAt": "2026-11-12T07:24:00.000Z",
      "relation": "direct"
    }
  ]
}
```

`matchStatus` tells you what the list holds:

| `matchStatus` | Meaning                                                                       |
| ------------- | ----------------------------------------------------------------------------- |
| `matched`     | Stories that fit the contract were found                                      |
| `topic_broad` | FLASH tracks the contract, but so far only background (`broad`) stories exist |
| `no_match`    | Nothing fits. With `category`, `fallback.items` fills the list                |

When a question sent in `sentence` is a contract FLASH tracks but its record has no stories yet, the answer comes from ordinary sentence matching: those stories arrive in `fallback.items`, with `fallback.strategy` set to `sentence_match`. The fallback rules are on the [Match API](https://docs.flash.im/docs/api-reference/match-api.md#fallback-no-empty-screens) page.

## News on the probability chart

Recommended practice. Adapt it to your screen.

* **Only `direct` stories.** The chart shows the news most closely tied to the contract
* **One marker per event.** Stories with the same `clusterId` report one event: show the first one
* **At the publish time.** Place the marker at the story's `publishedAt`
* **Neutral.** One neutral marker style, no colors or arrows for up or down, and no wording that says a story moved the probability

## Keep the list fresh

* **Poll with `after`.** Send the newest `publishedAt` you hold as `after=` to receive only what is new. With nothing new, the response is `matched` with an empty `items`
* **Same URL, same cache.** Call each contract with the same URL, parameters in the same order. Identical URLs are served from cache

## Which contracts FLASH tracks

* The open Polymarket and Kalshi contracts with the largest trading volume, picked again every day
* Any open Polymarket or Kalshi contract asked for in `contract`: the first request returns `no_match`, FLASH starts tracking it, and its record is filled back over the past 14 days
* Sports and entertainment contracts are not covered
* Your own contracts need no registration: send the question

## Errors

| Status | Message                                                        | Cause                                   |
| ------ | -------------------------------------------------------------- | --------------------------------------- |
| 400    | `contract must be <market>:<id>, for example polymarket:81557` | `contract` without the `<market>:` part |
| 400    | `contract cannot be combined with keyword`                     | `contract` and `keyword` in one request |

A market FLASH does not know is not an error: `contract` returns `no_match`. Other errors are listed in [Integration Patterns](https://docs.flash.im/docs/api-reference/integration-patterns.md).

## Security

Before you put FLASH news next to your contracts, read the [Security Guide](https://docs.flash.im/docs/rendering-guide/security-guide.md): check every response on your server, render text as text, and handle the links and images in the feed safely.

## FAQ

<details>

<summary>Do I need to register my contracts with FLASH?</summary>

No. Send the question of each contract you list; there is no registration or approval step. Polymarket and Kalshi contracts that FLASH does not track yet are added when you ask for them in `contract`.

</details>

<details>

<summary>Can I send the question in another language?</summary>

Inputs (`sentence`, `subEntities`, `keyword`) are English only. Output is any of the 16 languages: pass your user's language in `lang`.

</details>

<details>

<summary>How many contracts can I attach news to?</summary>

There is no limit. Each contract page makes one request, and identical URLs are served from cache, so thousands of pages stay cheap.

</details>
