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.2

Get ERC20 token allowance

🚨Deprecating Endpoint Notice

This endpoint will be deprecated. Please migrate to our newer endpoint Wallet Token Approvals. For more details and updates, please check the changelog.

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"
}