Export Trading 212 Data, Trading 212 CSV Export, How to Download Your Trading 212 Statement, Trading 212 Data Export to Excel
Learn how to use the Trading 212 API to access your portfolio data, export Trading 212 CSVs, and connect your account to Excel, Google Sheets, or Python. A practical guide for investors who want more from their data.
On this page (15)
If you use Trading 212 to invest in stocks, ETFs, or fractional shares, you already know the platform is clean, intuitive, and genuinely beginner-friendly. But at some point, most serious investors want to go further — pulling their data into spreadsheets, automating portfolio checks, or building custom dashboards. That is where the Trading 212 API and its built-in data export tools become genuinely powerful. This guide walks you through exactly how both work, what you can do with them, and how to get the most out of your Trading 212 data — whether you are comfortable writing a few lines of Python or you just want a clean CSV file to open in Excel.
What Is the Trading 212 API and Is It Free?
The Trading 212 public API is a REST API that allows you to programmatically access your account data, portfolio positions, transaction history, dividends, and more. As of late 2025, Trading 212 expanded the API to support live accounts and even allows you to place market orders directly through it — a significant step up from the earlier practice-mode-only version.
The good news for most investors: the Trading 212 API is free to use. There is no subscription tier or paid developer plan required. You simply generate an API key from within your Trading 212 account and start making requests. The API follows standard REST conventions, returns data in JSON format, and is documented at docs.trading212.com.
It is worth noting that the API is still evolving. Trading 212 has described it as being in a beta phase with major upgrades planned, so some features and endpoints may change over time. Always check the official documentation for the most current endpoint structure.
How to Get Your Trading 212 API Key
Getting your Trading 212 API key is straightforward, but there are a couple of things to be aware of before you start:
- Log in to your Trading 212 account via the web platform (not the mobile app — some users have reported that the iOS app does not always display the Secret Key at creation time).
- Navigate to your account settings and look for the API section.
- Click to generate a new API key. You will be given both an API Key ID and a Secret Key.
- Copy and store your Secret Key immediately. For security reasons, Trading 212 only shows the Secret Key once — at the moment of creation. If you miss it, you will need to delete the key and generate a new one.
- You can configure the key's permissions (scopes) at creation time, such as read-only access to account data, or broader access including order execution.
- You can also restrict the key to specific IP addresses for added security.
Once you have your credentials, authentication uses HTTP Basic Auth — your API Key ID as the username and your Secret Key as the password, encoded in Base64.
How to Use the Trading 212 API: A Practical Overview
The Trading 212 REST API is organised around a set of endpoints that map to different parts of your account. Here is a practical breakdown of what you can access:
Key Endpoints
- Portfolio positions:
/api/v0/equity/portfolio— returns all your current open positions, including quantities and average prices. - Account info:
/api/v0/equity/account/info— returns basic account details including cash balance. - Historical orders: endpoints under
/api/v0/equity/history/orders— lets you pull your full order history. - Dividends: historical dividend data is accessible via the history endpoints.
- Instruments metadata:
/api/v0/equity/metadata/instruments— useful for mapping Trading 212's internal ticker format (e.g.AAPL_US_EQ) to standard ticker symbols. - Market orders: as of October 2025, you can place live market orders via the API — a major addition for those building automated strategies.
Trading 212 API Rate Limits
All endpoints are subject to rate limits to ensure fair usage and platform stability. The rate limiter operates on a burst model — for example, an endpoint with a limit of 50 requests per minute does not mean you are restricted to one request every 1.2 seconds. You can make requests in bursts, as long as you do not exceed the total allowance within the time window. Always check the official Trading 212 API documentation for the specific limits per endpoint, as these can vary.
A Simple Trading 212 API Python Example
Here is a minimal working example in Python to retrieve your portfolio positions. You will need the requests library and your API credentials:
import requests
import base64
api_key = "YOUR_API_KEY_ID"
api_secret = "YOUR_SECRET\_KEY"
credentials_string = f"{api_key}:{api\_secret}"
encoded_credentials = base64.b64encode(credentials_string.encode('utf-8')).decode('utf-8')
header = f"Basic {encoded\_credentials}"
url = "https://live.trading212.com/api/v0/equity/portfolio"
response = requests.get(url, headers={"Authorization": header})
data = response.json()
print(data)
This returns a JSON object with all your open positions. From here, you can parse the data, load it into a pandas DataFrame, export it to CSV, or feed it into any analysis tool you choose. If you are working with a demo account, replace live.trading212.com with demo.trading212.com.
One practical note: Trading 212 uses its own internal ticker format (such as AAPL_US_EQ for Apple (AAPL) or TSLA_US_EQ for Tesla (TSLA)). If you need standard ticker symbols for cross-referencing with other data sources, use the /instruments/metadata endpoint to build a mapping dictionary.
How to Export Trading 212 Data Without the API
Not everyone wants to write code, and that is completely fine. Trading 212 has a built-in CSV export feature that covers most common use cases — from tax reporting to personal record-keeping. Here is how to use it:
- Open the Trading 212 app or web platform and go to the Menu.
- Select History.
- Tap or click the export icon.
- Choose your timeframe — you can select a custom date range or a preset period.
- Select the data types you want to include: orders, transactions, dividends, and more.
- The file will be downloaded to your device as a .csv file.
This CSV export is the simplest way to get a Trading 212 statement download for a specific period. It is particularly useful for annual tax statements, dividend income tracking, or importing your transaction history into a spreadsheet tool like Excel or Google Sheets.
Importing Your Trading 212 CSV into Excel or Google Sheets
Once you have your CSV file, opening it in Excel is as simple as using File → Open and selecting the file. In Google Sheets, you can go to File → Import and upload the CSV directly. From there, you can use standard spreadsheet formulas to calculate total returns, dividend income, average cost basis, or any other metric you care about. For more advanced analysis — such as comparing your portfolio's performance against a benchmark — you may want to combine this data with external market data sources.
Connecting Trading 212 Data to External Tools
Once you have your data — whether via the API or a CSV export — the question becomes: what do you do with it? Here are the most practical options for investors who want to go beyond the Trading 212 app itself:
Google Sheets via the API
Using Google Apps Script, you can call the Trading 212 API directly from a Google Sheet and populate cells with live portfolio data. This is a popular approach for investors who want a lightweight, always-updated dashboard without building a full application. The script would use the same Basic Auth approach described above, making a fetch request to the relevant endpoint and writing the response data into your sheet.
Excel via Power Query
Excel's Power Query feature can connect to REST APIs and import JSON data. You can set up a query that calls the Trading 212 API and refreshes your portfolio data on demand — no coding required beyond the initial setup. Alternatively, you can simply import your CSV export and use Power Query to clean and transform the data.
Third-Party Portfolio Trackers
Several portfolio tracking platforms support Trading 212 data import, either by accepting the CSV export format or by connecting directly via the API. When evaluating these tools, look for ones that support dividend tracking, performance attribution, and tax reporting — the three areas where Trading 212's native interface has historically been limited.
Custom Python Scripts and Dashboards
For investors comfortable with Python, the API opens up a wide range of possibilities: automated daily portfolio snapshots, alerts when a position moves beyond a threshold, or integration with financial data libraries like yfinance to enrich your Trading 212 data with fundamental metrics. Libraries built specifically for the Trading 212 API are also available on GitHub and PyPI, which can simplify authentication and response handling.
Common Issues with the Trading 212 API and How to Fix Them
If you find the Trading 212 API not working as expected, the most common causes are:
- 401 Unauthorized errors: Almost always caused by incorrect Base64 encoding of your credentials. On Linux/Mac, make sure to use
base64 -w 0to disable line wrapping, which can corrupt the encoded string. On Windows, the default Base64 encoding typically does not add line breaks. - Missing Secret Key: If you generated your API key on the iOS app and did not see a Secret Key, delete the key and regenerate it via the web platform.
- Non-standard ticker formats: Trading 212 uses internal ticker identifiers (e.g.
MSFT_US_EQfor Microsoft (MSFT)). Use the instruments metadata endpoint to map these to standard symbols. - Rate limit errors: If you are hitting rate limits, add delays between requests or implement exponential backoff in your code.
- Scope restrictions: If you are getting permission errors on certain endpoints, check that your API key was created with the appropriate scopes enabled.
Conclusion: Getting More From Your Trading 212 Data
The Trading 212 API and its CSV export feature together give investors a meaningful degree of control over their own financial data. Whether you want to build a live Python dashboard, pull your transaction history into a spreadsheet for tax purposes, or connect your portfolio to a third-party analytics tool, the infrastructure is there — and it is free to use. The API is still maturing, with Trading 212 continuing to add endpoints and capabilities, so it is worth keeping an eye on the official documentation and community updates as the platform evolves. For investors who want to move beyond the app and into serious portfolio analysis, understanding how to extract and work with your own data is one of the most practical skills you can develop.
You can Compare AAPL, TSLA, MSFT side by side on Openbook, or find stocks with the screener.