# LatestIn API reference

Base URL: `https://api.latestin.com/`. Send your key in the `X-API-Key` header; the remaining allowance comes back on every response in `X-Gw-Remaining`.

MCP server: `https://mcp.latestin.com/` (bearer token = the same key).

## Errors every operation can return

- `422` Unprocessable Entity

```json
[
  {
    "input": null,
    "loc": [],
    "msg": "string",
    "type": "string"
  }
]
```

# Events

# Events

## GET /v1/events

**Clustered events with verified facts and sources**

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `since` | query |  | no | Only events on or after this date (YYYY-MM-DD) |
| `storyline_id` | query |  | no | Filter to one storyline |
| `limit` | query | integer | no | Example: 25 |

### Responses

- `200` OK

```json
{
  "count": 1,
  "events": [
    {
      "event_date": "string",
      "event_id": "string",
      "fact_count": 1,
      "facts": [
        {
          "claim": "string",
          "fact_id": "string",
          "first_reported_at": "string",
          "sources": [
            {
              "outlet": null,
              "source_url": null
            }
          ]
        }
      ],
      "source_count": 1,
      "storyline_id": "string",
      "storyline_title": "string",
      "title": "string"
    }
  ]
}
```

### Example

```bash
curl "https://api.latestin.com/v1/events" \
  -H "X-API-Key: YOUR_KEY"
```

# Storylines

## GET /v1/storylines

**Long-running storylines with running totals**

### Responses

- `200` OK

```json
{
  "count": 1,
  "storylines": [
    {
      "event_count": 1,
      "fact_count": 1,
      "last_event_at": "string",
      "opened_at": "string",
      "source_count": 1,
      "storyline_id": "string",
      "title": "string"
    }
  ]
}
```

### Example

```bash
curl "https://api.latestin.com/v1/storylines" \
  -H "X-API-Key: YOUR_KEY"
```

## GET /v1/storylines/{storyline_id}/timeline

**The accreted record of one storyline, oldest to newest**

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `storyline_id` | path | string | yes | Example: string |

### Responses

- `200` OK

```json
{
  "storyline": {
    "event_count": 1,
    "fact_count": 1,
    "last_event_at": "string",
    "opened_at": "string",
    "source_count": 1,
    "storyline_id": "string",
    "title": "string"
  },
  "timeline": [
    {
      "event_date": "string",
      "event_id": "string",
      "facts": [
        {
          "claim": "string",
          "fact_id": "string",
          "first_reported_at": "string",
          "sources": [
            {
              "outlet": null,
              "source_url": null
            }
          ]
        }
      ],
      "title": "string"
    }
  ]
}
```

### Example

```bash
curl "https://api.latestin.com/v1/storylines/string/timeline" \
  -H "X-API-Key: YOUR_KEY"
```

# News

# News

## GET /v1/news

**Company news by ticker: headlines, publisher summaries and share images**

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `symbol` | query | string | yes | Ticker symbol, e.g. KR. Case-insensitive. Example: string |
| `since` | query |  | no | Only items published on or after this date (YYYY-MM-DD). Default: 14 days ago. |
| `kinds` | query |  | no | Comma-separated source kinds to include: wire, newsroom, outlet, aggregator. Default: all. |
| `limit` | query | integer | no | Example: 20 |

### Responses

- `200` OK

```json
{
  "count": 1,
  "items": [
    {
      "author": "string",
      "item_id": "string",
      "published_at": "string",
      "symbols": [
        "string"
      ],
      "title": "string",
      "url": "string"
    }
  ],
  "since": "string",
  "symbol": "string"
}
```

### Example

```bash
curl "https://api.latestin.com/v1/news?symbol=string" \
  -H "X-API-Key: YOUR_KEY"
```

# Quotes

# Quotes

## GET /v1/quotes

**Search verbatim quotes by person and date**

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `person` | query |  | no | Filter by speaker name (case-insensitive substring) |
| `q` | query |  | no | Filter by topic: case-insensitive substring of the quote text or its context line |
| `since` | query |  | no | Only quotes reported on or after this date (YYYY-MM-DD) |
| `limit` | query | integer | no | Example: 50 |
| `format` | query |  | no | 'ndjson' streams one quote per line |

### Responses

- `200` OK

```json
{
  "count": 1,
  "quotes": [
    {
      "context_line": "string",
      "date_reported": "string",
      "date_said": "string",
      "quote_id": "string",
      "source_count": 1,
      "sources": [
        {
          "outlet": "string",
          "source_url": "string"
        }
      ],
      "speaker_name": "string",
      "text": "string"
    }
  ]
}
```

### Example

```bash
curl "https://api.latestin.com/v1/quotes" \
  -H "X-API-Key: YOUR_KEY"
```

# Speakers

# Speakers

## GET /v1/speakers

**Speakers on record, most quoted first**

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `q` | query |  | no | Filter by name (case-insensitive substring) |
| `limit` | query | integer | no | Example: 50 |

### Responses

- `200` OK

```json
{
  "count": 1,
  "speakers": [
    {
      "last_quoted": "string",
      "name": "string",
      "page_url": "string",
      "quote_count": 1,
      "speaker_id": "string"
    }
  ]
}
```

### Example

```bash
curl "https://api.latestin.com/v1/speakers" \
  -H "X-API-Key: YOUR_KEY"
```
