swagger-client

tinkoff.ru/invest OpenAPI.

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import tinkoff_api_client 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import tinkoff_api_client

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import tinkoff_api_client
from tinkoff_api_client.rest import ApiException
from pprint import pprint


# create an instance of the API class
api_instance = tinkoff_api_client.MarketApi(tinkoff_api_client.ApiClient(configuration))

try:
    # Получение списка облигаций
    api_response = api_instance.market_bonds_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MarketApi->market_bonds_get: %s\n" % e)


# create an instance of the API class
api_instance = tinkoff_api_client.MarketApi(tinkoff_api_client.ApiClient(configuration))

try:
    # Получение списка валютных пар
    api_response = api_instance.market_currencies_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MarketApi->market_currencies_get: %s\n" % e)


# create an instance of the API class
api_instance = tinkoff_api_client.MarketApi(tinkoff_api_client.ApiClient(configuration))

try:
    # Получение списка ETF
    api_response = api_instance.market_etfs_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MarketApi->market_etfs_get: %s\n" % e)


# create an instance of the API class
api_instance = tinkoff_api_client.MarketApi(tinkoff_api_client.ApiClient(configuration))
figi = 'figi_example' # str | FIGI

try:
    # Получение инструмента по FIGI
    api_response = api_instance.market_search_by_figi_get(figi)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MarketApi->market_search_by_figi_get: %s\n" % e)


# create an instance of the API class
api_instance = tinkoff_api_client.MarketApi(tinkoff_api_client.ApiClient(configuration))
ticker = 'ticker_example' # str | Тикер инструмента

try:
    # Получение инструмента по тикеру
    api_response = api_instance.market_search_by_ticker_get(ticker)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MarketApi->market_search_by_ticker_get: %s\n" % e)


# create an instance of the API class
api_instance = tinkoff_api_client.MarketApi(tinkoff_api_client.ApiClient(configuration))

try:
    # Получение списка акций
    api_response = api_instance.market_stocks_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MarketApi->market_stocks_get: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api-invest.tinkoff.ru/openapi/

Class Method HTTP request Description
MarketApi market_bonds_get GET /market/bonds Получение списка облигаций
MarketApi market_currencies_get GET /market/currencies Получение списка валютных пар
MarketApi market_etfs_get GET /market/etfs Получение списка ETF
MarketApi market_search_by_figi_get GET /market/search/by-figi Получение инструмента по FIGI
MarketApi market_search_by_ticker_get GET /market/search/by-ticker Получение инструмента по тикеру
MarketApi market_stocks_get GET /market/stocks Получение списка акций
OperationsApi operations_get GET /operations Получение списка операций
OrdersApi orders_cancel_post POST /orders/cancel Отмена заявки
OrdersApi orders_get GET /orders Получение списка активных заявок
OrdersApi orders_limit_order_post POST /orders/limit-order Создание лимитной заявки
PortfolioApi portfolio_currencies_get GET /portfolio/currencies Получение валютных активов клиента
PortfolioApi portfolio_get GET /portfolio Получение портфеля клиента
SandboxApi sandbox_clear_post POST /sandbox/clear Удаление всех позиций
SandboxApi sandbox_currencies_balance_post POST /sandbox/currencies/balance Выставление баланса по валютным позициям
SandboxApi sandbox_positions_balance_post POST /sandbox/positions/balance Выставление баланса по инструментным позициям
SandboxApi sandbox_register_post POST /sandbox/register Регистрация клиента в sandbox

Documentation For Models

Documentation For Authorization

sso_auth

Author

n.v.melnikov@tinkoff.ru