Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.0

Get ERC20 token approvals

GEThttps://deep-index.moralis.io/api/v2/erc20/approvals

Get ERC20 approvals for one or many wallet addresses and/or contract addresses, ordered by block number in descending order.

Supports advanced filtering to specifically include or exclude particular wallet addresses or contract addresses.

Supports up to 100 inputs.

DEPRECATED ENDPOINT
This API will be deprecated on 4th September 2023. Please subscribe to the Changelog page for further announcements.
QUERY PARAMS
chainstring
The chain to query
from_blocknumber
The block number from which the approvals will be returned
to_blocknumber
The block number to which the approvals will be returned
limitnumber
The desired page size of the result.
contract_addressesarray
Contract addresses to only include (max 100 addresses)
No items in the array
exclude_contractsarray
Contract addresses to ignore (max 100 addresses)
No items in the array
wallet_addressesarray
Wallet addresses to only include (max 100 addresses)
No items in the array
exclude_walletsarray
Wallet addresses to ignore (max 100 addresses)
No items in the array
cursorstring
The cursor returned in the previous response (used to getting the next page).
Responses
API KEY
import Moralis from 'moralis';

try {
await Moralis.start({
apiKey: "YOUR_API_KEY"
});

const response = await Moralis.EvmApi.token.getErc20Approvals({
"chain": "0x1"
});

console.log(response.raw);
} catch (e) {
console.error(e);
}
Response Example
{
"cursor": "",
"result": {
"token_name": "Tether USD",
"token_symbol": "USDT",
"token_logo": "https://assets.coingecko.com/coins/images/325/large/Tether-logo.png?1598003707",
"token_decimals": "6",
"contract_address": "0x3105d328c66d8d55092358cf595d54608178e9b5",
"transaction_hash": "0xdd9006489e46670e0e85d1fb88823099e7f596b08aeaac023e9da0851f26fdd5",
"transaction_index": 204,
"log_index": 204,
"block_timestamp": "2021-05-07T11:08:35.000Z",
"block_number": 12386788,
"block_hash": "0x9b559aef7ea858608c2e554246fe4a24287e7aeeb976848df2b9a2531f4b9171",
"from_wallet": "0x3105d328c66d8d55092358cf595d54608178e9b5",
"from_wallet_label": "Binance 1",
"to_wallet": "0x3105d328c66d8d55092358cf595d54608178e9b5",
"to_wallet_label": "Binance 2",
"value": "57732989482831651",
"value_decimal": "577329894.8283165",
"possible_spam": "false",
"verified_collection": "false"
}
}