https://api.testmachine.aiGet threat detection running in under 5 minutes
The TestMachine Token Custody API provides programmatic access to analyze ERC-20 token contracts for custodial risks. This guide is hands-on, with explicit request/response JSON examples for seamless integration.
All requests must include an API key. If you don't have a token, contact TestMachine support.
X-Api-Key: {YOUR_TOKEN}POST https://api.testmachine.ai/scan{
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1
}Parameters:
address – Token contract
addresschain_id – EVM chain ID
(see supported chains){
"id": "nyxpzFghAtzfzAoZT",
"status": "submitted"
}This id is your scan identifier.
Use it to poll for results.
GET https://api.testmachine.ai/scan/{scan_id}{
"id": "nyxpzFghAtzfzAoZT",
"status": "completed",
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"risks": {
"blacklist": {
"function": "blacklist(address)",
"authority": "0x1234...abcd"
},
"minting": {
"function": "mint(address,uint256)",
"authority": "0xabcd...1234"
}
},
"inherent_score": 5
}{
"id": "nyxpzFghAtzfzAoZT",
"status": "failed",
"error": "Contract has no available ABI"
}Response Fields:
status – submitted, running, completed, or failedrisks – Map of detected
behaviors with function signatures and authoritiesinherent_score – Severity
score (higher = riskier)curl -X POST \
-H "X-Api-Key: {YOUR_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "chain_id": 1}' \
https://api.testmachine.ai/scancurl -H "X-Api-Key: {YOUR_TOKEN}" \
https://api.testmachine.ai/scan/nyxpzFghAtzfzAoZT18453421611013743114146Additional EVM-compatible chains can be easily added. Contact TestMachine to discuss adding support for your specific chain.
~70 seconds
up to 5 minutes
5 minutes per scan
If uncertain, results omitted
A scan may fail if:
Trigger scans on newly submitted token addresses
Use push-based monitoring for live updates across networks
Parse JSON results to display behaviors and severity scores
Direct access to TestMachine's threat detection engine
/scan Submit a smart contract for security analysis.
| contract_source | string | Required. Solidity source code |
| contract_name | string | Optional. Contract identifier |
| analysis_type | string | Optional. "quick" | "full" | "custodial" |
{
"scan_id": "uuid-string",
"status": "queued",
"estimated_completion": "2024-01-15T10:30:00Z"
}/scan/{scan_id} Retrieve analysis results for a completed job.
{
"scan_id": "uuid-string",
"status": "completed",
"vulnerabilities": [...],
"risk_score": 7.2,
"recommendations": [...],
"completed_at": "2024-01-15T10:35:00Z"
}