# gate-api
Welcome to Gate.io API
APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf.
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 4.22.2
- Package version: 4.22.2
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts)
## Versioning
Trying our best to follow the [semantic versioning](https://semver.org/), while enjoying recent features
provided by programming language and libraries, from 4.15.2, one major versioning difference will be
introduced:
If extra code rewrite is required when you upgrade the SDK, such as:
- some outdated programming language version support is dropped
- API method signature has breaking changes.
**the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's
instead of resetting to 0**, so that you can recognize it has some breaking changes, but still getting
the idea of from which REST API version the change is introduced.
For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce
some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release
will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH
version are identical to REST API's instead of resetting them to 0)
If MAJOR version is incremented, make sure you read the release note on
[Releases](https://github.com/gateio/gateapi-python/releases)
page
## Requirements.
Python 2.7 and 3.4+
## Installation & Usage
### pip install
You can install directly using:
```sh
pip install --user gate-api
```
Then import the package:
```python
import gate_api
```
### Setuptools
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)
Then import the package:
```python
import gate_api
```
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
try:
# List all futures contracts
api_response = api_instance.list_delivery_contracts(settle)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_contracts: %s\n" % e)
```
For a more complete API usage example, refer to the demo application in [example](example) directory
## Documentation for API Endpoints
All URIs are relative to *https://api.gateio.ws/api/v4*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DeliveryApi* | [**list_delivery_contracts**](docs/DeliveryApi.md#list_delivery_contracts) | **GET** /delivery/{settle}/contracts | List all futures contracts
*DeliveryApi* | [**get_delivery_contract**](docs/DeliveryApi.md#get_delivery_contract) | **GET** /delivery/{settle}/contracts/{contract} | Get a single contract
*DeliveryApi* | [**list_delivery_order_book**](docs/DeliveryApi.md#list_delivery_order_book) | **GET** /delivery/{settle}/order_book | Futures order book
*DeliveryApi* | [**list_delivery_trades**](docs/DeliveryApi.md#list_delivery_trades) | **GET** /delivery/{settle}/trades | Futures trading history
*DeliveryApi* | [**list_delivery_candlesticks**](docs/DeliveryApi.md#list_delivery_candlesticks) | **GET** /delivery/{settle}/candlesticks | Get futures candlesticks
*DeliveryApi* | [**list_delivery_tickers**](docs/DeliveryApi.md#list_delivery_tickers) | **GET** /delivery/{settle}/tickers | List futures tickers
*DeliveryApi* | [**list_delivery_insurance_ledger**](docs/DeliveryApi.md#list_delivery_insurance_ledger) | **GET** /delivery/{settle}/insurance | Futures insurance balance history
*DeliveryApi* | [**list_delivery_accounts**](docs/DeliveryApi.md#list_delivery_accounts) | **GET** /delivery/{settle}/accounts | Query futures account
*DeliveryApi* | [**list_delivery_account_book**](docs/DeliveryApi.md#list_delivery_account_book) | **GET** /delivery/{settle}/account_book | Query account book
*DeliveryApi* | [**list_delivery_positions**](docs/DeliveryApi.md#list_delivery_positions) | **GET** /delivery/{settle}/positions | List all positions of a user
*DeliveryApi* | [**get_delivery_position**](docs/DeliveryApi.md#get_delivery_position) | **GET** /delivery/{settle}/positions/{contract} | Get single position
*DeliveryApi* | [**update_delivery_position_margin**](docs/DeliveryApi.md#update_delivery_position_margin) | **POST** /delivery/{settle}/positions/{contract}/margin | Update position margin
*DeliveryApi* | [**update_delivery_position_leverage**](docs/DeliveryApi.md#update_delivery_position_leverage) | **POST** /delivery/{settle}/positions/{contract}/leverage | Update position leverage
*DeliveryApi* | [**update_delivery_position_risk_limit**](docs/DeliveryApi.md#update_delivery_position_risk_limit) | **POST** /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit
*DeliveryApi* | [**list_delivery_orders**](docs/DeliveryApi.md#list_delivery_orders) | **GET** /delivery/{settle}/orders | List futures orders
*DeliveryApi* | [**create_delivery_order**](docs/DeliveryApi.md#create_delivery_order) | **POST** /delivery/{settle}/orders | Create a futures order
*DeliveryApi* | [**cancel_delivery_orders**](docs/DeliveryApi.md#cancel_delivery_orders) | **DELETE** /delivery/{settle}/orders | Cancel all `open` orders matched
*DeliveryApi* | [**get_delivery_order**](docs/DeliveryApi.md#get_delivery_order) | **GET** /delivery/{settle}/orders/{order_id} | Get a single order
*DeliveryApi* | [**cancel_delivery_order**](docs/DeliveryApi.md#cancel_delivery_order) | **DELETE** /delivery/{settle}/orders/{order_id} | Cancel a single order
*DeliveryApi* | [**get_my_delivery_trades**](docs/DeliveryApi.md#get_my_delivery_trades) | **GET** /delivery/{settle}/my_trades | List personal trading history
*DeliveryApi* | [**list_delivery_position_close**](docs/DeliveryApi.md#list_delivery_position_close) | **GET** /delivery/{settle}/position_close | List position close history
*DeliveryApi* | [**list_delivery_liquidates**](docs/DeliveryApi.md#list_delivery_liquidates) | **GET** /delivery/{settle}/liquidates | List liquidation history
*DeliveryApi* | [**list_delivery_settlements**](docs/DeliveryApi.md#list_delivery_settlements) | **GET** /delivery/{settle}/settlements | List settlement history
*DeliveryApi* | [**list_price_triggered_delivery_orders**](docs/DeliveryApi.md#list_price_triggered_delivery_orders) | **GET** /delivery/{settle}/price_orders | List all auto orders
*DeliveryApi* | [**create_price_triggered_delivery_order**](docs/DeliveryApi.md#create_price_triggered_delivery_order) | **POST** /delivery/{settle}/price_orders | Create a price-triggered order
*DeliveryApi* | [**cancel_price_triggered_delivery_order_list**](docs/DeliveryApi.md#cancel_price_triggered_delivery_order_list) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders
*DeliveryApi* | [**get_price_triggered_delivery_order**](docs/DeliveryApi.md#get_price_triggered_delivery_
没有合适的资源?快使用搜索试试~ 我知道了~
PyPI 官网下载 | gate-api-4.22.2.tar.gz
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 11 浏览量
2022-01-11
23:14:41
上传
评论
收藏 120KB GZ 举报
温馨提示
共92个文件
py:84个
txt:4个
pkg-info:2个
资源来自pypi官网。 资源全名:gate-api-4.22.2.tar.gz
资源推荐
资源详情
资源评论
收起资源包目录
gate-api-4.22.2.tar.gz (92个子文件)
gate-api-4.22.2
setup.cfg 398B
README.md 27KB
gate_api.egg-info
dependency_links.txt 1B
PKG-INFO 27KB
SOURCES.txt 3KB
top_level.txt 9B
requires.txt 48B
PKG-INFO 27KB
gate_api
exceptions.py 4KB
configuration.py 12KB
api
withdrawal_api.py 10KB
spot_api.py 142KB
delivery_api.py 174KB
__init__.py 373B
futures_api.py 220KB
margin_api.py 172KB
wallet_api.py 54KB
api_client.py 26KB
models
margin_account_book.py 8KB
cross_margin_currency.py 10KB
contract_stat.py 14KB
margin_transferable.py 5KB
sub_account_balance.py 4KB
futures_initial_order.py 11KB
futures_price_trigger.py 9KB
futures_trade.py 7KB
futures_price_triggered_order.py 12KB
spot_price_put_order.py 9KB
margin_account_currency.py 7KB
transfer.py 9KB
position_close.py 6KB
loan_patch.py 7KB
contract.py 31KB
trigger_order_response.py 3KB
cross_margin_borrowable.py 4KB
cancel_order.py 5KB
funding_rate_record.py 4KB
position.py 21KB
futures_order.py 24KB
cross_margin_balance.py 6KB
cross_margin_repay_request.py 5KB
futures_account.py 9KB
insurance_record.py 4KB
repay_request.py 6KB
delivery_contract.py 37KB
deposit_address.py 5KB
order.py 27KB
margin_account.py 6KB
spot_account.py 5KB
cross_margin_account.py 9KB
futures_candlestick.py 6KB
currency.py 8KB
auto_repay_setting.py 4KB
spot_price_triggered_order.py 11KB
ticker.py 13KB
futures_liquidate.py 12KB
ledger_record.py 10KB
funding_account.py 7KB
account_balance.py 4KB
cross_margin_transferable.py 4KB
trade_fee.py 11KB
open_orders.py 5KB
currency_pair.py 12KB
loan.py 17KB
cancel_order_result.py 8KB
total_balance.py 5KB
__init__.py 5KB
margin_currency_pair.py 9KB
futures_order_book.py 7KB
order_book.py 7KB
cross_margin_account_book.py 8KB
funding_book_item.py 5KB
futures_ticker.py 18KB
sub_account_transfer.py 11KB
withdraw_status.py 13KB
margin_borrowable.py 5KB
futures_order_book_item.py 4KB
multi_chain_address_item.py 7KB
repayment.py 5KB
spot_price_trigger.py 6KB
futures_account_book.py 7KB
batch_order.py 29KB
cross_margin_loan.py 11KB
delivery_settlement.py 9KB
position_close_order.py 5KB
cross_margin_repayment.py 7KB
loan_record.py 13KB
trade.py 13KB
my_futures_trade.py 8KB
__init__.py 5KB
rest.py 12KB
setup.py 1KB
共 92 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 12w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功