Binance API
api.binance.com · Finance
World's largest crypto exchange by volume — real-time prices, order books, trades, OHLCV candles, account management, and order execution. Free API key, testnet available.
Authentication
Sample Requests
Get current Bitcoin price in USDT. No API key needed.
Hover any highlighted part to learn what it does
curl -X GET "https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT"
import requests
params = {
"symbol": "BTCUSDT"
}
response = requests.get(
"https://api.binance.com/api/v3/ticker/price",
params=params,
)
print(response.json())const url = new URL('https://api.binance.com/api/v3/ticker/price');
url.searchParams.set('symbol', 'BTCUSDT');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.binance.com/api/v3/ticker/price")
q := baseURL.Query()
q.Set("symbol", "BTCUSDT")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.binance.com/api/v3/ticker/price")
uri.query = URI.encode_www_form({
"symbol" => "BTCUSDT"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.binance.com/api/v3/ticker/price?" . http_build_query([
"symbol" => "BTCUSDT"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Get 24 hours of hourly ETH/USDT candles.
Hover any highlighted part to learn what it does
curl -X GET "https://api.binance.com/api/v3/klines?limit=24&symbol=ETHUSDT&interval=1h"
import requests
params = {
"limit": "24",
"symbol": "ETHUSDT",
"interval": "1h"
}
response = requests.get(
"https://api.binance.com/api/v3/klines",
params=params,
)
print(response.json())const url = new URL('https://api.binance.com/api/v3/klines');
url.searchParams.set('limit', '24');
url.searchParams.set('symbol', 'ETHUSDT');
url.searchParams.set('interval', '1h');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.binance.com/api/v3/klines")
q := baseURL.Query()
q.Set("limit", "24")
q.Set("symbol", "ETHUSDT")
q.Set("interval", "1h")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.binance.com/api/v3/klines")
uri.query = URI.encode_www_form({
"limit" => "24",
"symbol" => "ETHUSDT",
"interval" => "1h"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.binance.com/api/v3/klines?" . http_build_query([
"limit" => "24",
"symbol" => "ETHUSDT",
"interval" => "1h"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- Public data needs no API key
- Try GET https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT
- All symbols: GET /api/v3/ticker/price (returns all ~2000 pairs)
- Order book: GET /api/v3/depth?symbol=BTCUSDT&limit=5
- Testnet for trading: testnet.binance.vision (free)
What can you build with Binance API?
Binance API is a Finance API. Developers commonly use finance APIs for:
- processing payments and handling transactions
- building subscription and billing systems
- automating invoicing and financial reporting
- fraud detection and risk scoring
- connecting to banking and accounting software
API Key authentication. You'll receive a key after signing up. Send it with every request — in a header or query parameter. Keep it out of client-side code and never commit it to version control. Binance API is free to use up to a usage limit, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide