Check token approval security on any EVM chain via x402 micropayment.
What it does
The `/defi/approval` endpoint is part of the DeFi Intelligence API hosted at defi.hugen.tokyo. It performs approval security checks on token contracts, returning data about existing token approvals (spenders, allowance amounts) for a given contract address on a specified EVM chain. This is useful for detecting unlimited or risky approvals that could expose wallets to exploits. The endpoint accepts two required query parameters: `chain` (a chain ID such as 1 for Ethereum, 56 for BSC, or 8453 for Base) and `address` (the token contract address to audit).
The endpoint is part of a broader suite of 26 DeFi security and data endpoints covering token audits, rugpull detection, phishing checks, bridge routing, protocol analytics, gas prices, TVL, and more. All endpoints use the x402 payment protocol — each call costs $0.01 USDC on Base, with no API keys or rate limits required. Alternative access methods include a broker API (with a free key providing $0.05 credit), an MCP server at mcp.hugen.tokyo, and a Python SDK (`x402-pay`). The API is live and returns a proper 402 challenge with a sample response showing approval data including token name, spender identity, and allowance type.
Capabilities
Use cases
- —Audit a wallet's token approvals before interacting with a new DeFi protocol
- —Detect unlimited allowances granted to potentially malicious spender contracts
- —Integrate approval security checks into an AI agent's DeFi workflow
- —Screen token contracts for risky approval patterns as part of due diligence
- —Monitor approval hygiene across multiple EVM chains
Fit
Best for
- —AI agents needing programmatic DeFi security checks with micropayments
- —Developers building wallet security dashboards
- —Automated DeFi risk assessment pipelines
Not for
- —Non-EVM chains (Solana approvals use a different model; see /defi/token/solana for Solana token security)
- —Free or bulk-rate access without per-call payment
- —Historical approval event indexing or time-series analysis
Quick start
# Using the x402-pay Python SDK
pip install x402-pay
import x402_pay
resp = x402_pay.get(
'https://defi.hugen.tokyo/defi/approval?chain=1&address=0xdac17f958d2ee523a2206206994597c13d831ec7'
)
print(resp.json())Example
Request
{
"url": "https://defi.hugen.tokyo/defi/approval?chain=1&address=0xdac17f958d2ee523a2206206994597c13d831ec7",
"method": "GET"
}Response
{
"approved_list": [
{
"token": "USDT",
"spender": "Uniswap V3",
"allowance": "unlimited"
}
],
"total_approval_count": 3
}Endpoint
Quality
The endpoint is live (402 challenge captured) with a full OpenAPI spec listing parameters and a sample response embedded in the challenge. However, the response schema is not formally defined (empty schema in OpenAPI), and there is no dedicated documentation page beyond the auto-generated Swagger UI. Pricing is clear ($0.01 USDC on Base).
Warnings
- —Response schema is not formally specified in the OpenAPI document (empty schema object)
- —Sample response in the 402 challenge may not represent the full response structure
- —No dedicated documentation beyond auto-generated Swagger UI at /docs
Citations
- —The API has 26 DeFi security and data endpoints with one x402 payment per callhttps://defi.hugen.tokyo/docs
- —The /defi/approval endpoint requires chain and address query parametershttps://defi.hugen.tokyo/docs
- —Payment is $0.01 USDC on Base per callhttps://defi.hugen.tokyo/defi/approval
- —Alternative access via broker, MCP, and x402-pay SDKhttps://defi.hugen.tokyo/defi/approval