闲社服务运行正常AI智能体自动化平台
e

eToro API交互

技能标识:etoro-api

Enables agents to interact with the eToro API to access market data, portfolio and social features, and execute trades programmatically.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

eToro API交互

eToro 公共 API

基础 URL:https://public-api.etoro.com/api/v1

关于

此技能允许以编程方式与用户的 eToro 账户进行交互,包括执行交易。

认证与必需请求头

密钥(安装时向用户索取)

  • - 公共 API 密钥:应用程序
  • 用户密钥:用户账户
  • 环境:真实投资组合或虚拟投资组合(真实/演示)

密钥生成(面向用户):

  1. 1. 登录 eToro。
  2. 设置 > 交易。
  3. 创建新密钥。
  4. 选择环境(真实或虚拟/演示)和权限(读取或写入)。
  5. 验证身份并复制生成的用户密钥。

请求头(每个请求):

  • - x-request-id:每个请求的唯一 UUID
  • x-api-key:公共 API 密钥(KEY>)
  • x-user-key:用户密钥(KEY>)

示例:

bash
curl -X GET https://public-api.etoro.com/api/v1/watchlists \
-H x-request-id: \
-H x-api-key: \
-H x-user-key:

请求约定

  • - 以下所有路径均相对于基础 URL(已包含 /api/v1)。
示例:GET /watchlists 表示 GET https://public-api.etoro.com/api/v1/watchlists。
  • - 查询参数放在 URL 中,路径参数放在 URL 路径中。
  • 对于文档中标记为 array 的查询参数,请以逗号分隔值的形式发送(例如,instrumentIds=1001,1002)。
  • 分页模式因端点而异:
- 搜索:pageNumber、pageSize - 用户搜索与交易历史:page、pageSize - 动态:take、offset - 自选列表项列表:pageNumber、itemsPerPage
  • - 请求体中的大小写很重要:
- 交易执行使用帕斯卡命名法字段(例如,InstrumentID、IsBuy、Leverage)。 - 市价平仓请求体使用 InstrumentId(大写 I,小写 d)。 - 自选列表项使用 ItemId、ItemType、ItemRank。 - 动态发布请求体使用小驼峰命名法(owner、message、tags、mentions、attachments)。
  • - 某些响应可能对类似概念使用不同的大小写(例如,instrumentId 与 InstrumentID)。提取 ID 时,如果两者都存在,请一并处理。

演示与真实交易

  • - 使用演示执行端点(包含 /demo/)进行测试和模拟交易。
  • 使用非演示执行端点进行真实交易。
  • 对于投资组合/盈亏:
- 演示:/trading/info/demo/* - 真实:/trading/info/portfolio 和 /trading/info/real/pnl
  • - 确保您的密钥环境与端点匹配(虚拟与真实)。每个用户密钥都与特定环境相关联。

使用默认值

  • - 重要提示:您无需指定所有参数。例如,如果用户未指定杠杆,则不要在 API 请求中发送它。

快速入门(演示交易)

  1. 1. 使用搜索解析 instrumentId。
搜索请求中需要 fields。

bash
curl -X GET https://public-api.etoro.com/api/v1/market-data/search?internalSymbolFull=BTC&fields=instrumentId,internalSymbolFull,displayname \
-H x-api-key: \
-H x-user-key: \
-H x-request-id:

  1. 2. 按金额下达演示市价单(帕斯卡命名法请求体):

bash
curl -X POST https://public-api.etoro.com/api/v1/trading/execution/demo/market-open-orders/by-amount \
-H x-api-key: \
-H x-user-key: \
-H x-request-id: \
-H Content-Type: application/json \
-d {
InstrumentID: 100000,
IsBuy: true,
Leverage: 1,
Amount: 100
}

通用 ID

  • - instrumentId:来自搜索或工具元数据
  • positionId:来自投资组合端点
  • orderId:来自执行响应或投资组合端点
  • marketId:由工具动态端点使用(通常可在工具元数据/搜索字段中找到)
  • userId:数字型 eToro 用户 ID(在响应中常称为 CID;可通过用户端点/搜索发现)
  • watchlistId:来自自选列表列表/创建端点

市场数据(请求)

搜索工具

  • - GET /market-data/search
  • 必需查询:fields(要返回的工具字段的逗号分隔列表)
  • 可选:searchText、pageSize、pageNumber、sort
  • 搜索端点支持按返回结果中的字段进行过滤;如需精确查找代码,请使用 internalSymbolFull 作为查询参数并验证精确匹配。
  • 需要 ID 时的推荐最小 fields:包含工具标识符(可能显示为 instrumentId 或 InstrumentID),加上 internalSymbolFull 和 displayname(如果计划使用动态,还需加上 marketId)。

元数据

  • - GET /market-data/instruments
过滤器:instrumentIds、exchangeIds、stocksIndustryIds、instrumentTypeIds。

价格与历史

  • - GET /market-data/instruments/rates
必需:instrumentIds(逗号分隔)。
  • - GET /market-data/instruments/history/closing-price
返回所有工具的收盘价历史(批量)。
  • - GET /market-data/instruments/{instrumentId}/history/candles/{direction}/{interval}/{candlesCount}
direction:asc 或 desc。candlesCount 最大 1000。 仅使用支持的 interval 值(如有疑问,请通过文档确认)。

参考数据

  • - GET /market-data/exchanges(可选 exchangeIds)
  • GET /market-data/instrument-types
  • GET /market-data/stocks-industries(可选 stocksIndustryIds)

交易执行(请求)

需要具有适当权限(通常为写入)和正确环境(演示与真实)的密钥。

市价开仓单(按金额)

端点:

  • - POST /trading/execution/demo/market-open-orders/by-amount
  • POST /trading/execution/market-open-orders/by-amount

请求体(帕斯卡命名法,JSON):

  • - 必需: InstrumentID、IsBuy、Leverage、Amount
  • 可选: StopLossRate、TakeProfitRate、IsTslEnabled、IsNoStopLoss、IsNoTakeProfit

市价开仓单(按单位)

端点:

  • - POST /trading/execution/demo/market-open-orders/by-units
  • POST /trading/execution/market-open-orders/by-units

请求体(帕斯卡命名法,JSON):

  • - 必需: InstrumentID、IsBuy、Leverage、AmountInUnits
  • 可选: StopLossRate、TakeProfitRate、IsTslEnabled、IsNoStopLoss、IsNoTakeProfit

取消市价开仓单

端点:

  • - DELETE /trading/execution/demo/market-open-orders/{orderId}
  • DELETE /trading/execution/market-open-orders/{orderId}

市价平仓单

端点:

  • - POST /trading/execution/demo/market-close-orders/positions/{positionId}
  • POST /trading/execution/market-close-orders/positions/{positionId}
  • DELETE /trading/execution/demo/market-close-orders/{orderId}
  • DELETE /trading/execution/market-close-orders/{orderId}

请求体(JSON):

  • - 必需: InstrumentId
  • 可选: UnitsToDeduct(数字或 null)

部分平仓:设置 UnitsToDeduct。
全部平仓:将 UnitsToDeduct 设置为 null

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 etoro-api-1776308650 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 etoro-api-1776308650 技能

通过命令行安装

skillhub install etoro-api-1776308650

下载

⬇ 下载 etoro-api v1.0.0(免费)

文件大小: 4.49 KB | 发布时间: 2026-4-16 17:22

v1.0.0 最新 2026-4-16 17:22
Initial release of the etoro-api skill, providing programmatic access to eToro's trading and market data API.

- Enables agents to access eToro market data, portfolio information, and social features.
- Supports executing trades, including buy/sell orders, using demo or real accounts.
- Includes detailed authentication and key management instructions.
- Covers endpoints for searching instruments, managing watchlists, and retrieving trading history.
- Provides request conventions, parameter casing, and guidelines for using both demo and real environments.
返回顶部