Portfolio API: Getting Started
Integrate your portfolio data with external applications using the Consumer API. Create API keys, authenticate requests, and automate your investment workflows.
Last reviewed
Getting Started
What the Consumer API is and who can use it.
What Is the Consumer API?
The Portfolio Tracker Consumer API allows you to access your portfolio data programmatically. You can fetch holdings, record transactions, import broker statements, and receive real-time notifications via webhooks, all from your own scripts, spreadsheets, or third-party tools.
The API follows RESTful conventions and returns JSON responses. All endpoints are versioned under /api/v1/portfolio/ext/ to ensure stability as we add new features.
Who Can Use the API?
The Consumer API is included in selected subscription plans. The Subscription page shows which plans include it, and Rate Limits below lists each plan’s request allowance.
Note
What Can You Do with It?
The API gives you full programmatic access to your portfolio data. Common use cases include:
- Retrieve holdings: Fetch your current positions, market values, and gain/loss data
- Record transactions: Log buy, sell, and dividend transactions automatically
- Import statements: Upload broker statements for automatic parsing
- Set up webhooks: Receive notifications when a price alert triggers or a transaction is processed (on plans that include webhooks)
- Export data: Pull your portfolio data into spreadsheets, dashboards, or analytics tools
Authentication
How to create and use API keys to authenticate your requests.
Creating an API Key
API keys are created from the Developer hub. Each key is scoped to your account and can be revoked at any time.
- Open the Developer hub with the Go to Developer Hub button at the foot of this page (the Portfolio Tracker Developer page shows the same tools, so either route works)
- Click "Create key" and give your key a descriptive name (e.g. "My Spreadsheet Integration")
- Choose the scopes the key needs:
portfolio:readfor read-only access, orportfolio:writeto record changes - Copy the key immediately, because it will only be displayed once
- Store the key securely (e.g. in a password manager or environment variable)
Important
Using Your API Key
All API requests must include your key in the Authorization header using the Bearer scheme. Keys use a twai_ prefix so they are easy to identify in your code (older keys beginning pk_ keep working).
Example header:
Authorization: Bearer twai_your_api_key_here
Tip
Your First API Call
A step-by-step guide to making your first request.
Step-by-Step
Follow these steps to verify your API key is working and retrieve your holdings.
- Create an API key from the Developer hub (see Authentication above)
- Make a GET request to the holdings endpoint:
GET /api/v1/portfolio/ext/holdings/
Include your API key in theAuthorizationheader as described above - Check the response. A successful request returns a JSON object containing your holdings array along with summary data such as total market value and daily change
- If you receive a
401 Unauthorisedresponse, verify that your key is correct and has not been revoked
Tip
Rate Limits
Understand how request limits work for each plan tier.
Limits are counted on a sliding window. When you go over one, the API answers 429 Too Many Requests with a Retry-After header telling you how long to wait.
Document downloads
Each vault file or will PDF handed out, on top of the Consumer API budget.
- Every plan: 60 requests per hour
Shared by every key you hold, so a new key never adds to it. Scopes: documents:read.
These figures come from the limits the API enforces, also served as JSON at /api/v1/portfolio/rate-limits/.
Every response reports your allowance in the X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers, so an integration can pace itself. The Usage panel on the Developer Page breaks the hour down by key so you can find the integration spending it.
Tip
Common Workflows
Typical ways to use the Consumer API.
Popular Use Cases
Below are some of the most common workflows that API users set up. Each one is covered in detail in the Code Examples help page.
- Fetching holdings: Retrieve your current portfolio positions, including quantities, market values, and unrealised gains
- Recording transactions: Programmatically log buy, sell, and dividend transactions to keep your portfolio up to date
- Importing broker statements: Upload CSV or PDF statements from supported brokers for automatic parsing and reconciliation
- Setting up webhooks: Register callback URLs to receive real-time notifications when a transaction is created, a corporate action is detected, a price alert triggers, tax figures are recalculated, or an import completes (on plans that include webhooks)
Related Topics
Code Examples
Ready-to-use snippets in Python, JavaScript, and more
Connect an AI Agent
Hook an MCP client up to your portfolio
Webhook Reference
Set up real-time notifications for portfolio events
API Changelog
Track changes, deprecations, and new endpoints
API Documentation
Full endpoint reference with request and response schemas
Can’t find what you’re looking for?
Our support team is here to help. Contact us and we’ll get back to you as soon as possible.
Contact Support
