DataQuant Connector for Openclaw

DataQuant Connector gives AI agents a secure REST API workflow for retrieving multi-market financial data, screening securities, and supporting quantitative research.

ai-ip
v0.1.0
Aug 6, 2026
0
60
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install dataquant-connector

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install dataquant-connector using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is DataQuant Connector?

DataQuant Connector is an Openclaw Skills integration for the DataQuant quantitative data platform. It provides a practical command-line interface over DataQuant REST APIs, covering A-shares, Hong Kong stocks, U.S. stocks, cryptocurrencies, global indices, and ETFs.

The skill supports historical K-lines, adjusted pricing, real-time valuation snapshots, batch retrieval, condition-based screening, symbol search, macroeconomic indicators, and quota inspection. It is designed for backtesting, stock selection, market analysis, and data-driven agent workflows while keeping API authentication in the user's environment.

DataQuant Connector Use Cases

  • Retrieve historical K-lines for a single security across a specified date range.
  • Download batch price and volume data for multiple symbols.
  • Request the latest detail or valuation snapshot for one or more instruments.
  • Screen securities using approved valuation, size, momentum, and moving-average fields.
  • Search instrument codes by symbol substring across supported markets.
  • Query GDP, CPI/PPI, and PMI macroeconomic data for research workflows.
  • Check remaining API quota before planning large batch jobs.
  • Prepare adjusted price data for indicators and backtesting, including forward- and backward-adjusted series.
  • Activate the skill when users mention DataQuant, dataquant kline, dataquant batch, dataquant detail, dataquant screen, dataquant search, dataquant macro, or dataquant quota.

How DataQuant Connector Works

  1. Detect a DataQuant request or an API key supplied through DATAQUANT_API_KEY, DQ_API_KEY, or an equivalent instruction.
  2. Read DATAQUANT_API_KEY from the environment first; if it is unavailable, request the key from the user rather than fabricating credentials.
  3. Select the correct fixed market code: ashare, hkstock, usstock, crypto, indices, or etfs.
  4. Map the request to the appropriate GET endpoint: K-lines, batch K-lines, detail snapshots, screening, symbol search, macro data, or quota.
  5. Build query parameters such as symbols, fields, dates, adjustment mode, limits, offsets, filters, sorting, and ordering.
  6. Send an authenticated request to https://api.dataquant.trade using the X-API-Key header.
  7. Validate the HTTP response with raise_for_status(), applying backoff and retry handling for rate-limit or temporary service errors.
  8. Emit the API response as JSON on stdout so an agent or downstream analysis tool can parse the result.
  9. Interpret fields using the reference documentation, including adj_factor, adjusted prices, screen-field allowlists, pagination metadata, and macro data objects.

DataQuant Connector Setup

  1. Install Python 3.8 or newer and the required HTTP dependency:
python -m pip install requests
  1. Register for a DataQuant API key at https://app.dataquant.trade.

  2. Store the key in an environment variable instead of hard-coding it:

export DATAQUANT_API_KEY="your_dataquant_api_key"
  1. Confirm the connection and available allowance:
python scripts/dataquant.py quota --api-key "$DATAQUANT_API_KEY"
  1. Run representative DataQuant queries:
python scripts/dataquant.py kline ashare sh600519 --start 2020-01-01 --end 2025-12-31 --adj qfq --api-key "$DATAQUANT_API_KEY"
python scripts/dataquant.py batch ashare sh600519,sz000858 --start 2025-01-01 --adj bfq --api-key "$DATAQUANT_API_KEY"
python scripts/dataquant.py detail ashare sh600519,sz000858 --api-key "$DATAQUANT_API_KEY"
python scripts/dataquant.py screen ashare --min-pe-ratio 0 --max-pe-ratio 30 --min-total-market-cap 1000 --sort chg_20d --api-key "$DATAQUANT_API_KEY"
python scripts/dataquant.py search ashare 600519 --api-key "$DATAQUANT_API_KEY"
python scripts/dataquant.py macro gdp --start 2020 --end 2025 --api-key "$DATAQUANT_API_KEY"
  1. Use references/api-reference.md and the online DataQuant API documentation for the complete field definitions, screen allowlist, response examples, package limits, and error-code reference. Batch requests should generally be separated by at least 0.5 seconds, and clients should respect the global 200 requests-per-minute server limit.

DataQuant Connector Data Schema & Taxonomy

Repository files

File Role Required
SKILL.md Agent activation rules, endpoint behavior, and workflow guidance Yes
skill.json Skill metadata and packaging configuration Yes
scripts/dataquant.py CLI wrapper that authenticates and calls the REST API Yes
references/api-reference.md Detailed fields, response examples, screen allowlist, plans, and errors Yes
README.md Optional project documentation No
LICENSE Optional license file No

Market taxonomy

Code Coverage
ashare A-shares, approximately 3,000 instruments
hkstock Hong Kong stocks, approximately 1,000 instruments
usstock U.S. stocks, approximately 2,000 instruments
crypto Cryptocurrencies, approximately 100 instruments
indices Global indices, approximately 15 instruments
etfs ETFs, approximately 11 instruments

Response and query organization

  • K-line responses are organized by symbol and date, and always include adj_factor; supported fields include open, high, low, close, volume, and amount.
  • K-line field aliases include o,h,l,c,v,a and their full names. Single-symbol requests default to all fields, while batch requests default to close,volume.
  • K-line pagination uses limit and offset; single and batch requests default to 100 rows, subject to the plan's max_single_rows limit.
  • Detail responses always retain symbol and date, do not include adj_factor, and default to all fields.
  • Screen responses use a fixed 23-column service-defined schema, including symbol, name, market name, date, close, valuation, size, momentum, and moving-average metrics. Filters use min_<column> and max_<column> only for allowlisted columns.
  • Search responses contain market, total, count, offset, and a symbols array of code strings; search matches symbol substrings, not Chinese instrument names.
  • Macro responses contain a data[] array. The data field is already parsed as an object, so callers do not need a second json.loads operation.
  • Quota responses expose remaining allowance for planning request batches.

Price adjustment taxonomy

  • bfq: Unadjusted prices and the default mode.
  • qfq: Forward-adjusted prices, recommended for indicator calculations to reduce dividend-related gaps.
  • hfq: Backward-adjusted prices.
  • adj_factor = hfq_close / bfq_close; adjusted prices affect open, high, low, and close, while volume and amount remain unscaled.

DataQuant Connector Advanced Features

  • Multi-market coverage through six stable market identifiers spanning equities, crypto, indices, and ETFs.
  • Single-symbol and batch K-line retrieval with date ranges, pagination, field aliases, and adjustment modes.
  • Forward-adjusted and backward-adjusted price calculations using the returned adj_factor.
  • Condition-based screening with validated min_ and max_ filters, configurable sorting, pagination, and a service-side field allowlist.
  • Symbol-substring search with explicit pagination metadata and a predictable symbols array.
  • Macroeconomic research support for GDP, CPI/PPI, and PMI indicators.
  • Quota-aware automation that can inspect remaining allowance before selecting batch size or date range.
  • Secure credential handling through environment variables and user-provided API keys; the skill never invents credentials.
  • Structured JSON output on stdout for downstream agent reasoning, scripts, notebooks, and backtesting pipelines.
  • HTTP-aware error handling: prompt users to check credentials on 401, back off and retry on 429 or 503, and rely on GET-only access without dashboard write operations.
  • Plan-aware request behavior, including row-based K-line quota accounting, instrument-based detail accounting, screen-limit accounting, and server-side rate-limit compliance.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*