Learn how you can do simple Spot trading by calling the functions in the python-okx library on a Jupyter Notebook.
The Jupyter Notebook is an incredibly powerful and easy-to-use tool for Python development and data analysis. You can run a Jupyter Notebook server on Windows, Mac OS or Linux. This tutorial provides a pretty comprehensive guide on how to get a Jupyter Notebook up and running.
Checklist
- How can I run Python code snippets on a Jupyter Notebook?
- How can I install the python-okx package?
- How can I create API keys?
- After signing in to our platform, go to Trade > Demo trading to create API keys for testing purposes
- Open Demo trading page
- Go to Profile and select Demo Trading API to create API keys.
- Open API to create API keys
- Select Create API key
- Select Trade in the Permissions to trade with the API key
- Select Trade in Permissions
- How can I import OKX modules?
- How can I access our market data?
Notes
Once you start running a Jupyter Notebook, you can install the python-okx package by simply running the pip install python-okx in the notebook or in a terminal (or via command prompt for Windows):
Create API keys for the different master/sub accounts you might have
Now you have access to your API key, your Secret key, and your passphrase. Keep them in a safe place!
Instantiate python variables to save your API details in the notebook for later usage
Details follow the official OKX help article; this page is a learning checklist, not an official mirror.










