APIの活用方法

5 時 25 分 58 秒前
627,690 読む
131

1. Gate のウェブサイトを開きます。プロフィールアイコンの上にカーソルを合わせてメニューを展開し、[API管理] をクリックします。

1

2. メニューの [APIv2 キー] をクリックします。

2

3. 取引用パスワードとTOTPを入力すると、APIv2キーが表示されます。

注意:

  1. 新しいAPIキーが生成された時点で、古いAPIキーは失効します。
  2. APIキーは、口座情報の照会や、取引や出金などに利用できます。
  3. APIキーは安全に保管し、決して他の人と共有しないでください。

APIv4 キーの新規作成

[APIv4 キー] に移動します。[APIv4 キー管理] が選択されていることを確認します。右上の [+ 新規API キー作成] ボタンをクリックします。

APIキー作成後、キーの閲覧、編集、削除が可能です。


お知らせ:

  1. APIv2/4キーには、入出金の権限があります。API経由で出金を行うには、過去に手動で出金したアドレスを使用する必要があり、直近の手動出金から24時間以上経過している必要があります。

  2. APIv2とAPIv4の相違点は以下のとおりです:

  • APIv2キーとAPIv4キーは互いに独立しています。
  • APIv2キーはスポット取引のみ利用可能ですが、APIv4キーは現物取引、信用取引、契約取引すべてに対応しています。
  • APIv2キーはAPIv2キーのページ下部で作成し、APIv4キーは[パーソナルセンター] → [サブアカウントとAPI] → [APIv4 キー] にて作成します。

*APIv2、APIv4のどちらを選択するかは、お客様のご要望に応じて決定してください。各機能の最新情報はこちらの記事を参照してください。

この記事で疑問が解決されない場合は、チケットを送信してください。

チケットには、以下の情報を記載してください:

  • お客様のUID
  • リクエスト元URL
  • パラメーター
  • リクエストの詳細(APIキーがスポット取引用か、証拠金取引用かなど)
  • Mainnet か Testnet か
  • プログラミング言語(リクエスト送信用コードがあるとなお良いです)
  • SDKの使用の有無(使用している場合は使い方やGitHubコメントも併記してください)

APIドキュメントは、[More] > [Developers (API)] からアクセスできます。

API Docs

頻度制限ルール:

Markets Endpoints Limits Based On Include
All public endpoints Public endpoints 200r/10s per endpoint IP Orderbook, Candlestick, Ticker, etc.
Wallet Private endpoints Withdrawal(POST /withdrawals) : 1r/3s
UID transfer(POST /withdrawals/push) 1r/10s
Transfer between trading accounts (POST /wallet/transfers) 80r/10s
Transfer between main and sub accounts (POST /wallet/sub_account_transfers) 80r/10s
Transfer from a sub-account to another sub-account (POST /wallet/sub_account_to_sub_account) 80r/10s
Retrieve user's total balances (GET /wallet/total_balance) 80r/10s
Retrieve sub account balances (GET /wallet/sub_account_balances) 80r/10s
Query sub accounts' margin balances (GET /wallet/sub_account_margin_balances) 80r/10s
Query sub accounts' futures account balances (GET /wallet/sub_account_futures_balances) 80r/10s
Query subaccount's cross_margin account info(GET /wallet/sub_account_cross_margin_balances) 80r/10s
The Others: 200r/10s per endpoint
UID Withdrawal.
Query personal account balance.
Query subaccount balance.
Spot Private endpoints The rate limit for batch/single order placement and amend an order are total of 10r/s (UID+Market)
The rate limit for batch/single order cancellation is total of 200r/s
The Others: 200r/10s per endpoint
UID Spot order placement and cancellation.
Trade history and fee rates.
Perpetual Futures Private endpoints The rate limit for batch/single order placement and amend an order are total of 100r/s
The maximum rate limit for the order cancellation (bulk/single) is 200r/s
The Others: 200r/10s per endpoint
UID Futures order placement and cancellation
Trade history and fee rates
Delivery Private endpoints The maximum rate limit for the order placement (bulk/single) is 500r/10s
The maximum rate limit for the order cancellation (bulk/single) is 500r/10s
The Others: 200r/10s per endpoint
UID Order placement and cancellation
Options Private endpoints The maximum rate limit for the order placement (bulk/single) is 200r/s
The maximum rate limit for the order cancellation (bulk/single) is 200r/s
The Others: 200r/10s per endpoint
UID Order placement and cancellation
Subaccount Private endpoints 80r/10s per endpoint UID Create a sub-account.
Retrieve the list of sub-accounts.
Disable or enable API key for a sub-account.
Unified Private endpoints Borrow or repay 15/10s UID Borrow or repay(POST /unified/loans)
Other Private endpoints Private endpoints 150r/10s per endpoint UID Earning, collateral etc

レート上限は、各サブアカウントまたはメインアカウントに対してカウントされます。

WebSocket:

  • サーバーに送信するメッセージ数の上限:無制限
  • 1 IPあたりの接続数:≦300

お知らせ:

レート制限違反を繰り返す場合:

  • リクエスト < バーストレート の場合、リクエストに遅延が発生します
  • リクエスト > バーストレート の場合、リクエストは拒否されます
今すぐ登録して、最大$10,000が当たるチャンスを掴もう!
signup-tips