Skip to main content

Up-to-date, most-complete, well-organized, well-documented, easy-to-use OKX Exchange Rest and Websocket API SDK for Python.

Project description

Overview

This is an unofficial Python wrapper for the OKX exchange v5 API

If you came here looking to purchase cryptocurrencies from the OKX exchange, please go here.

Source code

https://github.com/okxapi/python-okx

OKX API Telegram

https://t.me/OKXAPI

API trading tutorials

Make sure you update often and check the Changelog for new features and bug fixes.

Features

  • Implementation of all Rest API endpoints.
  • Private and Public Websocket implementation
  • Testnet support
  • Websocket handling with reconnection and multiplexed connections

Quick start

Prerequisites

python version:>=3.9

WebSocketAPI: websockets package advise version 6.0

Step 1: register an account on OKX and apply for an API key

Step 2: install python-okx

pip install python-okx

Step 3: Run examples

  • Fill in API credentials in the corresponding examples
api_key = ""
secret_key = ""
pass_phrase = ""

Note

  • To learn more about OKX API, visit official OKX API documentation

  • If you face any questions when using WebSocketAPI,you can consult the following links

    • asynciowebsockets document/github

      https://docs.python.org/3/library/asyncio-dev.html
      https://websockets.readthedocs.io/en/stable/intro.html
      https://github.com/aaugustin/websockets
      
    • About code=1006

      https://github.com/Rapptz/discord.py/issues/1996
      https://github.com/aaugustin/websockets/issues/587
      

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

okx-sdk-1.0.0.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

okx_sdk-1.0.0-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file okx-sdk-1.0.0.tar.gz.

File metadata

  • Download URL: okx-sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for okx-sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b0158176cdb8f960f98827718ce640d881fe800ee82ef36ba0ab8943af277ffe
MD5 5320b3286e544adf6dc2ffd603fa56ec
BLAKE2b-256 9acac933b2ec572e3123f367debabc19d7b2701abf2bb81a0e0badec6f6cc95f

See more details on using hashes here.

File details

Details for the file okx_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: okx_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for okx_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbefaca7e096be29f6a6b494968188660f168f2d71da5cb881e9d0d2f6bcfd7a
MD5 2bb3a1c678a33bb4a57fa1fe6fa05d08
BLAKE2b-256 60e1e3816078d9b5476b896111f5656f4bcaf0f2b6a3e9618e4b457f7974f939

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page