Skip to main content

Quantweb3 Data API for quants

Project description

qwdataapi

v1.0.4

Introduction

qwdataapi is a data service API provided by quantweb.ai, used for fetching historical data from various cryptocurrency exchanges and a variety of alternative data.

Installation Instructions

Installation can be done using pip:

pip install qwdataapi

Usage Instructions

Three steps to obtain minute-level market data:

from qwdataapi import *

auth('Your username', 'Your token')
df = fetch_data(symbol='BTCUSDT', start='2023-07-01 00:00:00')
print(df.head())

Replace 'Your username' and 'Your token' with your actual username and token, which could be obtained from quantweb.ai,

Function Description

fetch_data:

  • Function Purpose

The fetch_data function is used to retrieve specific asset type and data type information from a designated exchange. The data can include candlestick (k-line) data, among others.

  • Function Parameters

    • exchange (str): The name of the exchange, defaults to 'binance'.

    • symbol (str): The trading pair, for example 'BTCUSDT', defaults to 'BTCUSDT'.

    • asset_type (str): The type of asset, defaults to 'spot', representing spot trading.

    • data_type (str): The type of data, defaults to 'klines', representing candlestick data.

    • start (str): The start time of the data, formatted as 'YYYY-MM-DD HH:MM:SS', defaults to '2023-08-01 00:00:00'.

    • end (str): The end time of the data, formatted the same as the start time, defaults to '2024-07-17 00:00:00'.

    • batch_size (int): The size of the data batch for each request, a number between 40 and 100, defaults to 50.

  • Usage Example

# Import the fetch_data function
from client import fetch_data

# Call the function to retrieve data
df = fetch_data(exchange='binance', symbol='ETHUSDT', start='2023-09-01 00:00:00', end='2023-09-30 23:59:59')

# View the retrieved data
print(df.head())

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

qwdataapi-1.0.4.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

qwdataapi-1.0.4-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

Supported by

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