How to Create Real-Time Ethereum Transaction Notifications with Zerion API

Real-time transaction alerts are crucial for developers building Web3 apps, wallets, or portfolio trackers. With Zerion API's webhooks, you can easily subscribe to transactions for Ethereum and all major EVM blockchains. In this blog post, we’ll explore how to quickly set up your webhooks to create alerts or notifications for transactions. 

Why Use Transaction Webhooks?

Imagine a scenario when you want to follow transactions of a specific Ethereum address in real-time. 

You might want to copy-trade someone. Trigger an offchain action. Or send a push notification to the user who did the transaction, like in Zerion on mobile.

An example of push notifications for transactions in Zerion

One way to do this is to regularly poll the blockchain to see if the address has made any new transactions. 

However, this approach can quickly become inefficient, especially if you're monitoring multiple addresses across several chains. It would also require you to run 24/7 infrastructure to make sure you don’t miss any transactions.

Zerion API does this heavy lifting and offers an easy way: webhooks with subscriptions to transactions

Webhooks allow your application to receive instant notifications whenever specified addresses make transactions, without continuously polling blockchain data. This helps developers:

  • Update user balances immediately
  • Trigger real-time alerts and events
  • Enhance user engagement with timely notifications

Webhooks are what power mobile notifications for addresses in Zerion Wallet. Now let’s see how easy it is to set them up.

Getting Started with Zerion Transaction Webhooks

Zerion API provides a straightforward approach to subscribing to transactions made by EVM addresses on Ethereum and all major EVM L1 and L2 chains.

Step 1: Create a Subscription

To subscribe to transactions, send a request to Zerion API, specifying: 

  • Addresses you want to subscribe to 
  • Callback URL, where you’ll receive POST — webhook.site is supported right away and custom URLs need to be approved 
  • Chain IDs where you want to get or leave it empty to subscribe to all supported blockchains

Here is an example of a request: 

curl --request POST \
     --url https://api.zerion.io/v1/tx-subscriptions \
     --header 'accept: application/json' \
     --header 'authorization: Basic emtfZGV2X2Q2YmEzYzM3NTNiYjQ2NWM4YjNjZTEzMTU2OTVlYjMwOg==' \
     --header 'content-type: application/json' \
     --data '
{
  "addresses": [
    "0x42b9dF65B219B3dD36FF330A4dD8f327A6Ada990"
  ],
  "callback_url": "https://webhook.site/dd3c5376-2472-4b3f-af38-d75cc20ad1a2",
  "chain_ids": [
    "base"
  ]
}
'

Step 2: Handling Webhook Notifications

Once subscribed, Zerion will POST transaction details directly to your webhook URL whenever the monitored address makes transactions.

If you used webhook.site, you will start seeing POST requests with full information for each transaction.

Transaction data immediately shows up as POST in webhook.site

Each request will have the full information about the transaction. The exceptions are price and value, these will be null. Those come with a slight delay and need to be fetched by querying Zerion API’s transaction endpoint by hash.  

Your webhook handler can then parse this data and take immediate action—updating a database, sending a notification, or triggering other events.

Practical Use Cases

Here are some practical examples to illustrate how you can use Zerion API’s transaction webhooks.

Instant Wallet Activity Notifications

Build a notification system for a crypto wallet or portfolio tracking app:

  • The user initiates a transaction from their wallet
  • Your backend receives a webhook notification
  • You instantly update the user's interface and notify them via email or push notification.

SocialFi Follow Features

Let users follow others’ onchain activity:

  • Create webhook subscriptions for wallets that users follow 
  • Receive notifications for all transactions and then filter them 
  • Send real-time feed updates with the most relevant transactions 

Automated Trading Bots

Trigger automated trading strategies based on onchain wallet activity:

  • Monitor addresses associated with whales, funds or exchanges 
  • Receive instant notifications of large transactions
  • Automatically execute the bot’s trading strategy based on incoming data.

Data for AI Agents

Let your AI agent follow its own address: 

  • Setup a webhook subscription to the agent’s address 
  • Users send transactions to the address to interact with the agent
  • When the address gets a new non-spam transaction, immediately prompt the agent’s LLM

Conclusion

Zerion API's webhook functionality provides developers with an easy, efficient method for real-time transaction monitoring. 

Adding subscriptions to transactions can improve user experience, increase operational efficiency, and enable new features.

Get started today and sign up for a free dev key for Zerion API.