Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

trading212-api

БесплатноБез исполняемых скриптовНе проверен

This skill should be used when the user asks to "connect to Trading 212", "authenticate Trading 212 API", "place a trade", "buy stock", "sell shares", "place…

bighardpersonот bighardperson★ 71 звезда на GitHub

Об этом скилле

Trading 212 API

Note: The Trading 212 API is currently in beta and under active development. Some endpoints or behaviors may change.

Quick Reference

Environments

Environment Base URL Purpose
Demo https://demo.trading212.com/api/v0 Paper trading - test without real funds
Live https://live.trading212.com/api/v0 Real money trading

Order Quantity Convention

  • Positive quantity = BUY (e.g., 10 buys 10 shares)
  • Negative quantity = SELL (e.g., -10 sells 10 shares)

Account Types

Only Invest and Stocks ISA accounts are supported.

Instrument Identifiers

Trading 212 uses custom tickers as unique identifiers for instruments. Always search for the Trading 212 ticker before making instrument requests.


Authentication

HTTP Basic Auth with API Key (username) and API Secret (password).

Check Existing Setup First

Before guiding the user through authentication setup, check if credentials are already configured:

Semantic rule: Credentials are configured when at least one complete set is present: a complete set is key + secret for the same account (e.g. T212_API_KEY + T212_API_SECRET, or T212_API_KEY_INVEST + T212_API_SECRET_INVEST, or T212_API_KEY_STOCKS_ISA + T212_API_SECRET_STOCKS_ISA). You do not need all four account-specific vars; having only the Invest pair or only the Stocks ISA pair is enough. Check for any combination that gives at least one usable key+secret pair.

# Example: configured if any complete credential set exists
if [ -n "$T212_AUTH_HEADER" ] && [ -n "$T212_BASE_URL" ]; then
  echo "Configured (derived vars)"
elif [ -n "$T212_API_KEY" ] && [ -n "$T212_API_SECRET" ]; then
  echo "Configured (single account)"
elif [ -n "$T212_API_KEY_INVEST" ] && [ -n "$T212_API_SECRET_INVEST" ]; then
  echo "Configured (Invest); Stocks ISA also if T212_API_KEY_STOCKS_ISA and T212_API_SECRET_STOCKS_ISA are set"
elif [ -n "$T212_API_KEY_STOCKS_ISA" ] && [ -n "$T212_API_SECRET_STOCKS_ISA" ]; then
  echo "Configured (Stocks ISA); Invest also if T212_API_KEY_INVEST and T212_API_SECRET_INVEST are set"
else
  echo "No complete credential set found"
fi

If any complete set is present, skip the full setup and proceed with API calls; when making requests, use the resolution order in "Making Requests" below (pick the pair that matches the user's account context when multiple sets exist). Do not ask the user to run derivation one-liners or merge keys into a header. Only guide users through the full setup process below when no complete credential set exists.

Important: Before making any API calls, always ask the user which environment they want to use: LIVE (real money) or DEMO (paper trading). Do not assume the environment.

API Keys Are Environment-Specific

API keys are tied to a specific environment and cannot be used across environments.

API Key Created In Works With Does NOT Work With
LIVE account live.trading212.com demo.trading212.com
DEMO account demo.trading212.com live.trading212.com

If you get a 401 error, verify that:

  1. You're using the correct API key for the target environment
  2. The API key was generated in the same environment (LIVE or DEMO) you're trying to access

Get Credentials

  1. Decide which environment to use - LIVE (real money) or DEMO (paper trading)
  2. Open Trading 212 app (mobile or web)
  3. Switch to the correct account - Make sure you're in LIVE or DEMO mode matching your target environment
  4. Navigate to Settings > API
  5. Generate a new API key pair - you'll receive:
    • API Key (ID) (e.g., 35839398ZFVKUxpHzPiVsxKdOtZdaDJSrvyPF)
    • API Secret (e.g., 7MOzYJlVJgxoPjdZJCEH3fO9ee7A0NzLylFFD4-3tlo)
  6. Store the credentials separately for each environment if you use both

Building the Auth Header

Combine your API Key (ID) and Secret with a colon, base64 encode, and prefix with Basic for the Authorization header.

Optional: To precompute the header from key/secret, you can set:

export T212_AUTH_HEADER="Basic $(echo -n "$T212_API_KEY:$T212_API_SECRET" | base64)"

Otherwise, the agent builds the header from T212_API_KEY and T212_API_SECRET when making requests.

Manual (placeholders):

# Format: T212_AUTH_HEADER = "Basic " + base64(API_KEY_ID:API_SECRET)
export T212_AUTH_HEADER="Basic $(echo -n "<YOUR_API_KEY_ID>:<YOUR_API_SECRET>" | base64)"

# Example with sample credentials:
export T212_AUTH_HEADER="Basic $(echo -n "35839398ZFVKUxpHzPiVsxKdOtZdaDJSrvyPF:7MOzYJlVJgxoPjdZJCEH3fO9ee7A0NzLylFFD4-3tlo" | base64)"

Making Requests

When making API calls,

Полный SKILL.md на GitHub

Установить trading212-api в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_meta.json_skillhub_meta.json

FAQ

Что делает скилл trading212-api?

This skill should be used when the user asks to "connect to Trading 212", "authenticate Trading 212 API", "place a trade", "buy stock", "sell shares", "place market order",, "place pending order", "place limit order", "cancel order", "check my balance", "view account summary", "get positions", "view portfolio", "check P&L", "find ticker symbol", "search instruments", "check trading hours", "view dividends", "get order history", "export transactions", "generate CSV report", or needs guidance on Trading 212 API authentication, order placement, position monitoring, account information, instrument lookup, or historical data retrieval.

Как установить скилл trading212-api?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл trading212-api запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить trading212-api с