Want to build crypto price charts for your Web3 platform? Introducing Moralis Candlestick API – the ultimate tool for fetching OHLC data. Get open, high, low, close, and volume data with one single API call for any trading pair. Are you eager to jump straight into the code? Check out the sample script below showing you the OHLC API in action:
import fetch from 'node-fetch'; const options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' }, }; fetch('https://deep-index.moralis.io/api/v2.2/pairs/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640/ohlcv?chain=eth&timeframe=1h¤cy=usd&fromDate=2024-12-25&toDate=2025-01-01', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
Running the script above will give you OHLC data for the specified pool and chain. Here’s an example of what it might look like:
{ //... result: [ { 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 information, you can effortlessly build and embed your own crypto price charts, which is a great way to boost retention, engagement, and the overall success of your project. To learn more about this, check out the Moralis Price API or the get OHLCV by pair address documentation page.
Ready to use the Candlestick API? Sign up for a free account today!
Overview
Traders, investors, and crypto enthusiasts use candlestick charts on a daily basis to predict trends, understand market behavior, and identify patterns. As such, if you are building or managing a crypto-related platform – such as a decentralized exchange (DEX) terminal, crypto exchange, or portfolio tracker – it’s a great idea to integrate candlestick charts. Doing so can help you boost engagement, drive growth, and propel your project to new heights.

However, to build your own crypto price charts, you need seamless access to OHLCV data. And fetching this information entirely on your own is easier said than done, requiring a sophisticated underlying infrastructure.
So, what’s the easiest way to build crypto price charts? And what tools can streamline your developer experience? If you’re looking for the answers to these questions, join us in this guide as we lay it all out for you. Let’s dive straight in!
OHLC Meaning – What is OHLC Data?
OHLC data – short for Open, High, Low, and Close – captures a token’s price movements within a given time period. It helps traders and investors evaluate trends, identify patterns, and gauge market sentiment. This data is commonly visualized using candlestick charts.

Each OHLC data point includes the following:
- Open: The price a token begins trading for within a certain time period (e.g., hour, day, month)
- High: The highest price the token traded for within the timeframe.
- Low: The lowest price the token traded for within the period.
- Close: The price a token ends trading for within the timeframe.
Together, this data gives users a snapshot of price movements within specific time periods. When plotted on charts, they create a visual representation of price fluctuations, helping traders and investors analyze cryptocurrencies.
What Does OHLC & OHLCV Stand For?
Both OHLC and OHLCV are common acronyms when it comes to trading. But what do they actually stand for?
- OHLC: Stands for Open, High, Low, and Close.
- OHLCV: Short for Open, High, Low, Close, and Volume.
While both represent similar data, OHLCV includes an additional metric – trading volume – for deeper analysis.
Crypto & Bitcoin Candlestick Chart
Candlestick charts are the most common charts in crypto. They give traders and investors a clear visual representation of OHLC data. Crypto enthusiasts use these charts daily to understand the price movements of assets, allowing them to identify patterns, analyze trends, and much more.
Here’s an example of what a candlestick chart looks like:

Each candlestick in the chart represents a specific time period and displays the associated OHLC data points. The top and bottom of each candlestick’s body highlight the token’s opening and closing prices. The thin lines – also known as ”wicks” – at the top and bottom show the highest and lowest prices within the time frame.
Also, each candle is typically color-coded: green for a price increase (closing higher than the opening) and red for a price decrease (closing lower than the opening).
Moreover, candlestick charts typically feature overlays and indicators for technical analysis (TA), making them extremely useful when analyzing cryptocurrencies. Some prominent examples include Bollinger Bands, moving averages, Fibonacci retracement levels, and more.
All in all, candlestick charts visually represent OHLC data, enabling traders and investors to analyze cryptocurrency price movements and make qualified predictions about the future.
Introducing Moralis OHLC API – The Easiest Way to Build Candlestick Charts
Candlestick charts are essential for most crypto-related platforms, giving users the tools they need to understand token price movements. However, fetching OHLC data is easier said than done, making it difficult to build accurate, real-time crypto price charts.
So, what’s the solution?
Enter Moralis Candlestick API, also known as the OHLC API. This application programming interface streamlines the process of fetching OHLC data across all major chains, including Ethereum, Base, Solana, and many more networks.

With one simple call, you can receive a comprehensive response that includes the opening, highest, lowest, and closing prices for a trading pair, as well as volume and swaps data.
Let’s briefly look at an example of a response:
{ //... result: [ { timestamp: '2025-01-01T00:00:00.000Z', open: 3331.696480420306, high: 3356.4217239746795, low: 3331.5069326442967, close: 3356.4217239746795, volume: 3528532.8710554917, trades: 234 }, //... ] }
Using the OHLC data provided by the Candlestick API, you can seamlessly build charts that give your users complete insight into token price movements. This, in turn, allows you to create more engaging experiences that will attract crypto traders and investors.
But how does the Candlestick API work? And how can you use the OHLC data to build your own crypto price charts?
For the answers, join us in the next section as we lay it all out for you!
Tutorial: How to Build Crypto Price Charts with Moralis OHLC API
In this section, we’ll show you how to build crypto price charts using the Candlestick API. And thanks to the accessibility of this premier tool, you can do it in three simple steps:
- Get a Moralis API Key
- Fetch the OHLC Data with the Candlestick API
- Build the Crypto Price Chart
With no further ado, let’s dive straight into the first step of this tutorial on how to build crypto price charts!
Step 1: Get a Moralis API Key
If you haven’t already done so, the first thing you need to do is sign up with Moralis for Developers. To do so, click the ”Start for Free” button at the top right and set up your account:

After logging in, you can fetch your Moralis API key directly under the ”Home” tab:

Copy and keep the key for now; you’ll need it in the following section!
Step 2: Fetch the OHLC Data with the Candlestick API
Set up a new folder in your preferred IDE, open a new terminal, and initialize a project using the command below:
npm init
From here, install the required dependencies with the following commands:
npm install node-fetch --save npm install moralis @moralisweb3/common-evm-utils
Next, open your ”package.json” file and add ”type”: ”module”
to the list:

Create a new ”index.js” file and add the following script for fetching OHLC data using the Candlestick API:
import fetch from 'node-fetch'; const options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' }, }; fetch('https://deep-index.moralis.io/api/v2.2/pairs/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640/ohlcv?chain=eth&timeframe=1h¤cy=usd&fromDate=2024-12-25&toDate=2025-01-01', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
From here, you need to configure the code slightly. First of all, replace YOUR_API_KEY
with the key you copied during the first step. Next, you might also want to change some of the other query parameters if you wish to fetch data for another timeframe, token pair, and so on:

After configuring the request, all that remains is to run the code. To do so, open a new terminal, cd into the root folder, and run this command:
node index.js
In return, you’ll get a response looking something like this:
{ //... result: [ { 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 to effortlessly fetch OHLC data using the Candlestick API!
Step 3: Build the Crypto Price Chart
Now that you have the OHLC data from the Candlestick API, you can build your chart. There are multiple ways to do it, but a great example is to use TradingView’s Lightweight Charts library.
However, for this, we’ll hand you off to one of our developers, who will walk you through the entire process in great detail in the YouTube video down below. If you want to jump straight into the part where we build the charts, you’ll find it at the 24:10 timestamp:
That’s it! It doesn’t have to be difficult to build crypto price charts when working with Moralis Candlestick API!
Beyond the Candlestick API – Diving Deeper Into Moralis for Developers
Moralis for Developers is the industry’s leading Web3 data provider, giving you access to world-class RPC nodes and top-tier APIs. Some prominent examples in addition to the Candlestick API include the Wallet API, Token API, Streams API, and many more. Consequently, when leveraging Moralis for Developers, you get all on-chain data in one single place.

But what makes Moralis for Developers special?
- Cross-Chain Compatibility: Moralis for Developers supports all major chains, including Ethereum, Polygon, BSC, Solana, Base, and many more. And the available tools provide full feature parity across these platforms.
- Comprehensive APIs & Nodes: All APIs and Extended RPC Methods are designed with the outcome in mind, giving you more data with fewer calls. Get a wallet’s full history, token balances with prices, OHLC data, and more with single requests.
- High Security: Moralis for Developers holds a SOC 2 Type 2 certificate, highlighting our commitment to maintaining high reliability and security across all tools and features.
All in all, with tools like the OHLC API, Wallet API, Streams API, etc., you can effortlessly streamline your development efforts and build dapps faster, smarter, and more cost-effectively!
Free Candlestick Chart Widget
While building crypto price charts is easy with the Candlestick API, there’s an even more streamlined approach: Moralis’ Price Chart Widget. With this crypto widget, you can embed candlestick charts into your website or application at the click of a few buttons.
Here’s an example of what the Price Chart Widget looks like:

The chart above is equipped with a set of key features and components:
- Trading Pair: Each chart from Moralis is based on a certain trading pair that consists of a base and quote currency. In the example above, it’s Wrapped Bitcoin (WBTC) and Tether (USDT). However, when configuring the widget, you can choose any of the existing pairs.
- Real-Time & Historical Prices: The charts also display OHLC data in the form of candlesticks. This offers a clear visual representation of past price movements, helping users analyze and understand market behavior, trends, and sentiment.
- Multiple Timeframes: Users can also toggle between timeframes at the top left, changing the period in which the OHLC data is presented. The intervals range from as short as one second to as long as one month.
- Indicators & Overlays: All charts also provide indicators and overlays for technical analysis. Some examples include moving averages, relative strength indexes (RSIs), Bollinger Bands, and more.
To learn more about how you can leverage the Price Chart Widget from Moralis.com yourself, please check out the guide on how to add a coin price chart to your website!
Summary: OHLC API – How to Build Crypto Price Charts with Moralis Candlestick API
Candlestick charts are commonly used by crypto traders and investors to analyze trends, understand market behavior, and identify patterns. As such, integrating charts into your platform can boost engagement, drive growth, and enhance customer retention.
But in order to build candlestick charts, you need access to OHLC data, which can be quite a challenge to fetch. And this is why we built the Moralis Candlestick API!
With the Candlestick API, you can seamlessly fetch OHLC data for any trading part with just a few lines of code. Get open, high, low, and close prices with just one single request and build your own crypto price charts with minimal effort.
Here’s an example of how you query the Candlestick API to get OHLC data:
import fetch from 'node-fetch'; const options = { method: 'GET', headers: { accept: 'application/json', 'X-API-Key': 'YOUR_API_KEY' }, }; fetch('https://deep-index.moralis.io/api/v2.2/pairs/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640/ohlcv?chain=eth&timeframe=1h¤cy=usd&fromDate=2024-12-25&toDate=2025-01-01', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
Executing the script and calling the endpoint above will give you a response that looks something like this:
{ //... result: [ { 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 data doesn’t have to be more difficult than this when leveraging the Candlestick API. From here, you now have everything you need to build interactive crypto price charts that will boost the overall success of your project.
Want to build crypto price charts yourself? Sign up with Moralis for Developers and get your API key today!
What is ERC-4337? Full EIP-4337 Guide