Guides
Get OHLCV prices for crypto tokens
OHLCV (Open, High, Low, Close, Volume) data is indispensable for conducting thorough market analysis.
Mobula API provides access to real-time and historical OHLCV data for a wide range of assets. This guide will detail how to retrieve this data effectively.
What you’ll need
- Basic knowledge of RESTful APIs and JavaScript.
- Optional: Preferences for specific token(s), cache settings, and stale data handling.
- An API key from the Dashboard (required for production; optional in development mode).
Walkthrough
1
Execute the API Call
You can call Mobula API using cURL or any HTTP client.
Using cURL:
curl --request GET \
--url 'https://api.mobula.io/api/1/market/history?asset=base&blockchain=base'
Using Axios:
import axios from "axios";
axios.get('https://api.mobula.io/api/1/market/history?asset=base&blockchain=base')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})
2
Review the Response
The API will return a comprehensive response including historical price data with timestamps and corresponding values.
{
"data": {
"price_history": [
[
1690848000000,
6.591077336435656e-7
],
[
1690869600000,
0.00000195159542182393
],
[
1690891200000,
0.0000016428397923859638
],
[
1690912800000,
0.0000019099557143586473
],
[
"...",
"..."
]
]
}
}
With this information, you can:
- Analytic Integration: Using volume change data to power a tool that delivers insights on such asset performance.
- Analyze Market Trends: Track the asset’s volume fluctuations over time.
- Assess Investment Opportunities: Gain insights into potential investment decisions based on the volume.
Need help?
Can’t find what you’re looking for? Reach out to us, response times < 1h.