
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
python-deriv-api
Advanced tools
A python implementation of deriv api library.
Go through api.deriv.com to know simple easy steps on how to register and get access. Use this all-in-one python library to set up and make your app running or you can extend it.
Python (3.9.6 or higher is recommended) and pip3
Note: There is bug in 'websockets' package with python 3.9.7, hope that will be fixed in 3.9.8 as mentioned in https://github.com/aaugustin/websockets/issues/1051. Please exclude python 3.9.7.
python3 -m pip install python_deriv_api
This is basic deriv-api python library which helps to make websockets connection and deal the API calls (including subscription).
Import the module
from deriv_api import DerivAPI
Access
api = DerivAPI(endpoint='ws://...', app_id=1234);
response = await api.ping({'ping': 1})
print(response)
You can either create an instance of websockets and pass it as connection or pass the endpoint and app_id to the constructor to create the connection for you.
If you pass the connection it's up to you to reconnect in case the connection drops (cause API doesn't know how to create the same connection).
api = DerivAPI(endpoint='ws://...', app_id=1234);
connection = await websockets.connect('ws://...')
api = DerivAPI(connection=connection)
The complete API reference is hosted here
Examples here
git clone https://github.com/binary-com/python-deriv-api
cd python-deriv-api
Setup environment
make setup
Setup environment and run test
make all
python setup.py pytest
or
pytest
or
make test
Generate html version of the docs and publish it to gh-pages
make gh-pages
make build
set token and run example
export DERIV_TOKEN=xxxTokenxxx
PYTHONPATH=. python3 examples/simple_bot1.py
FAQs
Python bindings for deriv.com websocket API
We found that python-deriv-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.