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

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.1
File Size Uploaded Provenance Actions
alltradingapi-1.0.1.tar.gz 58.5 kB With provenance Details for alltradingapi-1.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 101.6 kB

Release files / alltradingapi-1.0.1.tar.gz

Download URL alltradingapi-1.0.1.tar.gz
Size 58.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9ed3921f7426715039951d0130ee7ab191180ad0c588d8d17482eb493af20d4a
BLAKE2b-256 checksum
How to use checksums
def7c1c6b3ab093d567c124f97af6a40c74fbc4539d90130640e72e1e45f03b9
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.1-py3-none-any.whl

Download URL alltradingapi-1.0.1-py3-none-any.whl
Size 43.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31cee4d165dba9356404d1bb867b823e249d8871b9fd87fb757f8cc8570ca8b3
BLAKE2b-256 checksum
How to use checksums
80013bc2d2dd4212fe440e2bec54adc8551f9bfa2081e3baa8154b4eac9bc012
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.1

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