alltradingapi
Python client for the All Trading API — candles, assets, saved candles, candle history, chart images and trade result checks for Quotex.
- Zero dependencies, standard library only
- Sync and async clients
- Typed, ships
py.typed - Automatic retries on rate limits and server errors
- Python 3.10+
Install
pip install alltradingapi
Get an API key from alltradingapi.com. Each endpoint type has its own key. The simplest setup is one default key:
export ATA_API_KEY=ap_yourkey
You can also pass keys per product, or per call — see authentication.
Quickstart
from alltradingapi import Client
with Client() as ata: # uses ATA_API_KEY
assets = ata.assets(only_open=True)
print("open assets:", len(assets))
candles = ata.candles("EURUSD_otc", hours=2, timeframe="1m")
print("last close:", candles[-1].close)
Endpoints
| method | endpoint | returns |
|---|---|---|
ata.assets() |
/qx_assets |
list of assets with open state and payouts |
ata.candles(asset) |
/qx_candles |
current candles (OHLC) |
ata.history(asset) |
/qx_history |
candle history |
ata.saved(asset) |
/qx_saved |
saved candles from the archive |
ata.screenshot(asset) |
/qx_ss_pro_v2 |
chart image as PNG bytes |
ata.result(asset, time, direction) |
/qx_result |
trade result check |
Common options: timeframe (5s…4h), timezone ("-3", "UTC",
"Asia/Dhaka", …), hours (1–24), count (1–1000 for saved candles).
Invalid values raise ValidationError before any request is sent.
Saving a chart image
png = ata.screenshot("EURUSD_otc", timeframe="1m")
with open("chart.png", "wb") as f:
f.write(png) # real PNG, 1200x680, returned by the API
Result check
outcome = ata.result("EURUSD_otc", time="20:00", direction="call", mtg=1)
print(outcome.result) # TradeOutcome.WIN / LOSE / REFUND / PENDING / ...
Async
import asyncio
from alltradingapi import AsyncClient
async def main():
async with AsyncClient() as ata:
assets = await ata.assets(only_open=True)
symbols = [a.symbol for a in assets if a.is_otc][:10]
# candles for many assets at once; failures stay per-asset
results = await ata.scan(symbols, hours=1)
for symbol, candles in results.items():
if not isinstance(candles, Exception):
print(symbol, len(candles), "candles")
asyncio.run(main())
Authentication
Keys are sent as a bearer header by default. Resolution order:
- per-call
api_key=... Client(keys={"quotex-candles": "ap_..."})Client(keys={"default": "ap_..."})Client(api_key="ap_...")ATA_API_KEYenvironment variable- per-product
ATA_KEY_QUOTEX_CANDLES,ATA_KEY_QUOTEX_ASSETS, etc.
Use auth_mode="query" if you prefer ?key= in the URL instead.
Errors and retries
429 and 5xx responses are retried automatically with backoff, honouring
Retry-After. After the retries are exhausted you get a specific exception:
from alltradingapi.errors import (
ALLError, AuthenticationError, PermissionDeniedError,
RateLimitError, ValidationError, UpstreamError,
)
try:
candles = ata.candles("EURUSD_otc")
except RateLimitError as e:
print("slow down, retry after", e.retry_after, "s")
except ValidationError as e:
print("bad parameter:", e.message)
except UpstreamError:
print("feed is down, try again later")
Every error carries .status, .message, .payload and a redacted .url.
Staying up to date
The client checks PyPI once per process and refuses to run if a newer version exists, unless you opt out:
ata = Client(update_policy="warn") # strict (default) | ask | warn | off
Escape hatches: ATA_UPDATE_POLICY=off, ATA_SKIP_UPDATE=1,
Client(allow_outdated=True). Check without gating:
ata.check_updates(force=True).
More examples
See the examples/ folder: quickstart, candle history with a sparkline, and chart images with async scanning.
License & disclaimer
MIT — see LICENSE. © 2026 All Trading API.
Independent, unofficial API. Not affiliated with, endorsed by, or connected to Quotex. Trading involves substantial risk. This SDK provides market data only — it cannot place trades and is not financial advice.
Metadata
Release files for alltradingapi 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| alltradingapi-1.0.2.tar.gz | 58.6 kB | With provenance | Details for alltradingapi-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| alltradingapi-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for alltradingapi-1.0.2-py3-none-any.whl |
Total release size: 101.8 kB
Release files / alltradingapi-1.0.2.tar.gz
| Download URL | alltradingapi-1.0.2.tar.gz |
|---|---|
| Size | 58.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e80422bdde1afc05b1a198aac3e4393ec297e4a4faa8c0449f5f1c182b5123fe
|
|
BLAKE2b-256 checksum How to use checksums |
f63b01a5e7d24cd44c7fa9037636cc102f2f8ab4d0f0cf615c15d378867aabde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logRelease files / alltradingapi-1.0.2-py3-none-any.whl
| Download URL | alltradingapi-1.0.2-py3-none-any.whl |
|---|---|
| Size | 43.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2cef10024d3b3841b11abfff72767a2b28a2281a9a71994b4f0c4d0c2ea6c872
|
|
BLAKE2b-256 checksum How to use checksums |
1bd51b7a6fc7b5ea100b9b499deeeb519a5c8b73cf3bfc1151f2c2a5df5de60d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logSecurity for alltradingapi 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for alltradingapi-1.0.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.