### Check Specific Portfolio Position via Trading212 API Source: https://context7_llms This snippet provides an example of a GET request to retrieve details for a specific open position in the portfolio using its ticker symbol. This allows users to query individual holdings directly. ```APIDOC GET /api/v0/equity/portfolio/AAPL_US_EQ ``` -------------------------------- ### Place a Market Order using Trading212 API Source: https://context7_llms This snippet demonstrates the JSON payload required to place a market order for a specified ticker and quantity via the Trading212 API. Market orders are executed immediately at the best available price. ```JSON POST /api/v0/equity/orders/market { "ticker": "AAPL_US_EQ", "quantity": 0.1 } ``` -------------------------------- ### Create a New Investment Pie using Trading212 API Source: https://context7_llms This snippet shows the JSON payload for creating a new investment pie, defining its name, instrument shares allocation, and the action for dividend cash (e.g., reinvestment). Pies allow for diversified portfolio management. ```JSON POST /api/v0/equity/pies { "name": "Tech Portfolio", "instrumentShares": { "AAPL_US_EQ": 0.5, "MSFT_US_EQ": 0.5 }, "dividendCashAction": "REINVEST" } ``` -------------------------------- ### Trading212 Instruments, Metadata, and Pie Management API Endpoints Source: https://context7_llms Provides API endpoints for retrieving tradeable instrument metadata, exchange schedules, and managing investment pies (portfolio buckets) including creation, retrieval, update, and deletion. These functionalities support diversified portfolio strategies. ```APIDOC Instruments & Metadata: GET /api/v0/equity/metadata/instruments - Description: List all tradeable instruments GET /api/v0/equity/metadata/exchanges - Description: Get exchanges and schedules Pies (Portfolio Buckets) Management: GET /api/v0/equity/pies - Description: List all pies POST /api/v0/equity/pies - Description: Create new pie GET /api/v0/equity/pies/{id} - Description: Get pie details POST /api/v0/equity/pies/{id} - Description: Update pie DELETE /api/v0/equity/pies/{id} - Description: Delete pie ``` -------------------------------- ### Place a Limit Order using Trading212 API Source: https://context7_llms This snippet illustrates the JSON payload for placing a limit order, specifying a ticker, quantity, a limit price, and time validity. Limit orders are executed only at the specified price or better. ```JSON POST /api/v0/equity/orders/limit { "ticker": "AAPL_US_EQ", "quantity": 0.1, "limitPrice": 100.23, "timeValidity": "DAY" } ``` -------------------------------- ### Trading212 Public API General Information and Authentication Source: https://context7_llms Provides an overview of the Trading212 Public API, including environment URLs, authentication requirements, and general rate limits applicable across various endpoints. It also details common error codes and required API key scopes for access. ```APIDOC API Environments: - Demo: https://demo.trading212.com - Live: https://live.trading212.com Authentication: - Method: API key via Authorization header - Requirement: Required scopes vary by endpoint. Rate Limits: - Account info: 1 request per 30s - Orders: 1 request per 1-2s - Portfolio: 1 request per 5s - Historical data: 6 requests per minute - Exports: 1 request per 30s Common Error Codes: - 401: Bad API key - 403: Missing scope - 429: Rate limited Required Scopes: - account: Account information access - portfolio: Portfolio read access - orders:read: View orders - orders:execute: Place/cancel orders - pies:read: View pies - pies:write: Create/update/delete pies - metadata: Instrument information - history:orders: Order history - history:dividends: Dividend history - history:transactions: Transaction history Important Notes: - Ticker Format: Use format like "AAPL_US_EQ" (symbol_country_type) - Order Types: MARKET, LIMIT, STOP, STOP_LIMIT - Time Validity: DAY or GOOD_TILL_CANCEL - Fractional Shares: Supported (e.g., quantity: 0.1) - Currency: Account currency used for cash operations - Pagination: Use cursor parameter for paginated endpoints ``` -------------------------------- ### Trading212 Account and Portfolio Management API Endpoints Source: https://context7_llms Defines API endpoints for fetching account metadata, cash balances, listing open positions, and searching specific positions within the Trading212 platform. These endpoints provide essential information for managing user accounts and portfolios. ```APIDOC Account Management: GET /api/v0/equity/account/info - Description: Fetch account metadata (currency, ID) GET /api/v0/equity/account/cash - Description: Get cash balances (free, invested, blocked, total) Portfolio Management: GET /api/v0/equity/portfolio - Description: List all open positions GET /api/v0/equity/portfolio/{ticker} - Description: Get specific position (e.g., AAPL_US_EQ) POST /api/v0/equity/portfolio/ticker - Description: Search position by ticker ``` -------------------------------- ### Trading212 Order Management API Endpoints Source: https://context7_llms Details API endpoints for fetching, managing, and placing various types of orders, including market, limit, stop, and stop-limit orders on the Trading212 platform. This section covers the full lifecycle of order operations. ```APIDOC Order Management: GET /api/v0/equity/orders - Description: Fetch all orders GET /api/v0/equity/orders/{id} - Description: Get specific order DELETE /api/v0/equity/orders/{id} - Description: Cancel order POST /api/v0/equity/orders/market - Description: Place market order POST /api/v0/equity/orders/limit - Description: Place limit order POST /api/v0/equity/orders/stop - Description: Place stop order POST /api/v0/equity/orders/stop_limit - Description: Place stop-limit order ``` -------------------------------- ### Trading212 Historical Data API Endpoints Source: https://context7_llms Defines API endpoints for accessing historical data, including order history, dividend history, transaction history, and requesting CSV exports. These endpoints are crucial for analysis and record-keeping. ```APIDOC Historical Data: GET /api/v0/equity/history/orders - Description: Order history (paginated) GET /api/v0/history/dividends - Description: Dividend history GET /api/v0/history/transactions - Description: Transaction history POST /api/v0/history/exports - Description: Request CSV export ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.