Skip to main content

Get ERC20 token allowance

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

Get the amount which the spender is allowed to withdraw on behalf of the owner.

PATH PARAMS
addressstringrequired
The address of the token contract
QUERY PARAMS
chainstring
The chain to query
owner_addressstringrequired
The address of the token owner
spender_addressstringrequired
The address of the token spender
Responses
API KEY
import Moralis  from 'moralis';
import { EvmChain } from '@moralisweb3/evm-utils';

try {
const chain = EvmChain.ETHEREUM;

const address = '0x1234567890123456789012345678901234567890';

await Moralis.start({
apiKey: 'YOUR_API_KEY',
// ...and any other configuration
});

const response = await Moralis.EvmApi.token.getTokenAllowance({
address,
chain,
});

console.log(response?.result);
} catch (e) {
console.error(e);
}

Response Example