Getting Quotes via REST API
Learn how to fetch up-to-date cryptocurrency prices by making requests to Upbit’s REST API.
Get Started
With the Upbit Quotation API, you can retrieve the following types of market information:
- Trading Pairs: All trading pairs supported on Upbit.
- Candles(OHLCV): Time-based OHLCV data (open, high, low, close, volume) for intervals such as seconds, minutes, days, weeks, months, or years.
- Trades: Recent trade history for a pair, including trade direction, time, price, volume, previous closing price, etc.
- Tickers: Snapshot data including latest trade time, open/high/low/close, previous close, price change, and trading volume.
- Orderbook: Current bid/ask prices and order sizes.
This tutorial shows you how to fetch market data using cURL and common programming languages (Python, Java, Node.js).
- Singapore (sg): https://sg-api.upbit.com
- Indonesia (id): https://id-api.upbit.com
- Thailand (th): https://th-api.upbit.com
Setting Up Your Development Environment
Before starting, refer to the Development Environment Setup Guide to prepare your preferred programming language. This tutorial includes example code for each recommended HTTP client library by language. If you use cURL, you don't need to set up a programming environment—use your default terminal on macOS or cmd/PowerShell on Windows. See First Upbit API Call for a cURL setup walkthrough.
1. Querying Trading Pairs and Ticker Snapshot
First, retrieve the full list of Upbit market pairs, then select a pair to get its current ticker snapshot.
Getting Trading pair
The Trading Pairs API returns all supported trading pairs. The market
field in each response object is required for most Upbit API calls. You can include the optional is_details
parameter to get extended information about each pair.
curl --request GET \
--url https://sg-api.upbit.com/v1/market/all
import requests
url = "https://sg-api.upbit.com/v1/market/all"
headers = {"accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://sg-api.upbit.com/v1/market/all")
.get()
.addHeader("accept", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sg-api.upbit.com/v1/market/all"))
.header("accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://sg-api.upbit.com/v1/market/all',
headers: {accept: 'application/json'}
};
axios
.request(options)
.then(res => console.log(res.data))
.catch(err => console.error(err));
Response
[
{
"market": "SGD-ETH",
"english_name": "Ethereum",
"market_warning": "NONE"
},
{
"market": "SGD-XRP",
"english_name": "XRP",
"market_warning": "NONE"
},
{
"market": "SGD-BTC",
"english_name": "Bitcoin",
"market_warning": "NONE"
},
{
"market": "SGD-USDT",
"english_name": "Tether",
"market_warning": "NONE"
},
{
"market": "SGD-SOL",
"english_name": "Solana",
"market_warning": "NONE"
}
]
Getting Ticker Data
To get the latest price snapshot for a pair (e.g., SGD-BTC), use the market
value as the markets
parameter. You can request multiple pairs at once.
cURL
curl --request GET \
--url 'https://sg-api.upbit.com/v1/ticker?markets=SGD-BTC' \
--header 'accept: application/json'
import requests
url = "https://sg-api.upbit.com/v1/ticker?markets=SGD-BTC"
headers = {"accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://sg-api.upbit.com/v1/ticker?markets=SGD-BTC")
.get()
.addHeader("accept", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://sg-api.upbit.com/v1/ticker?markets=SGD-BTC"))
.header("accept", "application/json")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://sg-api.upbit.com/v1/ticker?markets=SGD-BTC',
headers: {accept: 'application/json'}
};
axios
.request(options)
.then(res => console.log(res.data))
.catch(err => console.error(err));
Response
[
{
"market": "SGD-BTC",
"trade_date": "20250730",
"trade_time": "211143",
"trade_timestamp": 1753909903935,
"opening_price": 153473,
"high_price": 153504,
"low_price": 151937,
"trade_price": 152114,
"prev_closing_price": 151721,
"change": "RISE",
"change_price": 393,
"change_rate": 0.0025902808,
"signed_change_price": 393,
"signed_change_rate": 0.0025902808,
"trade_volume": 0.00010706,
"acc_trade_price": 4564.10881053,
"acc_trade_price_24h": 4564.10881053,
"acc_trade_volume": 0.0299313,
"acc_trade_volume_24h": 0.0299313,
"highest_52_week_price": 157745,
"highest_52_week_date": "2025-07-14",
"lowest_52_week_price": 65687,
"lowest_52_week_date": "2024-08-05",
"timestamp": 1753973875026
}
]
2. Candles(OHLCV)
Candles—also called candlesticks—are the basic units that make up a price chart. You can request up to 200 candles per request; if you need more, we recommend using pagination to fetch them sequentially.
Get Recent Candles
For example, get the latest three 5-minute candles for SGD-BTC:
curl --request GET \
--url 'https://sg-api.upbit.com/v1/candles/minutes/5?market=SGD-BTC&count=3'
Response
[
{
"market": "SGD-BTC",
"candle_date_time_utc": "2025-07-30T21:00:00",
"opening_price": 153099,
"high_price": 153099,
"low_price": 153099,
"trade_price": 153099,
"timestamp": 1753975737223,
"candle_acc_trade_price": 26.72649243,
"candle_acc_trade_volume": 0.00017457,
"unit": 5
},
...
]
Get candles for a specific time with the to
parameter
to
parameterUse the to
parameter (ISO 8601 format) to fetch candles before a specific timestamp.
-
One 1-minute candle before 00:00 (UTC):
https://sg-api.upbit.com/v1/candles/minutes/1?market=SGD-BTC&to=2025-07-24T00:00:00Z
-
One 1-minute candle before 7:00 SGT (UTC+08:00):
https://sg-api.upbit.com/v1/candles/minutes/1?market=SGD-BTC&to=2025-07-27T07:00:00+08:00
If you specify the to parameter, be sure to apply URL encoding before sending the request, as shown below:
https://sg-api.upbit.com/v1/candles/minutes/1?market=SGD-BTC&to=2025-09-27T07:00:00%2B08:00
Candle Generation Rules
- A candle is created only if trades occurred during that interval.
- If no trades occurred, the candle is not generated and will not appear in the response.
Note: If a candle is missing for a time interval, it simply means there were no trades. This is expected behavior, so be sure to handle empty intervals in your application.
3. Trades
A trade occurs when a buy and sell order are matched. The List Pair Trades API returns up to 200 recent trades from the past seven days. Use pagination for larger queries.
Basic Trade Query
curl --request GET \
--url 'https://sg-api.upbit.com/v1/trades/ticks?market=SGD-BTC' \
--header 'accept: application/json'
Query by Date
To query by date, use the days_ago
parameter. For example, days_ago=2
returns trades from two days ago (UTC), in reverse chronological order.
curl --request GET \
--url 'https://sg-api.upbit.com/v1/trades/ticks?market=SGD-BTC&days_ago=2' \
--header 'accept: application/json'
Query with Time Cutoff
To get trade history from a specific time two days ago, use the to
parameter.
Using the time specified in to
, the API returns trades executed before that time in reverse chronological order.
In the example below, it returns trades before 22:00:00 UTC.
curl --request GET \
--url 'https://sg-api.upbit.com/v1/trades/ticks?market=SGD-BTC&to=220000&days_ago=2' \
--header 'accept: application/json'
Response
[
{
"market": "SGD-BTC",
"trade_date_utc": "2025-07-31",
"trade_time_utc": "15:28:57",
"timestamp": 1753975737159,
"trade_price": 153099,
"trade_volume": 0.00008736,
"prev_closing_price": 152114,
"change_price": 985,
"ask_bid": "ASK",
"sequential_id": 1753975737159000
}
]
4. Orderbook
You can query orderbook (market depth) information matching the real-time orderbook UI. Use the Orderbook API for a specific market.
curl --request GET \
--url 'https://sg-api.upbit.com/v1/orderbook?markets=SGD-BTC&count=2' \
--header 'accept: application/json'
The orderbook response is shown below.
This request was made with the count
parameter set to 2, which returns two order book entries.
Response
[
{
"market": "SGD-BTC",
"timestamp": 1753973734372,
"total_ask_size": 10.6377063,
"total_bid_size": 0.74153973,
"orderbook_units": [
{
"ask_price": 153487,
"bid_price": 153105,
"ask_size": 0.00011366,
"bid_size": 0.17
},
{
"ask_price": 162769,
"bid_price": 142061,
"ask_size": 0.00310058,
"bid_size": 0.00339343
}
],
"level": 1
}
]
The first object in orderbook_units
contains the best ask/bid prices and order sizes at the time of the request. For example:
- Best Ask: 153,487 SGD for 0.00011366 BTC
- Best Bid: 153,105 SGD for 0.17 BTC
The second object shows the next level in the order book, representing the second-best ask and bid prices.
Updated 9 days ago