# POST /v2/exports

Group: Bulk exports

Kicks off an export of a single league season. JSON body: league (DataSportsAPI league id), season (taken from /v2/leagues/{id}/seasons) and format, one of json (the default — a single season.json containing league, season, rounds, all fixtures, standings, top players and top teams exactly as the endpoints return them), csv or parquet (each giving two flat tables: fixtures and standings). The response is 202 with the export object, in status pending.

Plans: Requires Business or Enterprise; any lower plan receives 403 endpoint_not_in_plan.

Note: Fixtures are collected round by round, so a competition our data source does not split into rounds (NBA and NHL regular seasons) produces an export without fixtures; the export’s error field lists whatever could not be read (“not included: topPlayers”). Because we mirror the source’s listing, a match that was postponed and replayed later may appear twice — once as the postponed fixture and once as the played one, each with its own id (Premier League 25/26: 381 fixtures, one of them postponed). Columns in the CSV / Parquet files — fixtures: fixture_id, sport, start_time, round, round_name, status, status_description, home_team_id, home_team, away_team_id, away_team, home_score, away_score, winner, venue; standings: table, primary, position, team_id, team, played, wins, draws, losses, scores_for, scores_against, points, zone.

## Response

- `data`: `Export`

## Errors

- 404 not_found — the league does not exist, or the season does not belong to it
- 429 export_limit — the allowance of 20 exports per UTC day has been used up

Plus the common errors (https://datasportsapi.com/markdown/docs.md#errors).

## Request

cURL:

```bash
curl -X POST -H "Authorization: Bearer sk_live_…" \
    "https://api.datasportsapi.com/v2/exports"
```

TypeScript:

```ts
const { data, meta } = await client.exports.create({ league, season });
```

Python:

```python
res = client.exports.create(league=league, season=season)
```

Go:

```go
res, err := client.Exports.Create(ctx, &datasportsapi.ExportsCreateParams{League: league, Season: season})
```

CLI:

```bash
$ dsa exports create --league <league> --season <season>
```

## Example response

```json
$ curl -X POST -H "Authorization: Bearer sk_live_…" -H "Content-Type: application/json" \
    -d '{ "league": 17, "season": 61627, "format": "parquet" }' https://api.datasportsapi.com/v2/exports

{ "data": { "id": 42, "league": 17, "season": 61627, "format": "parquet", "status": "pending", "error": null,
            "fixtureCount": null, "createdAt": "2026-11-01T18:00:00.000Z", "finishedAt": null, "files": [] } }
```

---

Base URL: https://api.datasportsapi.com. Authenticate each /v2 call with the header `Authorization: Bearer <key>` (secret keys begin with `sk_live_`).
HTML: https://datasportsapi.com/docs/exports/create/ · All docs: https://datasportsapi.com/markdown/docs.md · Data reference: https://datasportsapi.com/markdown/reference.md
