Trading 212 API for Openclaw

A comprehensive integration for programmatically managing Trading 212 accounts, executing trades, and retrieving financial metadata.

tsvetelin-kulinski
v1.0.0
Feb 3, 2026
2
2.7k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install trading212-api

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install trading212-api using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Trading 212 API?

The Trading 212 API skill provides a powerful interface for developers to interact with their Invest and Stocks ISA accounts. It enables seamless execution of various order types, real-time monitoring of portfolio performance, and deep access to instrument metadata. Designed as a core component of Openclaw Skills, this integration simplifies the complexities of financial API authentication and rate limiting.

Whether you are building an automated trading bot or a custom portfolio dashboard, this skill handles the heavy lifting of ticker lookups, environment-specific credential management, and historical data pagination. It supports both DEMO and LIVE environments, ensuring you can test your logic with paper money before committing real funds to the market.

Trading 212 API Use Cases

  • Automating market and limit orders for stocks and ETFs based on custom triggers.
  • Generating CSV reports for dividends and transactions to simplify tax season.
  • Monitoring unrealized profit and loss across multiple account types in real-time.
  • Building custom alerts for exchange hours and instrument price movements.
  • Performing bulk ticker lookups and metadata analysis using cached instrument data.

How Trading 212 API Works

  1. The skill authenticates with the Trading 212 API using a Base64-encoded Basic Auth header derived from your API Key and Secret.
  2. It determines the target environment (Demo or Live) and resolves the appropriate base URL for API requests.
  3. For instrument queries, the skill checks a local cache file to minimize API calls and respect the 50-second rate limit.
  4. When placing orders, the skill performs pre-order validation by checking available cash or existing position quantities.
  5. It processes paginated historical data using cursor-based navigation to retrieve complete sets of orders, dividends, or transactions.
  6. All responses are parsed and presented in a structured format, allowing for further automation or reporting.

Trading 212 API Setup

To get started with this skill within Openclaw Skills, set your environment variables as follows:

# Standard configuration
export T212_API_KEY="your_api_key_id"
export T212_API_SECRET="your_api_secret"
export T212_ENV="demo" # Use "live" for real money

# Optional: Account-specific keys for simultaneous Invest and ISA management
export T212_API_KEY_INVEST="invest_key"
export T212_API_SECRET_INVEST="invest_secret"
export T212_API_KEY_STOCKS_ISA="isa_key"
export T212_API_SECRET_STOCKS_ISA="isa_secret"

Trading 212 API Data Schema & Taxonomy

The skill organizes data into several primary schemas for clarity and ease of use:

Object Key Fields Description
Account Summary totalValue, cash, investments Overall financial status and available liquidity.
Orders ticker, quantity, limitPrice, status Details for market, limit, stop, and stop-limit orders.
Positions averagePricePaid, currentPrice, fxImpact Real-time tracking of owned shares and performance.
Instruments isin, shortName, workingScheduleId Metadata for stocks, ETFs, and crypto assets.
History items, nextPagePath Paginated logs for dividends, orders, and transactions.

Trading 212 API Advanced Features

  • Intelligent caching of instrument metadata to /tmp/t212_instruments.json to avoid rate limit throttling.
  • Support for extended hours trading on compatible instruments during pre-market and after-hours sessions.
  • Dual-account resolution logic that identifies whether to target Invest or Stocks ISA accounts based on context.
  • Automated CSV report generation and polling for bulk data exports via AWS S3 download links.
  • Paced request execution strategy to prevent API bursts and maintain high uptime.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*