接口文档研读 · 现货

独立教程与工具 · 非 Gate 官方网站

API REFERENCE / 现货

Gate 现货市场成交记录与翻页:参数、响应与查询工具

查询现货交易对的公开成交序列,用成交编号、时间、方向、价格和数量还原市场记录。

文档标注免认证 GET固定规格 v4.106.132资料核对:2026-09-10
GET /spot/trades

这条查询解决什么问题

指定 last_id 会使时间范围参数被忽略,且公共接口不返回个人手续费或关联订单等私有字段。

这是公开数据的读取接口说明。行情、合约与市场状态会变化,字段定义与返回数据应分开核对。

查看官方英文说明

Query market transaction records

Supports querying by time range using `from` and `to` parameters or pagination based on `last_id`. By default, queries the last 30 days. Pagination based on `last_id` is no longer recommended. If `last_id` is specified, the time range query parameters will be ignored. When using limit&page pagination to retrieve data, the maximum number of pages is 100,000, that is, limit * (page - 1) <= 100,000.

请求参数逐项核对

字段名和数据类型保留官方拼写。必填标记来自规格;描述中的条件约束还需要一起检查。

参数与位置类型与范围官方字段说明
currency_pairquery · 必填string
Currency pair
limitquery · 可选integer格式:"int32";默认:100;最小:1;最大:1000
Maximum number of items returned in list. Default: 100, minimum: 1, maximum: 1000
last_idquery · 可选string
Use the ID of the last record in the previous list as the starting point for the next list Operations based on custom IDs can only be checked when orders are pending. After orders are completed (filled/cancelled), they can be checked within 1 hour after completion. After expiration, only order IDs can be used
reversequery · 可选boolean默认:false
Whether to retrieve data less than `last_id`. Default returns records greater than `last_id`. Set to `true` to trace back market trade records, `false` to get latest trades. No effect when `last_id` is not set.
fromquery · 可选integer格式:"int64"
Start timestamp for the query
toquery · 可选integer格式:"int64"
End timestamp for the query, defaults to current time if not specified
pagequery · 可选integer格式:"int32";默认:1;最小:1
Page number

在本页组装查询 URL

填写参数后生成一个 GET 地址,只在浏览器本地处理。留空的可选项不会发送。请勿填写密码、API Key 或 Secret。

query · string
query · integer格式:"int32";默认:100;最小:1;最大:1000
query · string
query · boolean默认:false
query · integer格式:"int64"
query · integer格式:"int64"
query · integer格式:"int32";默认:1;最小:1
尚未生成 URL。

不会向 Gate 或本站发送表单内容。

工具检查必填、枚举与简单数值范围,不代替服务端校验。复合参数、时间窗口、条件必填等请对照上方原文。

响应字段怎样阅读

以下展示的是规格中的类型定义,不是现场 API 响应,也不是行情样本。嵌套结构展开至三层;数组的 [] 表示其中一个元素。

HTTP 200 · List retrieved successfully

字段路径数据类型字段说明
$array<object>
未提供字段注释
$[]object
未提供字段注释
$[].idstring
Fill ID
$[].create_timestring
Fill Time
$[].create_time_msstring
Trading time, with millisecond precision
$[].currency_pairstring
Currency pair
$[].sidestring枚举:buy / sell
Buy or sell order
$[].rolestring枚举:taker / maker
Trade role, not returned in public endpoints
$[].amountstring
Trade amount
$[].pricestring
Order price
$[].order_idstring
Related order ID, not returned in public endpoints
$[].feestring
Fee deducted, not returned in public endpoints
$[].fee_currencystring
Fee currency unit, not returned in public endpoints
$[].point_feestring
Points used to deduct fee, not returned in public endpoints
$[].gt_feestring
GT used to deduct fee, not returned in public endpoints
$[].amend_textstring
The custom data that the user remarked when amending the order
$[].sequence_idstring
Consecutive trade ID within a single market. Used to track and identify trades in the specific market
$[].textstring
Order's Custom Information. This field is not returned by public interfaces. The scenarios pm_liquidate, comb_margin_liquidate, and scm_liquidate represent full-account forced liquidation orders. liquidate represents isolated-account forced liquidation orders.
$[].dealstring
Total Executed Value
$[].trade_quotestring
Actual quote currency used for the trade

来源、版本与使用说明

本站独立整理 Gate 技术资料,不代表 Gate,不提供账户、交易、充值或软件下载服务。

参数和字段改编自 Gate 官方 SDK 的 Apache 2.0 开放规格,固定版本为 v4.106.132。核对时官网文档已为 v4.106.136,后续变更须以官网为准;本页并未声称对该接口做过在线实测。

中文用途解释、字段阅读界面和本地 URL 组装器由本站整理。访问日志用于站点运维;页面没有第三方统计脚本,表单参数仅在当前页面内存中处理。