Registry / data / rqdatac

rqdatac

JSON →
library3.5.2pypypi✓ verified 84d ago

Ricequant Data SDK (rqdatac) provides programmatic access to Chinese financial market data, including stocks, futures, options, and index data. It offers both snapshot and historical data retrieval with a pandas-friendly API. Current version: 3.5.1.1. The library is actively maintained by Ricequant and releases follow a monthly cadence.

pip install rqdatac
INSTALL
IMPORT
SIG · RQDATAC
R
rqdatac
datapythonv3.5.2
Install
9.7s avg
Import
1314ms
Disk
202MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.9.39.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 9.6s
py 3.11
✓ —
✓ 9.1s
py 3.12
✕ build_error
✓ 9.1s
py 3.13
✕ build_error
✓ 9.1s
py 3.9
✓ —
✓ 11.6s
202MB installed
● package 202MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

init
import rqdatac as rq
from rqdatac import rqdatac
rqdatac exports its main functions at the top level; the canonical import is 'import rqdatac as rq'.
all_instruments
from rqdatac import all_instruments
from rqdatac.rqdatac import all_instruments
Direct import from the subpackage is unnecessary; top-level import works.
get_price
from rqdatac import get_price
import rqdatac.get_price
get_price is a function, not a module.

Initialize rqdatac with your API token and fetch instrument list and historical prices.

import rqdatac as rq # Initialize with your token (get from https://www.ricequant.com) rq.init('your_token_here') # List all instruments instruments = rq.all_instruments() print(instruments.head()) # Get historical price data for a stock prices = rq.get_price('000001.XSHE', start_date='2024-01-01', end_date='2024-06-01', fields=['close']) print(prices.head())
Debug
Known issues
breakingToken format changed in v3.0 - you must now pass a full API token (not user/password). Old init patterns no longer work.
fix
Use rq.init('your_full_token') - obtain token from Ricequant website.
affects: >=3.0
gotchaStock codes on Chinese exchanges require exchange suffix: .XSHE for Shenzhen, .XSHG for Shanghai. Omitting suffix returns empty data.
fix
Always append the correct exchange suffix (e.g., '000001.XSHE', '600000.XSHG').
affects: all
deprecatedThe 'rqdatac.all_instruments' function now returns a DataFrame with different column names (e.g., 'order_book_id' instead of 'code'). Old code referencing 'code' or 'symbol' will break.
fix
Check column names with .columns and refer to 'order_book_id' for instrument identifiers.
affects: >=3.0
gotchaget_price() expects start_date and end_date as strings in 'YYYY-MM-DD' format. Python date objects or other formats may cause unexpected errors.
fix
Always pass dates as strings: start_date='2024-01-01'.
affects: all
Errors
Common errors & fixes
rqdatac.exceptions.AuthenticationError: invalid token
Token is expired, malformed, or missing. Also occurs if init() is not called.
fix
Make sure you call rq.init('valid_token_here') with a token obtained from your Ricequant account. Token must be a string.
KeyError: 'order_book_id'
Code refers to column 'order_book_id' but older version returns 'code' or 'symbol'.
fix
Check your rqdatac version: if <3.0, use 'code' instead. If >=3.0, use 'order_book_id'. Alternatively, use .get('order_book_id', None) or update to latest version.
Empty DataFrame returned when calling get_price
Instrument code is missing exchange suffix or incorrect date range.
fix
Ensure stock codes include exchange suffix (e.g., '000001.XSHE'). Also verify that the date range is within available data.
Upgrade
Version history
3.5.2latest on PyPI · released May 14, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
136 hits · last 30 days
node
130
Amazon
1
OpenAI (training)
1
Resources