Skip to main content
Version: 2.2

Get ERC20 token allowance

Don't have an API key yet?

Start using this API for your project today.

Get your free API key
GEThttps://deep-index.moralis.io/api/v2.2/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",
"ownerAddress": "0x0cBee687015d5151BA084806E00A59A8e6F206c2",
"spenderAddress": "0x75e89d5979E4f6Fba9F97c104c2F0AFB3F1dcB88",
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
});

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