Are you looking for an easy way to get token prices with an RPC node? If so, you’ve come to the right place! In today’s tutorial, we’ll introduce you to Moralis’ Extended RPC Methods and our eth_getTokenPrice endpoint. With this endpoint, you just need a single RPC request to get the price of any token. Are you eager to learn how this works? Check out the sample script below:
Running the code above will give you the price of the specified token denominated in both the chain’s native currency and USD. Here’s an example of what the response will look like:
“`json
{
jsonrpc: ‘2.0’,
id: 1,
result: {
tokenName: ‘USD Coin’,
tokenSymbol: ‘USDC’,
tokenLogo: ‘https://logo.moralis.io/0x1_0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48_032b6f94fd2bd5af6c065def140109e9’,
tokenDecimals: ‘6’,
nativePrice: {
value: ‘399015837290761’,
decimals: 18,
name: ‘Ether’,
symbol: ‘ETH’,
address: ‘0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2’
},
usdPrice: 0.9998033934658264,
usdPriceFormatted: ‘0.999803393465826414’,
’24hrPercentChange’: ‘-0.023636130935194257’,
exchangeName: ‘Uniswap v3’,
exchangeAddress: ‘0x1F98431c8aD98523631AE4a59f267346ea31F984’,
tokenAddress: ‘0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48’,
priceLastChangedAtBlock: ‘20669844’,
possibleSpam: false,
verifiedContract: true,
pairAddress: ‘0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640’,
pairTotalLiquidityUsd: ‘165658281.27’
}
}
“`
That’s it; fetching token prices with an RPC node doesn’t have to be more challenging than this. However, if you want a more in-depth tutorial, join us in this guide or check out the eth_getTokenPrice documentation page.
Ready to start using our Extended RPC Methods? Sign up for free with Moralis straightaway!
Overview
If you’re looking to build cryptocurrency wallets, portfolio trackers, tax platforms, or other similar projects, you’ll likely need access to token prices. However, fetching token prices using standard RPC methods requires multiple requests and a lot of manual data aggregations. As such, this is a time-consuming and resource-intensive process, which is why we introduced Moralis’ Extended RPC Methods.
With Moralis’ Extended RPC Methods, you now only need a single RPC request to get the price of any token. But how does this work? If you want to learn how to get token prices using an RPC node, join us in this guide as we lay it all out for you. Let’s kick things off!
What are RPC Methods?
RPC, short for “Remote Procedure Call,” refers to communication protocols that allow one software system to call and request services from software on other devices. In the blockchain space, RPC protocols enable dapps to interact with blockchain networks like Ethereum, Optimism, and Base.

There are multiple standardized RPC protocols, with JSON-RPC being a prominent example. It features many predefined RPC methods, such as eth_getProof, that streamline blockchain interactions. These RPC methods make it possible to seamlessly read and write on-chain data.
Here’s a list of prominent methods:
- eth_getTransactionByHash: Returns data about a transaction by hash.
- eth_getChainId: Returns the current chain ID.
- eth_gasPrice: Returns the current gas price.
- eth_getBalance: Returns the balance of an address.
- eth_getBlockNumber: Returns the number of the most recent block.
However, while standard RPC methods streamline blockchain interactions, they have some significant limitations you should consider. For instance, they cannot directly provide token prices. To get this data, you need to make multiple requests and even involve third-party providers.
To solve this issue and provide a more seamless developer experience, we introduced our next-generation RPC nodes!
Introducing Moralis’ Next-Generation RPC Nodes – The Easiest Way to Get Token Prices
Moralis is a prominent RPC node provider, giving you next-generation nodes that will streamline your developer experience. With our intuitive point-and-click interface, you can set up RPC nodes for all major chains, including Ethereum, Optimism, Base, Polygon, BNB Smart Chain (BSC), and many more with ease.

But what makes our RPC nodes special?
- Speed: We set the industry benchmark for speed, with response times from 70 ms.
- Reliability: Moralis’ nodes boast an impressive 99.9% uptime, making sure you get all the data you need without any trouble.
- Extended RPC Methods: With our Extended RPC Methods, you can easily query decoded, human-readable data through RPC-style requests.
Experience the next generation of RPC nodes with lightning-fast response times, unmatched reliability, and our powerful Extended RPC Methods!
Extended RPC Methods
With Moralis’ Extended RPC Methods, you can now seamlessly get decoded, human-readable data through RPC-style requests. With just one call, you can fetch NFT balances, ERC-20 balances, decoded wallet history, metadata, token prices, and much more. As such, when using Moralis, you can streamline your developer experience and build dapps faster and more efficiently.

Here are all the available methods:
- eth_getTokenPrice: Get the price of any ERC-20 token.
- eth_getNFTBalances: Fetch the NFT balance of a wallet.
- eth_getNFTCollections: Get all collections held by a wallet.
- eth_getTransactions: Query the native transactions of a wallet.
- eth_getDecodedTransactions: Get a wallet’s full transaction history.
- eth_getTokenBalances: Query the ERC-20 balances of a wallet.
- eth_getTokenMetadata: Get the metadata of an ERC-20 token.
eth_getTokenPrice – Get Token Prices with one RPC Call
With our eth_getTokenPrice method, you can now seamlessly get token prices without breaking a sweat. All you need is a single RPC request, and you’ll receive the price of any token denominated in both the chain’s native cryptocurrency and USD. As such, it has never been easier to get token prices using an RPC node than when working with Moralis.

But how does the eth_getTokenPrice method work? And what exactly does a response look like? If you’re looking for the answers to these questions, read on, and we’ll guide you through a comprehensive tutorial on how to get token prices using an RPC node in three simple steps!
3-Step Tutorial: How to Get Token Prices with an RPC Node
We’ll now show you how to get token prices with an RPC node. Thanks to the accessibility of our Extended RPC Methods, you can get this data in three simple steps:
- Sign Up with Moralis & Set Up a Node
- Write a Script Calling eth_getTokenPrice
- Run the Code
However, before you can move on, you need to take care of a couple of prerequisites!
Prerequisites
If you haven’t already, make sure you have the following ready before continuing:
Step 1: Sign Up with Moralis & Set Up a Node
Sign up for a Moralis account by clicking the ”Start for Free” button at the top right:

Log in, navigate to the ”Nodes” tab, and hit ”+ Create Node”:

Select ”Ethereum,” ”Mainnet,” and click ”Create Node”:
