Skip to content

Guide · Agent skill

How to use the OKX Market Data agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The OKX Market Data skill (skill name okx-market) teaches an AI agent how to query OKX's public market-data API for cryptocurrency prices, candlesticks, order books, funding rates and open interest. This guide explains what a skill is, how to install this one, how to ask for data in plain language, and what to check before relying on the output. You do not need an OKX account or API key.

OKX Market DataHKUDS/Vibe-Trading · MIT

Quick start

  1. 1Download the ZIP. Download the okx-market skill ZIP from this page.
  2. 2Unzip into a skills folder. Extract it into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder.
  3. 3Or upload in the Claude apps. Go to Settings → Capabilities → Skills and upload the ZIP.
  4. 4Install Python dependencies. Run pip install requests pandas on a machine with Python 3.9 or newer.
  5. 5Ask a plain-language question. Name the asset and market type, for example BTC-USDT-SWAP funding rate.
  6. 6Check the output. Confirm the instrument, interval and timestamp match what you asked for.

What is an agent skill and what does this one do?

An agent skill is a folder of instructions and reference files that an AI agent loads when a task matches it. This skill is defined in a SKILL.md file and covers OKX's V5 REST API for spot, perpetual swap, delivery futures, option and index market data.

Once installed, the agent knows which endpoint to use for each request, what parameters it needs and how to read the response. It can write and run Python code that fetches the data and then summarises or tabulates it.

  • Current prices and 24h ticker data for single or batches of instruments
  • Candlestick (OHLCV) history at intervals from 1m to 1M
  • Order book depth and recent trades
  • Perpetual-swap funding rates, historical funding rates and mark prices
  • Open interest, price limits and index prices

How do you install the OKX Market Data skill?

Download the ZIP of the skill from this page. Then choose one of two routes depending on how you use your agent.

For Claude Code, unzip the file into ~/.claude/skills/ to make it available in all your projects, or into a project's .claude/skills/ folder to limit it to that project. For the Claude apps, upload the ZIP under Settings → Capabilities → Skills.

  • Personal install: ~/.claude/skills/
  • Project install: .claude/skills/ inside your project folder
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

What do you need installed before it runs?

The skill's example scripts need Python 3.9 or newer, the requests library and the pandas library. The source lists the install command below. The skill also needs internet access to www.okx.com.

No account, token or configuration is needed because the market-data endpoints are public.

  • Python 3.9+
  • requests library
  • pandas library (used by the example scripts)
  • Internet access to www.okx.com
pip install requests pandas

How do you trigger the skill with a natural request?

You do not need to name the skill. Describe the data you want in plain words and mention the asset and, if relevant, the market type. The agent will match the request to the skill and choose the matching endpoint.

Be specific about the instrument. OKX uses codes such as BTC-USDT for spot, BTC-USDT-SWAP for perpetual swaps and BTC-USD for index data, so saying 'BTC perpetual' is clearer than 'bitcoin'.

  • 'What is the latest BTC-USDT price on OKX?'
  • 'Get the last 100 daily candles for ETH-USDT and tabulate the closing prices.'
  • 'Show the current funding rate and next settlement time for BTC-USDT-SWAP.'
  • 'Which perpetual swaps have the highest open interest right now?'

What parameter formats should you know?

The skill uses a consistent set of codes. Knowing them helps you phrase requests and check the agent's output.

Timestamps are millisecond Unix timestamps. Responses are JSON, where code=0 means success and the data sits in the data field.

  • Instrument (instId): BTC-USDT (spot), BTC-USDT-SWAP (perpetual), BTC-USDT-250328 (delivery, expiry in YYMMDD), BTC-USD-250328-95000-C (option), BTC-USD (index)
  • Candle interval (bar): 1m, 3m, 5m, 15m, 30m, 1H, 2H, 4H, 6H, 12H, 1D, 1W, 1M
  • Instrument type (instType): SPOT, SWAP, FUTURES, OPTION

What does a working example look like?

The skill includes a reference example for the spot ticker endpoint. It calls the public ticker route and prints the last price with the 24h change. The agent adapts this pattern for other endpoints by reading the matching file in the references folder.

The skill also ships scripts/candle_data_example.py for candlestick retrieval, and each endpoint has its own reference document with input and output tables.

  • Endpoint reference files are in the references folder, grouped into spot, derivatives and index markets
  • scripts/candle_data_example.py retrieves candlestick data
BASE_URL = "https://www.okx.com/api/v5" resp = requests.get(f"{BASE_URL}/market/ticker", params={"instId": "BTC-USDT"}) data = resp.json()["data"][0]

What should you know about safety and network use?

This skill runs scripts and makes network requests to www.okx.com. Read any script before running it, and run it only in an environment you trust. The skill is read-only: its documented endpoints are public market data, and it does not cover placing or managing orders.

The data is a live exchange feed. The source does not guarantee completeness or accuracy, so verify important figures independently before using them in reports or trading decisions.

  • The skill covers public, read-only market data only
  • Any trading decision based on this data carries financial risk
  • Check figures against OKX directly for anything important

What people use it for

  • Pulling a quick snapshot of BTC and ETH spot prices and 24h change
  • Tabulating daily or hourly candles for a chart or report
  • Comparing perpetual-swap funding rates across instruments
  • Ranking perpetual contracts by open interest
  • Teaching how crypto exchange APIs and funding rates work

Frequently asked questions

Do I need an OKX account or API key to use this skill?

No. The skill's source states that all market-data endpoints are public and can be called without authentication, and that no account registration or token configuration is required.

Is the OKX Market Data skill free?

The skill's description says it is free to use, and it is released under the MIT licence. OKX's own terms apply to the data itself, so check those if you redistribute it.

What do I need to install to run it?

You need Python 3.9 or newer, the requests library and the pandas library. The skill also needs internet access to www.okx.com.

Where do I put the skill files?

Unzip the ZIP into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.

Can this skill place trades?

No. It covers only public, read-only market data. Trading or placing orders is outside its scope, and any decision based on the data carries financial risk.

How is this different from using the OKX website or another data provider?

This skill lets an agent fetch OKX public endpoints and write code to summarise them. The website shows charts directly, while other providers may offer different coverage or history. The source does not compare it with other tools, so test the data against your own needs.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits analysts, traders and developers who want scripted, read-only snapshots of OKX prices, candles, funding rates and open interest, with no API key. It is not suited to placing trades or to regulated financial reporting, since the data is a live feed that should be verified independently.

Download the skill