Skip to main content

🎥 How to Set Up QuickAlerts via REST API

Updated on
Aug 4, 2023

2 min read

In this video, we go through the process of setting QuickAlerts to track wallet transactions via REST API in JavaScript.
Subscribe to our YouTube channel for more videos!

Following are the code examples shown in the video:

Creating a Wallet

Initiate a new file, wallet.js, to create a new wallet (skip this if you already have a wallet you want to track transactions for).

const ethers = require('ethers');

const wallet = ethers.Wallet.createRandom();

Getting QuickAlerts API key

Create a free QuickNode account if you don't already have one. Go to the QuickAlerts tab from the left menu and then click on API Keys.

Then, copy your API Key QuickAlerts API key

Setting Up a WebHook Destination

Create a new file, destination.js, to create a QuickAlerts WebHook destination.

var myHeaders = new Headers()
myHeaders.append('content-type', 'application/json')
myHeaders.append('x-api-key', 'YOUR_QUICKALERTS_API_KEY')

var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow',
body: JSON.stringify({
webhook_type: 'POST',
service: 'webhook',
payload_type: 1,

.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error))

Replace YOUR_QUICKALERTS_API_KEY with your QuickAlerts API key which you get from the QuickAlerts dashboard, YOUR_DESTINATION_NAME with destination name of your choice, and YOUR_WEBHOOK_URL with your WebHook URL where you want to send your alert.

Deploying the Alert

Create a new file, notifcation.js, to setup an alert.

const axios = require('axios');

let data = JSON.stringify({
"network": "ethereum-sepolia",
"destinationIds": [

let config = {
method: 'post',
maxBodyLength: Infinity,
url: '',
headers: {
'accept': '*/*',
'Content-Type': 'application/json',
data : data

.then((response) => {
.catch((error) => {

Replace YOUR_NOTIFICATION_NAME with a desired name for your alert, YOUR_BASE64_ENCODED_EXPRESSION with your QuickAlerts expression in BASE64 encoded format, DESTINATION_ID with the destination id you got after running destination.js, and YOUR_QUICKALERTS_API_KEY with your QuickAlerts API key.

We ❤️ Feedback!

Let us know if you have any feedback or requests for new topics. We'd love to hear from you.

Share this guide