Binance API: Get price history
Gets Binance spot price candles for a coin and quote currency, newest by default or within a UTC date range, up to 1,000 candles.
Unofficial. Not affiliated with or endorsed by Binance.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Coin, required
coin Coin name or symbol, for example Ethereum or ETH.
BTC
- Currency optional
currency Quote currency symbol, for example USDT or BTC.
USDT
Default
USDT.- End Date optional
end_date Last day of history, UTC (inclusive), for example 2024-01-07.
2024-01-03
- Interval optional
interval Candle period, for example 1_day.
1_day
One of
1_minute,5_minutes,15_minutes,1_hour,4_hours,1_day,1_week. Default1_hour.- Start Date optional
start_date First day of history, UTC (inclusive), for example 2024-01-01.
2024-01-01
- Max Results optional
max_results Maximum candles to return, for example 100.
5
Whole number from 1 to 1000. Default
100.
Input as JSON
{ "coin": "BTC", "currency": "USDT", "end_date": "2024-01-03", "interval": "1_day", "start_date": "2024-01-01", "max_results": 5}Output
{ "pair": "BTC/USDT" , "candles": [ { "low": 42180.77, "high": 44184.1, "open": 42283.58, "close": 44179.55, "open_time": "2024-01-01T00:00:00.000+00:00", "page_link": "https://www.binance.com/en/trade/BTC_USDT" , "volume_coin": 27174.29903, "volume_currency": 1169995682.0280013, "number_of_trades": 1114623, "open_time_epoch_ms": 1704067200000 }, { "low": 44148.34, "high": 45879.63, "open": 44179.55, "close": 44946.91, "open_time": "2024-01-02T00:00:00.000+00:00", "page_link": "https://www.binance.com/en/trade/BTC_USDT" , "volume_coin": 65146.40661, "volume_currency": 2944331821.8230762, "number_of_trades": 2247532, "open_time_epoch_ms": 1704153600000 }, { "low": 40750, "high": 45500, "open": 44946.91, "close": 42845.23, "open_time": "2024-01-03T00:00:00.000+00:00", "page_link": "https://www.binance.com/en/trade/BTC_USDT" , "volume_coin": 81194.55173, "volume_currency": 3507104563.744232, "number_of_trades": 2658041, "open_time_epoch_ms": 1704240000000 } ], "interval": "1_day"}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"binance.com/get_price_history","input":{"coin":"BTC","currency":"USDT","end_date":"2024-01-03","interval":"1_day","start_date":"2024-01-01","max_results":5}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "binance.com/get_price_history" , "input": { "coin": "BTC", "currency": "USDT", "end_date": "2024-01-03", "interval": "1_day", "start_date": "2024-01-01", "max_results": 5 }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "binance.com/get_price_history" , "input": { "coin": "BTC", "currency": "USDT", "end_date": "2024-01-03", "interval": "1_day", "start_date": "2024-01-01", "max_results": 5 } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run binance.com/get_price_history# with {"coin":"BTC","currency":"USDT","end_date":"2024-01-03","interval":"1_day","start_date":"2024-01-01","max_results":5}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "coin" ], "properties": { "coin": { "type": "string", "description": "Coin name or symbol, for example Ethereum or ETH." }, "currency": { "type": "string", "default": "USDT", "description": "Quote currency symbol, for example USDT or BTC." }, "end_date": { "type": "string", "description": "Last day of history, UTC (inclusive), for example 2024-01-07." }, "interval": { "enum": [ "1_minute", "5_minutes", "15_minutes", "1_hour", "4_hours", "1_day", "1_week" ], "type": "string", "default": "1_hour", "description": "Candle period, for example 1_day." }, "start_date": { "type": "string", "description": "First day of history, UTC (inclusive), for example 2024-01-01." }, "max_results": { "type": "integer", "default": 100, "maximum": 1000, "minimum": 1, "description": "Maximum candles to return, for example 100." } }}Output schema
{ "type": "object", "required": [ "pair", "interval", "candles" ], "properties": { "pair": { "type": "string", "description": "Trading pair, for example ETH/USDT." }, "candles": { "type": "array", "items": { "type": "object", "required": [ "open_time", "open", "high", "low", "close", "volume_coin", "volume_currency", "number_of_trades", "open_time_epoch_ms", "page_link" ], "properties": { "low": { "type": "number", "description": "Lowest price in the quote currency." }, "high": { "type": "number", "description": "Highest price in the quote currency." }, "open": { "type": "number", "description": "Opening price in the quote currency." }, "close": { "type": "number", "description": "Closing price in the quote currency." }, "open_time": { "type": "string", "description": "Candle opening time in UTC, ISO 8601." }, "page_link": { "type": "string", "description": "Binance trading page for this pair." }, "volume_coin": { "type": "number", "description": "Traded volume in the coin." }, "volume_currency": { "type": "number", "description": "Traded volume in the quote currency." }, "number_of_trades": { "type": "integer", "description": "Number of trades in this candle." }, "open_time_epoch_ms": { "type": "integer", "description": "Candle opening time, epoch milliseconds." } } } }, "interval": { "type": "string", "description": "Requested candle period." } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
binance.com/get_price_history- Returns
- pair, interval, candles with open/high/low/close, volumes, trade count, open time
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method binance.com/get_price_history with the inputs above.
Ask your agent
- Show me the last 50 hourly candles for Solana against USDT
- I need daily BTC/USDT candles from 2023-06-01 through 2023-06-30 in UTC
- Pull 4-hour price candles for Dogecoin priced in BTC for the past week
- Get 15-minute open, high, low, close data for ETH paired with USDT on binance.com, max 200 candles
- What were the weekly candles for Cardano in USDT between 2022-01-01 and 2023-12-31?
See more
All Binance methodsGets a Binance spot pair's latest price and rolling 24-hour trading statistics from a coin name or symbol. Only currently trading pairs are available.
binance.com/get_coin_priceGets the current bid and ask price levels for a Binance spot pair from a coin name or symbol, with the spread.
binance.com/get_order_bookGets a coin's daily prices and price change over the last 7, 30, 90 or 365 days, with UTC dates. Today's price may change.
coingecko.com/get_coin_price_historyGets a coin's current Kraken price, bid and ask, and 24-hour trading statistics in a chosen currency, with change since today's midnight UTC open.
kraken.com/get_coin_priceGets a coin's price, market cap and 24-hour volume at 00:00 UTC on a past date. Non-USD currencies are available only for the last 365 days.
coingecko.com/get_coin_price_on_dateGets a cryptocurrency's price, 24-hour change, market statistics, popularity, tradability, description and website from its public Coinbase price page.
coinbase.com/get_coin_overviewLooks up a cryptocurrency's current Coinbase spot, buy and sell prices in a chosen currency.
coinbase.com/get_coin_priceReturns Yahoo Finance daily, weekly or monthly price history and total adjusted-close return for a stock, fund, index or cryptocurrency.
finance.yahoo.com/get_price_history