Get token price history
curl --request GET \
--url https://demo-api.mobula.io/api/2/token/price-historyimport requests
url = "https://demo-api.mobula.io/api/2/token/price-history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://demo-api.mobula.io/api/2/token/price-history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api.mobula.io/api/2/token/price-history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://demo-api.mobula.io/api/2/token/price-history"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api.mobula.io/api/2/token/price-history")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api.mobula.io/api/2/token/price-history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"priceHistory": [
[
123
]
],
"address": "<string>",
"chainId": "<string>",
"error": "<string>"
}
}History - Prices & OHLCV Candles
Get Token Price History
Retrieve 24 TWAP price points for one or multiple tokens, ideal for sparkline/linechart rendering.
GET
/
2
/
token
/
price-history
Get token price history
curl --request GET \
--url https://demo-api.mobula.io/api/2/token/price-historyimport requests
url = "https://demo-api.mobula.io/api/2/token/price-history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://demo-api.mobula.io/api/2/token/price-history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://demo-api.mobula.io/api/2/token/price-history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://demo-api.mobula.io/api/2/token/price-history"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://demo-api.mobula.io/api/2/token/price-history")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api.mobula.io/api/2/token/price-history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"priceHistory": [
[
123
]
],
"address": "<string>",
"chainId": "<string>",
"error": "<string>"
}
}Batch Support Available: This endpoint supports batch queries via POST method for fetching price history for up to 50 tokens in a single request. Jump to Batch Query section
Timestamps are in MS (JavaScript timestamps).
Overview
This endpoint retrieves 24 evenly-spaced TWAP (Time-Weighted Average Price) data points for a token, designed for lightweight sparkline and linechart rendering. Use GET for a single token or POST for batch requests (up to 50 tokens). For full OHLCV candlestick data with configurable periods, use Token OHLCV History instead.GET Request (Single Token)
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Token contract address |
chainId | string | Yes | Chain identifier (e.g., "ethereum", "base", "solana") |
timeframe | string | No | Timeframe: 5m, 15m, 1h, 24h, 7d, 30d, 1y. Default: 24h |
Example
curl -X GET "https://api.mobula.io/api/2/token/price-history?address=0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2&chainId=ethereum&timeframe=24h"
POST Request (Batch)
Request Body
Send an array of token queries directly, or an object with anitems key (minimum 1, maximum 50 per request). Each item uses the same parameters as the GET request.
Example
curl -X POST "https://api.mobula.io/api/2/token/price-history" \
-H "Content-Type: application/json" \
-d '[
{ "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "chainId": "ethereum", "timeframe": "24h" },
{ "address": "0x6982508145454ce325ddbe47a25d4ec3d2311933", "chainId": "ethereum", "timeframe": "7d" }
]'
Response Format
| Field | Type | Description |
|---|---|---|
priceHistory | number[][] | Array of [timestamp, price] tuples (24 points max) |
address | string | Token contract address |
chainId | string | Chain identifier |
error | string | Error message if the token could not be fetched (batch only) |
GET Response Example
{
"data": {
"priceHistory": [
[1739545200000, 2845.32],
[1739548800000, 2851.10],
[1739552400000, 2838.45]
],
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"chainId": "evm:1"
}
}
POST Response Example
{
"data": [
{
"priceHistory": [
[1739545200000, 2845.32],
[1739548800000, 2851.10]
],
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"chainId": "evm:1"
},
{
"priceHistory": [],
"address": "0x0000000000000000000000000000000000000000",
"chainId": "evm:1",
"error": "No pool found for this token"
}
]
}
Timeframe Options
| Timeframe | Points | Bucket Size | Description |
|---|---|---|---|
5m | 24 | ~13 seconds | Last 5 minutes |
15m | 24 | ~38 seconds | Last 15 minutes |
1h | 24 | ~2.5 minutes | Last hour |
24h | 24 | 1 hour | Last 24 hours |
7d | 24 | ~7 hours | Last 7 days |
30d | 24 | ~30 hours | Last 30 days |
1y | 24 | ~15 days | Last year |
Notes
- Always returns exactly 24 data points (fewer if the token is newer than the timeframe)
- Prices are TWAP (time-weighted average) per bucket, not close prices
- Maximum 50 tokens per POST request
- Rate limit: 2 credits (GET), 10 credits (POST)
Query Parameters
Token contract address
Blockchain chain ID (e.g., "evm:56", "solana:solana")
Time range for price history
Available options:
5m, 15m, 1h, 24h, 7d, 30d, 1y Response
200 - application/json
Token price history response
Show child attributes
Show child attributes