Get asset price history
curl --request GET \
--url https://demo-api.mobula.io/api/2/asset/price-historyimport requests
url = "https://demo-api.mobula.io/api/2/asset/price-history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://demo-api.mobula.io/api/2/asset/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/asset/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/asset/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/asset/price-history")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api.mobula.io/api/2/asset/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
]
],
"id": 123,
"name": "<string>",
"symbol": "<string>",
"chainId": "<string>",
"address": "<string>",
"error": "<string>"
}
}Price History & OHLCV
Get Asset Price History
Retrieve historical price data for one or multiple assets.
GET
/
2
/
asset
/
price-history
Get asset price history
curl --request GET \
--url https://demo-api.mobula.io/api/2/asset/price-historyimport requests
url = "https://demo-api.mobula.io/api/2/asset/price-history"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://demo-api.mobula.io/api/2/asset/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/asset/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/asset/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/asset/price-history")
.asString();require 'uri'
require 'net/http'
url = URI("https://demo-api.mobula.io/api/2/asset/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
]
],
"id": 123,
"name": "<string>",
"symbol": "<string>",
"chainId": "<string>",
"address": "<string>",
"error": "<string>"
}
}Query Parameters
Token contract address
Blockchain chain ID (required when using address)
Asset ID (alternative to address+chainId)
Candle period (e.g., "5m", "1h", "1d")
Start timestamp (unix seconds)
End timestamp (unix seconds)
Response
200 - application/json
Asset price history response
Show child attributes
Show child attributes
⌘I