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 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';

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

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

console.log(response.raw);
} catch (e) {
console.error(e);
}
Response Example
{
"allowance": ""
}