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.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install trading212-api或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install trading212-api⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/trading212-api/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: trading212-api description: '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.' license: MIT License metadata: author: Trading 212 version: 1.0.0 ---
> Note: The Trading 212 API is currently in beta and under active development. Some endpoints or behaviors may change.
| 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 |
10 buys 10 shares)-10 sells 10 shares)Only Invest and Stocks ISA accounts are supported.
Trading 212 uses custom tickers as unique identifiers for instruments. Always search for the Trading 212 ticker before making instrument requests.
---
HTTP Basic Auth with API Key (username) and API Secret (password).
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 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:
- API Key (ID) (e.g., 35839398ZFVKUxpHzPiVsxKdOtZdaDJSrvyPF) - API Secret (e.g., 7MOzYJlVJgxoPjdZJCEH3fO9ee7A0NzLylFFD4-3tlo)
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)"
When making API calls, use the first option that applies (semantically: pick the credential set that matches the user's account, or the only set present):
T212_AUTH_HEADER and T212_BASE_URL are set: use them in requests.T212_API_KEY and T212_API_SECRET are set: use this pair (single account). Build header as Basic $(echo -n "$T212_API_KEY:$T212_API_SECRET" | base64) and base URL as https://${T212_ENV:-live}.trading212.com. Do not guide the user to derive or merge; you do it.T212_API_KEY_INVEST/T212_API_SECRET_INVEST and T212_API_KEY_STOCKS_ISA/T212_API_SECRET_STOCKS_ISA): the user must clearly specify which account to target (Invest or Stocks ISA), unless they ask for information for all accounts. Use the Invest pair when the user refers to Invest, and the Stocks ISA pair when the user refers to ISA/Stocks ISA. If the user wants information for all accounts, make multiple API calls—one per account (Invest and Stocks ISA)—and present or aggregate the results for both. If it is not clear from context which account to use (and they did not ask for all accounts), ask for confirmation before making API calls (e.g. "Which account should I use — Invest or Stocks ISA?"). Do not assume. Build the header from the chosen key/secret and base URL as https://${T212_ENV:-live}.trading212.com.T212_API_KEY_INVEST and T212_API_SECRET_INVEST): use this pair for requests; if the user asks about Stocks ISA, only the Invest account is configured.T212_API_KEY_STOCKS_ISA and T212_API_SECRET_STOCKS_ISA): use this pair for requests; if the user asks about Invest, only the Stocks ISA account is configured.Use the T212_AUTH_HEADER value in the Authorization header when it is set:
# When T212_AUTH_HEADER and T212_BASE_URL are set:
curl -H "Authorization: $T212_AUTH_HEADER" \
"${T212_BASE_URL}/api/v0/equity/account/summary"
When only primary vars are set, use the inline form in the curl:
...
安装 Trading212 API 后,可以对 AI 说这些话来触发它
Help me get started with Trading212 API
Explains what Trading212 API does, walks through the setup, and runs a quick demo based on your current project
Use Trading212 API to this skill should be used when the user asks to "connect to Trading...
Invokes Trading212 API with the right parameters and returns the result directly in the conversation
What can I do with Trading212 API in my finance & investment workflow?
Lists the top use cases for Trading212 API, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/trading212-api/ 目录(个人级,所有项目可用),或 .claude/skills/trading212-api/(项目级)。重启 AI 客户端后,用 /trading212-api 主动调用,或让 AI 根据上下文自动发现并使用。
Trading212 API 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
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.
Automate my finance & investment tasks using Trading212 API
Identifies repetitive steps in your workflow and sets up Trading212 API to handle them automatically
Trading212 API 属于「Finance & Investment」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。