> For the complete documentation index, see [llms.txt](https://docs.gmgn.ai/cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gmgn.ai/cn/he-zuo-api-ji-cheng-gmgn-ethbasebsc-jiao-yi-api.md).

# 🤝🏻 合作-API：🕹集成GMGN ETH/Base/BSC交易API

✅ 若通过审核，GMGN会将API Key发送至你填写的邮箱\
❌ 若未通过审核，GMGN将不会发送任何信息通知

### 鉴权

* GMGN为我们的专业用户提供 SOL/BSC/Base/ETH 交易API，能否通过的唯一标准是你在GMGN是否有足够的交易量。审核将在提交后24小时内完成
* 访问GMGN Trade Api需申请使用权限，请填写以下google表单申请: <https://forms.gle/CWABDLRe8twvygvy5>
* 审核通过后GMGN会分配一个Api Key至你的邮箱，访问接口需将Api Key带入header中 header name: x-route-key
* 每个Api Key限频5s调用一次

#### **ETH/Base链Swap交易步骤：**

1. **同时获取交易路由，获取推荐滑点，获取推荐gas price**

* 获取交易路由: [获取ETH/Base/BSC交易可用的路由](/cn/he-zuo-api-ji-cheng-gmgn-ethbasebsc-jiao-yi-api/huo-qu-ethbasebsc-jiao-yi-ke-yong-de-lu-you.md)
* 获取推荐滑点: [获取ETH/Base/BSC代币推荐滑点值](/cn/he-zuo-api-ji-cheng-gmgn-ethbasebsc-jiao-yi-api/huo-qu-ethbasebsc-dai-bi-tui-jian-hua-dian-zhi.md)
* 获取推荐gas price: [获取ETH/Base/BSC链推荐gas price](/cn/he-zuo-api-ji-cheng-gmgn-ethbasebsc-jiao-yi-api/huo-qu-ethbasebsc-lian-tui-jian-gas-price.md)

2. **选择路由后，调用模拟交易**

{% content-ref url="/pages/WUTwv1GLaJO57D38rg0k" %}
[Swap交易的模拟交易(ETH/Base/BSC)](/cn/he-zuo-api-ji-cheng-gmgn-ethbasebsc-jiao-yi-api/swap-jiao-yi-de-mo-ni-jiao-yi-ethbasebsc.md)
{% endcontent-ref %}

3. **模拟交易通过后，获取返回的data字段，使用普通rpc或者防夹rpc提交正式交易**

提交交易签名，可以使用ethers js库

签名交易教程 <https://docs.ethers.org/v6/api/providers/#Signer-signTransaction>

ethers js库 <https://github.com/ethers-io/ethers.js>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gmgn.ai/cn/he-zuo-api-ji-cheng-gmgn-ethbasebsc-jiao-yi-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
