Skip to main content

No project description provided

Project description

Publish to PyPI

Quantsight Data API Python Client

This is a Python client for the Quantsight Data API, which allows you to fetch historical funding rates, candle data, and perform custom queries from supported exchanges. The client is easy to use and supports fetching data into a Pandas DataFrame for further analysis.

Installation

To install the Quantsight Data API Python client, use pip:

pip install quantsight

Usage

First, import the QuantsightDataAPI class and create an instance with your API key:

from quantsight import Quantsight

api_key = "your_api_key"
qs = Quantsight(api_key)

Then, you can use the following methods to fetch data from the Quantsight Data API:

Get funding rate

To fetch historical funding rates from a supported exchange, use the get_funding_rate method:

funding_rate_df = qs.get_funding_rate("2010-01-01T00:00:00", "2023-05-04T11:47:20.958631", "okx", 100, "BTC-USD-SWAP")

Get OHLCV data

To fetch candle data from a supported exchange, use the get_ohlcv method:

ohlcv_df = qs.get_ohlcv("2010-01-01T00:00:00", "2023-05-04T11:47:20.958631", "okx", "1d", "spot", 100, "BTC-USD-SWAP")

Get OHLCV data around time

To fetch candle data around a specific point in time, use the get_ohlcv_around_time method:

ohlcv_around_time_df = qs.get_ohlcv_around_time("2010-01-01T00:00:00+00:00", "2023-05-04T10:47:20.956633+00:00", "okx", "1d", "spot", "00:00:00", 10, 100, "BTC-USD-SWAP")

Custom query (BETA)

To perform a custom query, use the custom_query method:

custom_query_df = qs.custom_query("SELECT close FROM {{okx.ohlcv.swap.1d}} LIMIT 10", dry_run=True, use_legacy_sql=False)

Each method returns a Pandas DataFrame containing the fetched data.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

quantsight-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

quantsight-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file quantsight-0.1.0.tar.gz.

File metadata

  • Download URL: quantsight-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for quantsight-0.1.0.tar.gz
Algorithm Hash digest
SHA256 60acf2a21d01f304e6bf7c1302326dbf16348a3b86348a7928c3c6324bbad6b8
MD5 8cf0d5d9cd82105182e614c9bd22788f
BLAKE2b-256 f19a5eb4671d1e431c0e330323f818454c3b98553efd6539dce0b62f0e43e64d

See more details on using hashes here.

File details

Details for the file quantsight-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quantsight-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for quantsight-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 694e3ae8bdfe4450184e7ae5bb9a88ae9389c1a40357ad00f9d5f78bab01ca0c
MD5 20f74f2d812e31bce0b3595872d4cab2
BLAKE2b-256 d50f03c1e5f7adbbd9d7f5c2be3b05a5548a8bca4c4b2fc232306f18a26cb056

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