# Bulk export

`GET /api/v1/export` streams historical articles and clusters for a date range, as JSONL or CSV. It is an Enterprise scope, meant for backfills, model training sets and archives rather than for reading the day's news.

## The range

`from` and `to` are inclusive UTC dates, at most 366 days apart. Up to 500 article records come back per page, grouped by `storyId`.

`X-Export-Snapshot` fixes the insertion cutoff for the whole walk, so a story filed while you page does not appear halfway through. Corrections and current cluster state are read live, so those can change between pages.

Full publisher article bodies are never included.

## Paging a range

Send `X-Next-Cursor` from the previous response back as `cursor`, with `from`, `to` and `lang` unchanged. An empty `X-Next-Cursor` marks the final page.

```bash Export walk
curl -s --get 'https://news.itsbaba.com/api/v1/export' \
  --header "Authorization: Bearer $BABA_NEWS_API_KEY" \
  --data-urlencode 'from=2026-01-01' \
  --data-urlencode 'to=2026-03-31' \
  --data-urlencode 'format=jsonl' \
  --dump-header headers.txt
```

## Columns

| Column | Meaning |
| --- | --- |
| `recordId` | Row id. Strictly increasing, and what the cursor advances on. |
| `storyId` | Cluster id. Rows that share it belong to one story. |
| `articleId` | Article id inside the cluster. |
| `source` | Newsroom key. |
| `lang` | Record language, which equals the requested `lang`. |
| `headline` | Headline for that article. |
| `summary` | Machine-written summary. |
| `topic` | Desk id. |
| `publishedAt` | Publication timestamp, UTC. |
| `updatedAt` | Last body change, or null. |
| `state` | Current cluster state, read at export time. |
| `missingSides` | Sides absent from the cluster, as a JSON array. |
| `framing` | Framing object, or null. |
| `url` | baba URL for the article. |

```json One JSONL record
{"recordId":"918233","storyId":"44","articleId":"812","source":"ynet","lang":"en","headline":"Cabinet approves the deal","summary":"Ministers voted after midnight.","topic":"politics","publishedAt":"2026-08-14 05:11:00+00","updatedAt":null,"state":"consensus","missingSides":["haredi"],"framing":null,"url":"https://news.itsbaba.com/812/cabinet-approves-the-deal"}
```

## Format notes

JSONL is one JSON object per line, newline terminated, and is the default. CSV carries a header row, quotes every field containing a comma or a quote, and encodes `missingSides` and `framing` as JSON strings inside the cell.

`lang` selects stored records only. There is no fallback in export: asking for `he` returns Hebrew rows and omits articles with no Hebrew record, which is what you want when building a training set and not what you want when reading the news.
