Skip to main content

Quantweb3 Data API for quants

Project description

QWDataAPI

License Python Version

QWDataAPI is a powerful cryptocurrency market data fetching tool that provides high-quality historical and alternative data from Quantweb3.ai.

Features ✨

  • 🚀 High-performance data retrieval
  • 📊 Minute-level candlestick data
  • 💫 Support for major exchanges
  • 🔄 Asynchronous processing for large datasets
  • 📈 Complete market depth information

Quick Start 🚀

Installation

pip install qwdataapi

Basic Usage

from qwdataapi import auth, fetch_data
  1. Authentication (Get credentials at https://quantweb3.ai/subscribe)
auth('your_username', 'your_token')
  1. Fetch Data
df = fetch_data(
symbol='BTCUSDT', # Trading pair
start='2024-01-01 00:00:00' # Start time
)
  1. View Data
print(df.head())

Advanced Usage

Fetch data with custom parameters

df = fetch_data(
symbol='BTCUSDT', # Trading pair
exchange='binance', # Exchange
asset_type='spot', # Asset type: spot/futures
start='2024-01-01 00:00:00', # Start time
end='2024-01-02 00:00:00', # End time
batch_size=50 # Batch size
)

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' for spot trading. 'coinm' represents coin-based futures trading, while 'usdm' represents USD-based futures trading.
  • data_type (str): The type of data. Defaults to 'klines', which represents 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.

Save data

df.to_csv('btc_data.csv')

Data Structure 📊

The returned DataFrame contains the following columns:

Column Description
open_time Opening time (index)
open Opening price
high Highest price
low Lowest price
close Closing price
volume Trading volume
close_time Closing time
quote_volume Quote currency volume
count Number of trades
taker_buy_volume Taker buy volume
taker_buy_quote_volume Taker buy quote volume

Authentication 🔑

  1. Visit Quantweb3.ai Subscription Page(Note: New users get a 7-day free trial)
  2. Register and obtain authentication credentials
  3. Use the auth() function to authenticate

How to get free data service?

Note: Open an account using one of the above links and provide a screenshot to get 1 year's of free data service(Anyone).

Examples 📝

You can view the demo on Google Colab by clicking here.

Fetch Bitcoin Daily Data and Plot

import pandas as pd
import matplotlib.pyplot as plt
from qwdataapi import auth, fetch_data

Authenticate

auth('your_username', 'your_token')

Fetch data

Fetch data
df = fetch_data(
symbol='BTCUSDT',
start='2024-01-01',
end='2024-01-07'
)

Plot price chart

plt.figure(figsize=(15, 7))
plt.plot(df.index, df['close'])
plt.title('BTC/USDT Price')
plt.xlabel('Time')
plt.ylabel('Price')
plt.grid(True)
plt.show()

Dependencies 📦

  • python-snappy >= 0.7.2
  • grpcio >= 1.64.1
  • pandas >= 1.5.3
  • protobuf >= 4.25.3
  • tqdm >= 4.65.0

FAQ ❓

Q: How to handle authentication errors?
A: Ensure your username and token are correct, and check your network connection.

Q: What is the data update frequency?
A: Hstorical data is updated daily.

Contributing 🤝

Issues and Pull Requests are welcome!

License 📄

This project is licensed under the MIT License - see the LICENSE file for details

Contact 📧

Changelog 📝

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.8.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

qwdataapi-1.0.8-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file qwdataapi-1.0.8.tar.gz.

File metadata

  • Download URL: qwdataapi-1.0.8.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for qwdataapi-1.0.8.tar.gz
Algorithm Hash digest
SHA256 42b97c9e7b24b1f04c7c02a8e25b6dd62d5236d05ed84577c450de35a79bc967
MD5 ddef1be7f2c0cd9eedc59fc829537d3d
BLAKE2b-256 3db60f5cb09835383c0ab1e0d5fc14780a1b0a79761fb86c2fed94e27e6c9619

See more details on using hashes here.

File details

Details for the file qwdataapi-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: qwdataapi-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for qwdataapi-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d984e0d249116766a4d698d07cfb0850374eaa49a2483242bed7b6044a12bf19
MD5 40086f427ce0f36cd1a9197e97dc2ca4
BLAKE2b-256 4d0df8f46b716539f7bad1c62179fa15bd98703a966203ecf65234cd04ae3481

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