Need to construct crypto worth charts on your Web3 platform? Introducing Moralis Candlestick API – the last word software for fetching OHLC knowledge. Get open, excessive, low, shut, and quantity knowledge with one single API name for any buying and selling pair. Are you keen to leap straight into the code? Try the pattern script under exhibiting you the OHLC API in motion:
import fetch from ‘node-fetch’;
const choices = {
methodology: ‘GET’,
headers: {
settle for: ‘utility/json’,
‘X-API-Key’: ‘YOUR_API_KEY’
},
};
fetch(‘https://deep-index.moralis.io/api/v2.2/pairs/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640/ohlcv?chain=eth&timeframe=1h&forex=usd&fromDate=2024-12-25&toDate=2025-01-01’, choices)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Working the script above will provide you with OHLC knowledge for the required pool and chain. Right here’s an instance of what it’d seem like:
{
//…
consequence: [
{
timestamp: ‘2025-01-01T00:00:00.000Z’,
open: 3331.696480420306,
high: 3356.4217239746795,
low: 3331.5069326442967,
close: 3356.4217239746795,
volume: 3528532.8710554917,
trades: 234
},
//…
]
}
That’s it; with this info, you may effortlessly construct and embed your personal crypto worth charts, which is an effective way to spice up retention, engagement, and the general success of your challenge. To study extra about this, try the Moralis Worth API or the get OHLCV by pair tackle documentation web page.
Prepared to make use of the Candlestick API? Join a free account immediately!
Overview
Merchants, traders, and crypto lovers use candlestick charts each day to foretell traits, perceive market conduct, and establish patterns. As such, if you’re constructing or managing a crypto-related platform – akin to a decentralized change (DEX) terminal, crypto change, or portfolio tracker – it’s an awesome concept to combine candlestick charts. Doing so may help you enhance engagement, drive progress, and propel your challenge to new heights.
Nevertheless, to construct your personal crypto worth charts, you want seamless entry to OHLCV knowledge. And fetching this info fully by yourself is less complicated mentioned than finished, requiring a classy underlying infrastructure.
So, what’s the simplest strategy to construct crypto worth charts? And what instruments can streamline your developer expertise? Should you’re in search of the solutions to those questions, be a part of us on this information as we lay all of it out for you. Let’s dive straight in!
OHLC Which means – What’s OHLC Knowledge?
OHLC knowledge – brief for Open, Excessive, Low, and Shut – captures a token’s worth actions inside a given time interval. It helps merchants and traders consider traits, establish patterns, and gauge market sentiment. This knowledge is often visualized utilizing candlestick charts.

Every OHLC knowledge level consists of the next:
Open: The value a token begins buying and selling for inside a sure time interval (e.g., hour, day, month)
Excessive: The very best worth the token traded for throughout the timeframe.
Low: The bottom worth the token traded for throughout the interval.
Shut: The value a token ends buying and selling for throughout the timeframe.
Collectively, this knowledge offers customers a snapshot of worth actions inside particular time intervals. When plotted on charts, they create a visible illustration of worth fluctuations, serving to merchants and traders analyze cryptocurrencies.
What Does OHLC & OHLCV Stand For?
Each OHLC and OHLCV are frequent acronyms relating to buying and selling. However what do they really stand for?
OHLC: Stands for Open, Excessive, Low, and Shut.
OHLCV: Quick for Open, Excessive, Low, Shut, and Quantity.
Whereas each symbolize comparable knowledge, OHLCV consists of a further metric – buying and selling quantity – for deeper evaluation.
Crypto & Bitcoin Candlestick Chart
Candlestick charts are the most typical charts in crypto. They provide merchants and traders a transparent visible illustration of OHLC knowledge. Crypto lovers use these charts every day to know the value actions of property, permitting them to establish patterns, analyze traits, and way more.
Right here’s an instance of what a candlestick chart appears like:

Every candlestick within the chart represents a selected time interval and shows the related OHLC knowledge factors. The highest and backside of every candlestick’s physique spotlight the token’s opening and shutting costs. The skinny traces – also called ”wicks” – on the high and backside present the best and lowest costs inside the timeframe.
Additionally, every candle is often color-coded: inexperienced for a worth improve (closing larger than the opening) and pink for a worth lower (closing decrease than the opening).
Furthermore, candlestick charts usually function overlays and indicators for technical evaluation (TA), making them extraordinarily helpful when analyzing cryptocurrencies. Some distinguished examples embrace Bollinger Bands, transferring averages, Fibonacci retracement ranges, and extra.
All in all, candlestick charts visually symbolize OHLC knowledge, enabling merchants and traders to investigate cryptocurrency worth actions and make certified predictions in regards to the future.
Introducing Moralis OHLC API – The Best Option to Construct Candlestick Charts
Candlestick charts are important for many crypto-related platforms, giving customers the instruments they should perceive token worth actions. Nevertheless, fetching OHLC knowledge is less complicated mentioned than finished, making it troublesome to construct correct, real-time crypto worth charts.
So, what’s the answer?
Enter Moralis Candlestick API, also called the OHLC API. This utility programming interface streamlines the method of fetching OHLC knowledge throughout all main chains, together with Ethereum, Base, Solana, and lots of extra networks.

With one easy name, you may obtain a complete response that features the opening, highest, lowest, and shutting costs for a buying and selling pair, in addition to quantity and swaps knowledge.
Let’s briefly take a look at an instance of a response:
{
//…
consequence: [
{
timestamp: ‘2025-01-01T00:00:00.000Z’,
open: 3331.696480420306,
high: 3356.4217239746795,
low: 3331.5069326442967,
close: 3356.4217239746795,
volume: 3528532.8710554917,
trades: 234
},
//…
]
}
Utilizing the OHLC knowledge offered by the Candlestick API, you may seamlessly construct charts that give your customers full perception into token worth actions. This, in flip, means that you can create extra participating experiences that may appeal to crypto merchants and traders.
However how does the Candlestick API work? And how will you use the OHLC knowledge to construct your personal crypto worth charts?
For the solutions, be a part of us within the subsequent part as we lay all of it out for you!
Tutorial: How you can Construct Crypto Worth Charts with Moralis OHLC API
On this part, we’ll present you how one can construct crypto worth charts utilizing the Candlestick API. And due to the accessibility of this premier software, you are able to do it in three easy steps:
Get a Moralis API Key
Fetch the OHLC Knowledge with the Candlestick API
Construct the Crypto Worth Chart
With no additional ado, let’s dive straight into step one of this tutorial on how one can construct crypto worth charts!
Step 1: Get a Moralis API Key
Should you haven’t already finished so, the very first thing you could do is enroll with Moralis for Builders. To take action, click on the ”Begin for Free” button on the high proper and arrange your account:

After logging in, you may fetch your Moralis API key straight below the ”Dwelling” tab:

Copy and hold the important thing for now; you’ll want it within the following part!
Step 2: Fetch the OHLC Knowledge with the Candlestick API
Arrange a brand new folder in your most popular IDE, open a brand new terminal, and initialize a challenge utilizing the command under:
npm init
From right here, set up the required dependencies with the next instructions:
npm set up node-fetch –save
npm set up moralis @moralisweb3/common-evm-utils
Subsequent, open your ”bundle.json” file and add ”sort”: ”module” to the record:

Create a brand new ”index.js” file and add the next script for fetching OHLC knowledge utilizing the Candlestick API:
import fetch from ‘node-fetch’;
const choices = {
methodology: ‘GET’,
headers: {
settle for: ‘utility/json’,
‘X-API-Key’: ‘YOUR_API_KEY’
},
};
fetch(‘https://deep-index.moralis.io/api/v2.2/pairs/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640/ohlcv?chain=eth&timeframe=1h&forex=usd&fromDate=2024-12-25&toDate=2025-01-01’, choices)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
From right here, you could configure the code barely. To begin with, substitute YOUR_API_KEY with the important thing you copied throughout step one. Subsequent, you may additionally wish to change a number of the different question parameters for those who want to fetch knowledge for an additional timeframe, token pair, and so forth:

After configuring the request, all that is still is to run the code. To take action, open a brand new terminal, cd into the basis folder, and run this command:
node index.js
In return, you’ll get a response trying one thing like this:
{
//…
consequence: [
{
timestamp: ‘2025-01-01T00:00:00.000Z’,
open: 3331.696480420306,
high: 3356.4217239746795,
low: 3331.5069326442967,
close: 3356.4217239746795,
volume: 3528532.8710554917,
trades: 234
},
//…
]
}
Congratulations! You now know how one can effortlessly fetch OHLC knowledge utilizing the Candlestick API!
Step 3: Construct the Crypto Worth Chart
Now that you’ve the OHLC knowledge from the Candlestick API, you may construct your chart. There are a number of methods to do it, however an awesome instance is to make use of TradingView’s Light-weight Charts library.
Nevertheless, for this, we’ll hand you off to one in every of our builders, who will stroll you thru your complete course of in nice element within the YouTube video down under. If you wish to soar straight into the half the place we construct the charts, you’ll discover it on the 24:10 timestamp:
That’s it! It doesn’t must be troublesome to construct crypto worth charts when working with Moralis Candlestick API!
Past the Candlestick API – Diving Deeper Into Moralis for Builders
Moralis for Builders is the business’s main Web3 knowledge supplier, providing you with entry to world-class RPC nodes and top-tier APIs. Some distinguished examples along with the Candlestick API embrace the Pockets API, Token API, Streams API, and lots of extra. Consequently, when leveraging Moralis for Builders, you get all on-chain knowledge in a single single place.

However what makes Moralis for Builders particular?
Cross-Chain Compatibility: Moralis for Builders helps all main chains, together with Ethereum, Polygon, BSC, Solana, Base, and lots of extra. And the obtainable instruments present full function parity throughout these platforms.
Complete APIs & Nodes: All APIs and Prolonged RPC Strategies are designed with the result in thoughts, providing you with extra knowledge with fewer calls. Get a pockets’s full historical past, token balances with costs, OHLC knowledge, and extra with single requests.
Excessive Safety: Moralis for Builders holds a SOC 2 Sort 2 certificates, highlighting our dedication to sustaining excessive reliability and safety throughout all instruments and options.
All in all, with instruments just like the OHLC API, Pockets API, Streams API, and so on., you may effortlessly streamline your improvement efforts and construct dapps quicker, smarter, and extra cost-effectively!
Free Candlestick Chart Widget
Whereas constructing crypto worth charts is simple with the Candlestick API, there’s an much more streamlined method: Moralis’ Worth Chart Widget. With this crypto widget, you may embed candlestick charts into your web site or utility on the click on of some buttons.
Right here’s an instance of what the Worth Chart Widget appears like:

The chart above is provided with a set of key options and parts:
Buying and selling Pair: Every chart from Moralis relies on a sure buying and selling pair that consists of a base and quote forex. Within the instance above, it’s Wrapped Bitcoin (WBTC) and Tether (USDT). Nevertheless, when configuring the widget, you may select any of the present pairs.
Actual-Time & Historic Costs: The charts additionally show OHLC knowledge within the type of candlesticks. This affords a transparent visible illustration of previous worth actions, serving to customers analyze and perceive market conduct, traits, and sentiment.
A number of Timeframes: Customers can even toggle between timeframes on the high left, altering the interval by which the OHLC knowledge is introduced. The intervals vary from as brief as one second to so long as one month.
Indicators & Overlays: All charts additionally present indicators and overlays for technical evaluation. Some examples embrace transferring averages, relative power indexes (RSIs), Bollinger Bands, and extra.
To study extra about how one can leverage the Worth Chart Widget from Moralis.com your self, please try the information on how one can add a coin worth chart to your web site!
Abstract: OHLC API – How you can Construct Crypto Worth Charts with Moralis Candlestick API
Candlestick charts are generally utilized by crypto merchants and traders to investigate traits, perceive market conduct, and establish patterns. As such, integrating charts into your platform can enhance engagement, drive progress, and improve buyer retention.
However with the intention to construct candlestick charts, you want entry to OHLC knowledge, which may be fairly a problem to fetch. And that is why we constructed the Moralis Candlestick API!
With the Candlestick API, you may seamlessly fetch OHLC knowledge for any buying and selling half with just some traces of code. Get open, excessive, low, and shut costs with only one single request and construct your personal crypto worth charts with minimal effort.
Right here’s an instance of the way you question the Candlestick API to get OHLC knowledge:
import fetch from ‘node-fetch’;
const choices = {
methodology: ‘GET’,
headers: {
settle for: ‘utility/json’,
‘X-API-Key’: ‘YOUR_API_KEY’
},
};
fetch(‘https://deep-index.moralis.io/api/v2.2/pairs/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640/ohlcv?chain=eth&timeframe=1h&forex=usd&fromDate=2024-12-25&toDate=2025-01-01’, choices)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Executing the script and calling the endpoint above will provide you with a response that appears one thing like this:
{
//…
consequence: [
{
timestamp: ‘2025-01-01T00:00:00.000Z’,
open: 3331.696480420306,
high: 3356.4217239746795,
low: 3331.5069326442967,
close: 3356.4217239746795,
volume: 3528532.8710554917,
trades: 234
},
//…
]
}
Fetching OHLC knowledge doesn’t must be tougher than this when leveraging the Candlestick API. From right here, you now have the whole lot you could construct interactive crypto worth charts that may enhance the general success of your challenge.
Need to construct crypto worth charts your self? Join with Moralis for Builders and get your API key immediately!







