Skip to main content

Type-safe, auto-generated client for the **static-klines** API — historical Binance spot klines served as pre-rendered static JSON. No rate limits, infinite cache lifetime, globally CDN'd.

Project description

static_klines v0.1.5 Checked with mypy Vovk.ts

Type-safe, auto-generated client for the static-klines API — historical Binance spot klines served as pre-rendered static JSON. No rate limits, infinite cache lifetime, globally CDN'd.

License: MIT

# Install the package
pip install static_klines

KLinesAPI

KLinesAPI.get_start_dates

List valid startDates for an interval

Returns the ordered list of startDate values accepted by the candle endpoints for a given interval. Every value is a calendar-aligned UTC date; iterate in order to walk the full history.

GET https://finom.github.io/static-klines/api/api/klines/start-dates/{interval}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_start_dates(
    params={
        # Binance kline interval code
        "interval": "15m"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    "string"
]

KLinesAPI.get_klines_15_m

Get 15m klines window

Fully-closed Binance spot candles at the 15m interval. Each file covers exactly 1 week (Monday-aligned), anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/15m.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/15m/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines15m(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 15m window start date (Monday, UTC, YYYY-MM-DD). Window covers 7 days / 672 candles.
        "startDate": "2023-01-02"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_30_m

Get 30m klines window

Fully-closed Binance spot candles at the 30m interval. Each file covers exactly 2 weeks (Monday-aligned), anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/30m.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/30m/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines30m(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 30m window start date (Monday, UTC). Window covers 14 days / 672 candles.
        "startDate": "2022-01-03"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_1_h

Get 1h klines window

Fully-closed Binance spot candles at the 1h interval. Each file covers exactly 1 calendar month, anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/1h.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/1h/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines1h(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 1h window start date (1st of month, UTC). Window covers 1 calendar month.
        "startDate": "2018-01-01"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_2_h

Get 2h klines window

Fully-closed Binance spot candles at the 2h interval. Each file covers exactly 2 calendar months, anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/2h.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/2h/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines2h(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 2h window start date (UTC). Window covers 2 calendar months.
        "startDate": "2017-07-01"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_4_h

Get 4h klines window

Fully-closed Binance spot candles at the 4h interval. Each file covers exactly 1 calendar quarter, anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/4h.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/4h/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines4h(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 4h window start date (1st of Jan/Apr/Jul/Oct, UTC). Window covers 1 calendar quarter.
        "startDate": "2017-07-01"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_6_h

Get 6h klines window

Fully-closed Binance spot candles at the 6h interval. Each file covers exactly 6 months (Jan/Jul), anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/6h.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/6h/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines6h(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 6h window start date (1st of Jan/Jul, UTC). Window covers 6 calendar months.
        "startDate": "2017-07-01"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_8_h

Get 8h klines window

Fully-closed Binance spot candles at the 8h interval. Each file covers exactly 6 months (Jan/Jul), anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/8h.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/8h/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines8h(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 8h window start date (1st of Jan/Jul, UTC). Window covers 6 calendar months.
        "startDate": "2017-07-01"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_12_h

Get 12h klines window

Fully-closed Binance spot candles at the 12h interval. Each file covers exactly 1 calendar year, anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/12h.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/12h/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines12h(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 12h window start date (1st of Jan, UTC). Window covers 1 calendar year.
        "startDate": "2017-01-01"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_1_d

Get 1d klines window

Fully-closed Binance spot candles at the 1d interval. Each file covers exactly 2 calendar years, anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/1d.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/1d/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines1d(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 1d window start date (1st of Jan, even years, UTC). Window covers 2 calendar years.
        "startDate": "2016-01-01"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_3_d

Get 3d klines window

Fully-closed Binance spot candles at the 3d interval. Each file covers exactly 5 calendar years, anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/3d.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/3d/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines3d(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 3d window start date (1st of Jan, every 5 years, UTC). Window covers 5 calendar years.
        "startDate": "2015-01-01"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_1_w

Get 1w klines window

Fully-closed Binance spot candles at the 1w interval. Each file covers exactly 10 calendar years, anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/1w.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/1w/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines1w(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 1w window start date (1st of Jan, every 10 years, UTC). Window covers 10 calendar years.
        "startDate": "2010-01-01"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

KLinesAPI.get_klines_1_m

Get 1M klines window

Fully-closed Binance spot candles at the 1M interval. Each file covers exactly 10 calendar years, anchored at the calendar boundary shown by startDate. Call GET /api/klines/start-dates/1M.json for the full list of valid startDates.

GET https://finom.github.io/static-klines/api/api/klines/1M/{symbol}/{startDate}.json

from static_klines import KLinesAPI

response = KLinesAPI.get_klines1_m(
    params={
        # Trading pair (Binance spot symbol, hardcoded list of 10)
        "symbol": "BTCUSDT",
        # 1M window start date (1st of Jan, every 10 years, UTC). Window covers 10 calendar years of monthly candles.
        "startDate": "2010-01-01"
    },
    api_root="https://finom.github.io/static-klines/api",
)

print(response)
[
    []
]

OpenAPI

OpenAPI.get_spec

OpenAPI 3.1 specification

Full OpenAPI document describing this API. Consume with Scalar, Swagger UI, or any client generator.

GET https://finom.github.io/static-klines/api/api/openapi.json

from static_klines import OpenAPI

response = OpenAPI.get_spec(
    api_root="https://finom.github.io/static-klines/api",
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

static_klines-0.1.5.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

static_klines-0.1.5-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file static_klines-0.1.5.tar.gz.

File metadata

  • Download URL: static_klines-0.1.5.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for static_klines-0.1.5.tar.gz
Algorithm Hash digest
SHA256 27418cf82688df8740abcc85c5678c746c797e64cc9dfdacb2eb4d9e9644c693
MD5 1635daa8ae018308d199a97d2103faf5
BLAKE2b-256 d8093a066fc3dfd0827c9c11bbc1db9a5d1f6c9a6f291737ece1fd72844dec1b

See more details on using hashes here.

File details

Details for the file static_klines-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: static_klines-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for static_klines-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a304c33f7b03952ad965ba81bee82be1d7e648df962304d4362d3af1372e5ae7
MD5 4c528d753ba30050cff177e7b362b4c6
BLAKE2b-256 de1326cb813fa97b908c54b3268c8bb5701522c29378799ad53f09c86f5a4e31

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page