# Trading 212 API POST /api/v0/equity/history/exports

Independent and unofficial. Not affiliated with or endorsed by any broker or platform named here. Educational only: nothing here is advice, and nothing here recommends a broker or a trade.

This is the markdown version of https://openbrokerapi.com/brokers/trading-212/endpoints/post-history-exports, written from the same records as that page.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Ask for a CSV report of account history over a period. The report is built in the background: the reply is a reportId to look for in the list of reports.

- Request: `POST /api/v0/equity/history/exports`
- Version: v0
- Group: History
- Status: verified. Source: [docs.trading212.com](https://docs.trading212.com/api), checked 2026-10-12.
- Official reference: https://docs.trading212.com/api

Note: Read on 12 Oct 2026 in Trading 212's own API reference at docs.trading212.com/api and the OpenAPI description that page offers for download (docs.trading212.com/_bundle/api.json). The reference calls the API a beta and says it works only for Invest and Stocks ISA accounts. The reference does not flag any body field as required, so none is marked required here. Documented rate limit: 1 request every 30 seconds.

## Parameters

- `Content-Type` (in header, type string, required): Send application/json on a request with a body.
- `timeFrom` (in body, type string, not marked by the vendor): Start of the period, as a date time.
- `timeTo` (in body, type string, not marked by the vendor): End of the period, as a date time.
- `dataIncluded` (in body, type object, not marked by the vendor): Which data to include, as four booleans: includeDividends, includeInterest, includeOrders and includeTransactions.

3 fields are tagged not marked by the vendor: timeFrom, timeTo, dataIncluded. The vendor's page lists them and marks them neither required nor optional. That describes the page, not a test of what the host accepts, so the samples send them with a placeholder.

### Authentication headers

- `Authorization` (type string, required): Send Basic followed by the Base64 encoding of your API key, a colon and your API secret. Placeholder only: never paste real credentials into this site.

## Request

Written from the method, path and parameters recorded on this page, against the demo host. Not executed against a live or demo account. Credentials are read from environment variables on your own machine and are never entered on this site. The request builder at https://openbrokerapi.com/tools/request-builder writes these same snippets, from the same record.

This call takes a request body. The samples send it as JSON with a placeholder for each of the 3 body fields the vendor's page marks neither required nor optional, named in the sample's own comment. Each placeholder has to be replaced with a real value before the request can succeed.

### Python

```python
# Set T212_API_KEY, T212_API_SECRET as environment variables first. Never paste real values into code.
# Replace each {placeholder}, "..." and 0 with a real value before running.
# Not marked required or optional on the vendor's page, so sent here with a placeholder: timeFrom, timeTo, dataIncluded. Leave out any the call does not need.
import base64
import os
import requests

BASE_URL = "https://demo.trading212.com"  # the demo host
headers = {
    "Authorization": "Basic " + base64.b64encode((os.environ["T212_API_KEY"] + ":" + os.environ["T212_API_SECRET"]).encode()).decode(),
    "Content-Type": "application/json",
}
body = {"timeFrom": "...", "timeTo": "...", "dataIncluded": {}}
resp = requests.post(BASE_URL + "/api/v0/equity/history/exports", headers=headers, json=body, timeout=10)
resp.raise_for_status()
print(resp.json())
```

### JavaScript

```javascript
// Set T212_API_KEY, T212_API_SECRET as environment variables first. Never paste real values into code.
// Replace each {placeholder}, "..." and 0 with a real value before running.
// Not marked required or optional on the vendor's page, so sent here with a placeholder: timeFrom, timeTo, dataIncluded. Leave out any the call does not need.
// Run as a module, for example a .mjs file, on a Node version that has fetch built in.
const BASE_URL = "https://demo.trading212.com"; // the demo host
const res = await fetch(BASE_URL + "/api/v0/equity/history/exports", {
  method: "POST",
  headers: {
    "Authorization": "Basic " + Buffer.from(process.env.T212_API_KEY + ":" + process.env.T212_API_SECRET).toString("base64"),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"timeFrom": "...", "timeTo": "...", "dataIncluded": {}}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
```

### curl

```bash
# Set T212_API_KEY, T212_API_SECRET as environment variables first. Never paste real values into code.
# Replace each {placeholder}, "..." and 0 with a real value before running.
# Not marked required or optional on the vendor's page, so sent here with a placeholder: timeFrom, timeTo, dataIncluded. Leave out any the call does not need.
curl -X POST "https://demo.trading212.com/api/v0/equity/history/exports" \
  -u "$T212_API_KEY:$T212_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"timeFrom": "...", "timeTo": "...", "dataIncluded": {}}'
```

## Response

A mock response. The values are invented, so check field names against the [official reference](https://docs.trading212.com/api).

```json
{
  "_mock": true,
  "reportId": 700001
}
```

## Limits that apply at Trading 212

- Headline limit: 1 req/5s, account summary (example)
  - Scope: account
  - Status: verified. Source: [docs.trading212.com](https://docs.trading212.com/api/section/rate-limiting), checked 2026-10-12.
  - Note: Limits are set per endpoint and applied per account; this is the account summary example from the docs, not a single global figure. A different endpoint on the same docs page carries a much higher limit, order placement (POST market order) at 50 requests a minute, about one call every 1.2 seconds, shown elsewhere on this site's re-verified note dated 23 Sep 2026. The two figures are not a contradiction: they are two different endpoints on one rate-limiting page, read account summary 22 Sep 2026 and order placement 23 Sep 2026. Build a rate limiter against the endpoint you actually call, not against either figure alone.

## More on the Trading 212 API

- [All Trading 212 API endpoints](https://openbrokerapi.com/brokers/trading-212/endpoints): 16 documented, grouped by what they do.
- [Trading 212 API quickstart](https://openbrokerapi.com/brokers/trading-212/quickstart)
- [All Trading 212 API error codes](https://openbrokerapi.com/errors/trading-212)
- [Trading 212 API page](https://openbrokerapi.com/brokers/trading-212): The full record: access, authentication, limits and the source for each.
- [Trading 212 API as an OpenAPI file](https://openbrokerapi.com/specs/trading-212.json): Generated from these endpoint records. Independent and unofficial.

## Licence and how to cite

The records behind this page are all rights reserved. This file is the page itself, at its own address, in another format. It is not part of the CC BY 4.0 downloads listed at https://openbrokerapi.com/data. Quote from it with a link to the page.

Cite as: Trading 212 API POST /api/v0/equity/history/exports. Broker API Hub, https://openbrokerapi.com/brokers/trading-212/endpoints/post-history-exports, newest check 2026-10-12.

Where you rely on a single figure, cite the source and the checked date printed beside it as well. Where this page and a broker's own documentation differ, the documentation wins.
