Skip to main content

All Trading API

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+
PyPI Python
License

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:

  1. per-call api_key=...
  2. Client(keys={"quotex-candles": "ap_..."})
  3. Client(keys={"default": "ap_..."})
  4. Client(api_key="ap_...")
  5. ATA_API_KEY environment variable
  6. 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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alltradingapi 1.0.0
File Size Uploaded Provenance Actions
alltradingapi-1.0.0.tar.gz 58.3 kB With provenance Details for alltradingapi-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for alltradingapi 1.0.0
File Interpreter ABI Platform Actions
alltradingapi-1.0.0-py3-none-any.whl Python 3 none any Details for alltradingapi-1.0.0-py3-none-any.whl

Total release size: 101.4 kB

Release files / alltradingapi-1.0.0.tar.gz

Download URL alltradingapi-1.0.0.tar.gz
Size 58.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c3df5b1dd285051651d260d6c23abdac2a23280b1e10b911effec4feda6d6815
BLAKE2b-256 checksum
How to use checksums
260b62d669762f4a8e2185f4b762dda7ea67fdc1dba5b901aa1b6c0ca63edf23
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 log

Release files / alltradingapi-1.0.0-py3-none-any.whl

Download URL alltradingapi-1.0.0-py3-none-any.whl
Size 43.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7732f096ed48bf8c3ac6c86f66391d3b632aecf988fcea56c959f2157e8ad98
BLAKE2b-256 checksum
How to use checksums
f1b7b641914b700025872e0ae478a6eef2337d35a4777d2c8c1c494025801cee
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 log

Security for alltradingapi 1.0.0

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.

Select from 2 files

Attestation for alltradingapi-1.0.0.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page