How to Get Tokens, Transactions, Metadata, NFTs, and Prices on Ethereum

·

The Ethereum blockchain is a treasure trove of valuable data — from token balances and transaction histories to NFT metadata and real-time price information. However, accessing this data efficiently has historically required deep technical expertise and significant infrastructure investment. That’s where ETH API comes in: a powerful gateway that simplifies how developers retrieve and use on-chain data for decentralized applications (dApps).

Whether you're building a Web3 wallet, an NFT marketplace, or a real-time analytics dashboard, leveraging an Ethereum API streamlines development, reduces complexity, and accelerates time-to-market.


What Is ETH API?

ETH API — short for Ethereum Application Programming Interface — refers to a set of standardized protocols, methods, and tools that allow seamless interaction with the Ethereum blockchain. It enables developers to fetch live blockchain data without running their own nodes or managing complex backend infrastructure.

One of the biggest challenges in Web3 development is setting up reliable communication with the blockchain. Building this from scratch demands extensive coding, server maintenance, and ongoing node synchronization. With ETH API, these hurdles are eliminated. You get instant access to critical blockchain functions such as:

By using pre-built endpoints, developers avoid reinventing the wheel and can focus on building innovative features instead of maintaining infrastructure.

👉 Discover how easy it is to integrate blockchain data into your app


Key Features of Modern Ethereum APIs

Today’s leading ETH APIs offer modular, scalable solutions designed for speed and accuracy. Here are some core components that make them indispensable for Web3 development.

Wallet API: Access On-Chain Balances and History

If you're building a crypto wallet or integrating wallet functionality into your dApp, the Wallet API is essential. It supports hundreds of millions of addresses across all major EVM-compatible chains, including Ethereum, Binance Smart Chain, Polygon, and more.

With just a few lines of code, you can retrieve:

Example: Get Native Balance

const response = await Moralis.EvmApi.balance.getNativeBalance({
  chain: "0x1",
  address: "0xDC24316b9AE028F1497c275EB9192a3Ea0f67022"
});

This returns the wallet’s ETH balance in wei units, which can be easily converted to ether.

Example: Get ERC-20 Token Balances

const response = await Moralis.EvmApi.token.getWalletTokenBalances({
  chain: "0x1",
  address: "0x1f9090aaE28b8a3dCeaDf281B0F12828e676c326"
});

This fetches all ERC-20 tokens held by the specified address.

Example: Get Wallet NFTs

const response = await Moralis.EvmApi.nft.getWalletNFTs({
  chain: "0x1",
  address: "0xff3879b8a363aed92a6eaba8f61f1a96a9ec3c1e"
});

Returns a complete list of NFTs owned by the wallet, including collection name, token ID, and metadata URI.


NFT API: Unlock NFT Data at Scale

The NFT API is the go-to solution for fetching comprehensive non-fungible token data. It supports over 3 million NFT collections across major blockchains — from newly launched drops to iconic projects like CryptoPunks and Pudgy Penguins.

Key capabilities include:

Example: Get NFT Metadata

const response = await Moralis.EvmApi.nft.getNFTMetadata({
  chain: "0x1",
  address: "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB",
  tokenId: "1"
});

This retrieves detailed metadata for a specific NFT — crucial for displaying rich content in marketplaces or portfolios.

Example: Get Wallet NFT Transfers

const response = await Moralis.EvmApi.nft.getWalletNFTTransfers({
  chain: "0x1",
  address: "0x1f9090aaE28b8a3dCeaDf281B0F12828e676c326"
});

Useful for tracking user activity or auditing transaction patterns.

Example: Get Lowest NFT Price

const response = await Moralis.EvmApi.nft.getNFTLowestPrice({
  chain: "0x1",
  address: "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
});

Perfect for price comparison tools or alert systems when floor prices drop.

👉 Start pulling live NFT and token data in minutes


Streams API: Real-Time Blockchain Monitoring

While batch queries are useful, many applications require real-time updates — such as detecting incoming payments or monitoring smart contract events. This is where the Streams API shines.

With Streams API, you can:

How It Works – 3 Simple Steps:

  1. Configure the Stream: Choose the blockchain network, define event filters, and set your webhook URL.
  2. Create the Stream: Generate your unique stream ID and test endpoint.
  3. Add Addresses: Subscribe specific wallets or contracts to monitor.

Once live, your server receives real-time JSON payloads every time a matching event occurs — no polling required.


Step-by-Step Guide: Fetch Ethereum Data Using ETH API

Let’s walk through how to retrieve actual blockchain data using a modern ETH API provider.

Prerequisites

Before starting, ensure you have:

We’ll use JavaScript in this example, but most APIs also support Python, TypeScript, and other languages.

Step 1: Get Your API Key

To authenticate requests, you need an API key from your chosen provider (e.g., Moralis). Sign up for free, go to your dashboard, navigate to “Settings,” then copy your key under “API Keys.”

Keep this secure — never expose it in frontend code.

Step 2: Set Up Your Project and Script

Initialize a new project:

npm init -y
npm install moralis @moralisweb3/common-evm-utils

Create index.js with the following code:

const Moralis = require("moralis").default;
const { EvmChain } = require("@moralisweb3/common-evm-utils");

const runApp = async () => {
  await Moralis.start({
    apiKey: "YOUR_API_KEY_HERE",
  });

  const address = '0x26fcbd3afebbe28d0a8684f790c48368d21665b5';
  const chain = EvmChain.ETHEREUM;

  const response = await Moralis.EvmApi.balance.getNativeBalance({
    address,
    chain,
  });

  console.log(response.toJSON());
};

runApp();

Replace YOUR_API_KEY_HERE with your actual key.

Step 3: Run the Code

In your terminal:

node index.js

You’ll receive output like:

{
  "balance": "50930089151337467803762"
}

Convert this from wei to ETH by dividing by 1e18. In this case, approximately 50.93 ETH.


Frequently Asked Questions (FAQ)

Q: Do I need to run an Ethereum node to use ETH API?
A: No. ETH APIs eliminate the need for self-hosted nodes by providing cloud-based access to blockchain data.

Q: Can I use ETH API for non-Ethereum EVM chains?
A: Yes. Most modern ETH APIs support BSC, Polygon, Avalanche, Arbitrum, Optimism, and other EVM-compatible networks.

Q: Are there rate limits on API calls?
A: Free tiers usually have limits (e.g., 1M requests/month), while paid plans offer higher throughput and priority access.

Q: How accurate is the price data provided?
A: Prices are aggregated from major decentralized exchanges (DEXs) like Uniswap and SushiSwap, ensuring reliable real-time valuations.

Q: Can I monitor smart contract events?
A: Yes. Using Streams API, you can listen for custom events like Transfer, Approval, or even custom function calls.

Q: Is my API key secure?
A: As long as you don’t expose it in client-side code or public repositories, your key remains safe. Always use environment variables in production.


Final Thoughts

Integrating Ethereum blockchain data into your application doesn’t have to be complicated. With powerful tools like ETH API, Wallet API, NFT API, and Streams API, developers can quickly access tokens, transactions, metadata, NFTs, and real-time prices — all with minimal code.

By leveraging these APIs, you save development time, reduce infrastructure costs, and deliver faster, more responsive dApps to users.

👉 Jumpstart your next Web3 project with seamless blockchain integration