HashDit Token Security API
The Token Security API from HashDit — 3 operation(s) for token security.
The Token Security API from HashDit — 3 operation(s) for token security.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/hashdit:hashdit-token-security-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: HashDit Token Security API
description: HashDit threat intelligence API for domain security analysis, blockchain address classification, address poisoning detection, address security assessment, transaction security, token security, Solana token security, token approval security, and EIP-712 signature security
version: 2.0.0
servers:
- url: https://service.hashdit.io
tags:
- name: Token Security
paths:
/v2/hashdit/token-approval-security:
post:
summary: Token Approval Security
description: Returns a synchronous, risk-scored view of outstanding token approvals, including current and potential USD exposure, optional entity-risk enrichment, summary totals, and `has_more` pagination state.
operationId: tokenApprovalSecurity
requestBody:
description: Approval query. At least one of `owner` or `spender` is required. `token` cannot be sent on its own.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TokenApprovalSecurityRequest'
examples:
Owner with balance and spender risk:
summary: BSC owner — typical approval-manager query
value:
chain_id: '56'
owner: '0x26d61f23bbc94d7b2139f9c581722bf4e8b64b87'
include_balance: true
include_spender_risk: true
TRON:
summary: TRON — `chain_id` as `"tron"`
value:
chain_id: tron
owner: TUAEpR16Th4pLbjECPVYTgvPyStNKyB54h
include_balance: true
responses:
'200':
description: Successful response. Envelope is `{code, status, data}`.
content:
application/json:
schema:
$ref: '#/components/schemas/TokenApprovalSecurityResponse'
examples:
Approvals with balance cap:
summary: 'Row 1: $4.50 at risk today, unlimited going forward. Row 2: risky spender.'
value:
code: '0'
status: ok
data:
count: 2
has_more: false
approval_status:
- token: '0x55d398326f99059ff775485246999027b3197955'
owner: '0x26d61f23bbc94d7b2139f9c581722bf4e8b64b87'
spender: '0x10ed43c718714eb63d5aa57b78b54704e256024e'
amount_raw: '115792089237316195423570985008687907853269984665640564039457584007913129639935'
valid_allowance: '4500000000000000000'
token_decimal: 18
affected_usd_amount: 4.5
potential_affected_usd_amount: Unlimited
token_name: Binance-Peg BSC-USD
balance: '4500000000000000000'
spender_risk:
is_risky: false
risk_level: 0
risk_details: []
risk_level_display: Trusted
- token: '0xd8a2ae43fd061d24acd538e3866ffc2c05151b41'
owner: '0x26d61f23bbc94d7b2139f9c581722bf4e8b64b87'
spender: '0xb0b195aefa3650a6908f15cdac7d92f8a5791b0b'
amount_raw: '9999999999999999999999'
valid_allowance: '9999999999999999999999'
token_decimal: 18
affected_usd_amount: 0.02
potential_affected_usd_amount: 0.02
token_name: null
balance: '9999999999999999999999'
spender_risk:
is_risky: true
risk_level: 5
risk_details:
- blacklist_manual
risk_level_display: High Risk
valid_approved_tokens:
- token_name: Binance-Peg BSC-USD
token_address: '0x55d398326f99059ff775485246999027b3197955'
token_price: 1
token_decimal: 18
summary:
total_affected_usd_amount: 4.52
total_potential_affected_usd_amount: 4.52
risky_approval_count: 1
total_risky_usd_amount: 0.02
risky_approval_indices:
- 1
'400':
description: Bad request — malformed or missing field, unsupported chain, invalid address, `token` alone, or an invalid `filter`.
content:
application/json:
schema:
$ref: '#/components/schemas/CurrentServiceError'
examples:
Invalid request:
summary: Malformed or missing field
value:
code: '-1'
status: invalid request
detail: …
Token alone:
summary: '`token` without `owner` or `spender`'
value:
code: '-1'
status: invalid request
detail: …
Unsupported chain:
summary: Chain not enabled for this endpoint (only `1`, `56`, TRON)
value:
code: '-1'
status: unsupported chain
detail: 'unsupported chainId: 137'
Invalid address:
summary: Address fails the format check for that chain
value:
code: '-1'
status: invalid address
detail: …
Invalid filter:
summary: '`filter` must be `"only-valid"` if sent'
value:
code: '-1'
status: invalid request
detail: …
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'429':
$ref: '#/components/responses/RateLimitExceeded'
'500':
$ref: '#/components/responses/InternalServerError'
security:
- apiKeyAuth: []
tags:
- Token Security
/v2/hashdit/solana-token-security:
post:
summary: Solana Token Security
description: Returns stable overall security decision fields for a Solana token mint. Completed responses may also contain Solana-specific analysis objects that clients should treat as optional context.
operationId: solanaTokenSecurity
requestBody:
description: Solana token mint address to analyze
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SolanaTokenSecurityRequest'
examples:
Solana token:
summary: Analyze a Solana token mint
value:
address: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
sync: false
responses:
'200':
description: 'Successful response. On a cache miss the analysis may be queued and the body returns `status: "in progress"` with no `data` object — wait `pollAfter` seconds and retry the same request.'
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/SolanaTokenSecurityResponse'
- $ref: '#/components/schemas/InProgressResponse'
examples:
Success:
summary: Stable decision fields from a completed analysis
value:
code: '0'
status: ok
data:
status: 200
address: sol:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
address_type: Solana
overall_score: '80'
overall_risk_level: Low Risk
scanned_time: 1790617277
result_stage: complete
In progress:
summary: Analysis queued — poll again
value:
code: '0'
status: in progress
pollAfter: 10
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'429':
$ref: '#/components/responses/RateLimitExceeded'
'500':
$ref: '#/components/responses/InternalServerError'
security:
- apiKeyAuth: []
tags:
- Token Security
/v2/hashdit/token-security:
post:
summary: Token Security
description: Returns stable overall security decision fields for tokens on supported EVM networks and TRON. Completed responses may also contain chain-specific analysis objects that clients should treat as optional context.
operationId: tokenSecurity
requestBody:
description: Token contract address to analyze
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TokenSecurityRequest'
examples:
BSC token:
summary: Analyze a BSC token contract
value:
chain_id: 56
address: '0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82'
sync: false
TRON token:
summary: Analyze a TRON token contract
value:
chain_id: tron
address: TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
sync: false
responses:
'200':
description: 'Successful response. On a cache miss the analysis may be queued and the body returns `status: "in progress"` with no `data` object — wait `pollAfter` seconds and retry the same request.'
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/TokenSecurityResponse'
- $ref: '#/components/schemas/InProgressResponse'
examples:
BNB Smart Chain:
summary: Stable decision fields from a completed BSC analysis
value:
code: '0'
status: ok
data:
status: 200
address: bsc:0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82
address_type: ERC20
overall_score: '90'
overall_risk_level: No Obvious Risk
scanned_time: 1790594185
result_stage: complete
TRON:
summary: Stable decision fields from a TRON fallback result
value:
code: '0'
status: ok
data:
status: 200
address: tron:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
address_type: unknown
overall_score: '100'
overall_risk_level: No Obvious Risk
scanned_time: 1790617185
result_stage: fallback
In progress:
summary: Analysis queued — poll again
value:
code: '0'
status: in progress
pollAfter: 10
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'429':
$ref: '#/components/responses/RateLimitExceeded'
'500':
$ref: '#/components/responses/InternalServerError'
security:
- apiKeyAuth: []
tags:
- Token Security
components:
schemas:
InProgressResponse:
type: object
description: Returned when analysis is queued. There is no `data` object in this response.
properties:
code:
type: string
description: '`"0"` — the request succeeded. This is **not** an error.'
example: '0'
status:
type: string
description: '`"in progress"` — analysis is queued, no result yet.'
example: in progress
pollAfter:
type: number
description: Seconds to wait before retrying the identical request.
example: 10
required:
- code
- status
- pollAfter
SolanaTokenSecurityRequest:
type: object
required:
- address
properties:
address:
type: string
description: Solana token mint address.
example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
sync:
type: boolean
default: false
description: When `true`, wait for the analysis instead of returning `in progress`. Increases latency; may still time out and return `in progress`.
RateLimitExceededErrorResponse:
type: object
properties:
code:
type: string
description: '`429`'
example: '429'
status:
type: string
description: '`error`'
example: error
message:
type: string
description: Rate limit exceeded
example: Rate limit exceeded
required:
- code
- status
TokenApprovalStatusRow:
type: object
required:
- token
- owner
- spender
- amount_raw
- valid_allowance
- token_decimal
- affected_usd_amount
- potential_affected_usd_amount
- token_name
properties:
token:
type: string
description: Token contract address.
owner:
type: string
description: Owner / approver address.
spender:
type: string
description: The party that can move the tokens.
amount_raw:
type: string
description: Approved allowance, raw smallest units, uint256 decimal string. Overflows `Number` — parse as big-int.
valid_allowance:
type: string
description: Realistic exposure. `min(amount_raw, balance)` when `includeBalance` is on and the balance was readable; otherwise equals `amount_raw`.
token_decimal:
type:
- integer
- 'null'
description: '`null` when decimals could not be resolved.'
affected_usd_amount:
allOf:
- $ref: '#/components/schemas/TokenApprovalUsdAmount'
description: USD value of `valid_allowance` — what can be taken right now. Never `null`.
potential_affected_usd_amount:
allOf:
- $ref: '#/components/schemas/TokenApprovalUsdAmount'
description: USD value of `amount_raw`, never balance-capped — what could be taken if the wallet is re-funded. Never `null`.
token_name:
type:
- string
- 'null'
description: '`null` when the token is not indexed.'
balance:
type:
- string
- 'null'
description: 'Owner''s current balance, raw units. Opt-in `includeBalance`: absent when the flag is `false`; present but possibly `null` when the flag is `true`.'
spender_type:
type:
- string
- 'null'
description: '`"eoa"` or `"contract"`. Opt-in `includeAddressTypes`: absent when the flag is `false`; present but possibly `null` when the flag is `true`.'
owner_type:
type:
- string
- 'null'
description: '`"eoa"` or `"contract"`. Opt-in `includeAddressTypes`: absent when the flag is `false`; present but possibly `null` when the flag is `true`.'
spender_risk:
allOf:
- $ref: '#/components/schemas/TokenApprovalRisk'
description: 'Opt-in `includeSpenderRisk`: absent when the flag is `false`; present but possibly `null` when the flag is `true`.'
token_risk:
allOf:
- $ref: '#/components/schemas/TokenApprovalRisk'
description: 'Opt-in `includeTokenRisk`: absent when the flag is `false`; present but possibly `null` when the flag is `true`.'
owner_risk:
allOf:
- $ref: '#/components/schemas/TokenApprovalRisk'
description: 'Opt-in `includeOwnerRisk`: absent when the flag is `false`; present but possibly `null` when the flag is `true`.'
SolanaTokenSecurityResponse:
type: object
properties:
code:
type: string
description: API result code. "0" indicates success.
example: '0'
status:
type: string
description: Request status.
example: ok
data:
$ref: '#/components/schemas/SolanaTokenSecurityData'
required:
- code
- status
- data
TokenSecurityResponse:
type: object
properties:
code:
type: string
description: API result code. "0" indicates success.
example: '0'
status:
type: string
description: Request status.
example: ok
data:
$ref: '#/components/schemas/TokenSecurityData'
required:
- code
- status
- data
SolanaTokenSecurityData:
type: object
description: Stable decision fields returned by completed Solana token analysis. The service may include additional Solana analysis objects; clients should treat those as optional context.
properties:
status:
type: integer
description: Analysis status. 200 indicates that a result was produced successfully.
example: 200
address:
type: string
description: Fully qualified Solana token mint address.
example: sol:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
address_type:
type: string
description: Blockchain type (Solana).
example: Solana
overall_risk_level:
type: string
description: Overall risk classification.
enum:
- No Obvious Risk
- Low Risk
- Medium Risk
- High Risk
- Significant Risk
overall_score:
type: string
description: Security score encoded as a string from 0 to 100. Lower values indicate higher risk.
pattern: ^(100|[1-9]?[0-9])$
scanned_time:
type: integer
description: Unix timestamp of the latest scan.
example: 1790617277
result_stage:
type: string
description: How the result was produced.
enum:
- complete
- fallback
- degraded
required:
- status
- address
- address_type
- overall_score
- overall_risk_level
- scanned_time
- result_stage
TokenApprovalSecurityResponse:
type: object
properties:
code:
type: string
description: API status code. `"0"` indicates success.
example: '0'
status:
type: string
example: ok
data:
$ref: '#/components/schemas/TokenApprovalSecurityData'
required:
- code
- status
TokenSecurityRequest:
type: object
required:
- chain_id
- address
properties:
chain_id:
oneOf:
- type: integer
- type: string
description: Network identifier. Use a numeric ID for EVM networks or `tron` / `728126428` for TRON. See [Supported Chains](/api-reference/supported-chains).
example: '56'
address:
type: string
description: Token contract address.
example: '0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82'
sync:
type: boolean
default: false
description: When `true`, wait for the analysis instead of returning `in progress`. Increases latency; may still time out and return `in progress`.
TokenApprovalSecurityRequest:
type: object
required:
- chain_id
properties:
chain_id:
type: string
description: '`int` or `string`. Only `1` (Ethereum), `56` (BSC), or `728126428` / `"tron"` (TRON). Any other chain is rejected with `400`. See [Supported Chains](/api-reference/supported-chains).'
example: '56'
owner:
type: string
description: Owner / approver address. At least one of `owner` or `spender` is required.
example: '0x26d61f23bbc94d7b2139f9c581722bf4e8b64b87'
spender:
type: string
description: Spender address. At least one of `owner` or `spender` is required.
token:
type: string
description: Restrict to one token contract. Cannot be sent on its own — `token` alone returns `400`.
page:
type: integer
default: 1
description: 1-based page number. Values below 1 are treated as 1.
limit:
type: integer
default: 50
description: Rows per page. Ceiling `100` — higher values are clamped, not rejected.
filter:
type: string
description: Only `"only-valid"` is accepted; it drops rows whose `valid_allowance` is `0`. Any other value is a validation error.
include_balance:
type: boolean
default: false
description: Read each token's live on-chain balance for the owner.
include_spender_risk:
type: boolean
default: false
description: Add `spender_risk` to every row.
include_token_risk:
type: boolean
default: false
description: Add `token_risk` to every row.
include_owner_risk:
type: boolean
default: false
description: Add `owner_risk` to every row.
include_address_types:
type: boolean
default: false
description: Classify each spender and owner as `"eoa"` or `"contract"`.
MissingAPIKeyErrorResponse:
type: object
properties:
code:
type: string
description: '`401`'
example: '401'
status:
type: string
description: Missing API key
example: Missing API key
detail:
type: string
description: Missing API key
example: Missing API key
required:
- code
- status
- detail
TokenSecurityData:
type: object
description: Stable decision fields returned by completed token analysis. The service may include additional chain-specific analysis objects; clients should treat those as optional context.
properties:
status:
type: integer
description: Analysis status. 200 indicates that a result was produced successfully.
example: 200
address:
type: string
description: Fully qualified token address with chain prefix.
example: bsc:0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82
address_type:
type: string
description: Token standard.
example: ERC20
overall_risk_level:
type: string
description: Overall risk summary.
enum:
- No Obvious Risk
- Low Risk
- Medium Risk
- High Risk
- Significant Risk
overall_score:
type: string
description: Overall security score encoded as a string from 0 to 100. Lower values indicate higher risk.
pattern: ^(100|[1-9]?[0-9])$
scanned_time:
type: integer
description: Unix timestamp of the latest scan.
example: 1790594185
result_stage:
type: string
description: How the result was produced.
enum:
- complete
- fallback
- degraded
required:
- status
- address
- address_type
- overall_score
- overall_risk_level
- scanned_time
- result_stage
CurrentServiceError:
type: object
properties:
code:
type: string
description: Error code. Typically `-1` for client errors, `-2` for server errors, or `401` / `429` for auth and rate limits.
status:
type: string
description: Short error status string.
detail:
type: string
description: Human-readable explanation of the error. Names the field that was rejected when the request is invalid.
required:
- code
- status
TokenApprovalSecurityData:
type: object
properties:
count:
type: integer
description: Rows in `approval_status`, after `filter`.
approval_status:
type: array
description: The approval rows, most-recent on-chain activity first.
items:
$ref: '#/components/schemas/TokenApprovalStatusRow'
valid_approved_tokens:
type: array
description: Metadata for each unique indexed token in `approval_status`. Tokens HashDit has not indexed do not appear here, even though their approvals still appear in `approval_status`.
items:
$ref: '#/components/schemas/TokenApprovalValidToken'
summary:
$ref: '#/components/schemas/TokenApprovalSummary'
has_more:
type: boolean
description: '`true` when this page came back full. Evaluated *before* `filter: "only-valid"` runs — a filtered page can have `count` well below `limit` while `has_more` is still `true`.'
TokenApprovalValidToken:
type: object
properties:
token_name:
type:
- string
- 'null'
token_address:
type: string
token_price:
type:
- number
- 'null'
description: USD unit price at query time.
token_decimal:
type:
- integer
- 'null'
TokenApprovalRisk:
type: object
properties:
is_risky:
type: boolean
description: Whether this address warrants a red flag. The single boolean to branch on — do not re-derive it from `risk_level`.
risk_level:
type: integer
description: 0–5, higher is riskier. `-1` = address absent from HashDit's database.
risk_details:
type: array
description: Opaque labels indicating what the finding was based on. Useful for support and logging; not a stable enum — do not branch on the values. Empty when `is_risky` is `false`.
items:
type: string
risk_level_display:
type: string
description: Human-readable label. Always populated.
TokenApprovalUsdAmount:
oneOf:
- type: number
- type: string
description: Never `null`. A number (including `0`), `"Unlimited"`, or `"Unknown"`. Check the type before formatting. `"Unknown"` is not zero — do not render it as `$0`.
TokenApprovalSummary:
type: object
properties:
total_affected_usd_amount:
type: number
description: Total USD at risk on this page. Not the sum of every row — exposure is de-duplicated across spenders approved against the same token balance. Counts only rows with a finite figure; `"Unlimited"` and `"Unknown"` contribute nothing.
total_potential_affected_usd_amount:
type: number
description: Same aggregation over `potential_affected_usd_amount`.
risky_approval_count:
type: integer
description: Rows where any of the three risk objects is risky.
total_risky_usd_amount:
type: number
description: Sum of `affected_usd_amount` across those risky rows.
risky_approval_indices:
type: array
description: 0-based positions of the risky rows in `approval_status`. Index straight in — no scan needed.
items:
type: integer
responses:
BadRequest:
description: Bad request — malformed or missing field, unsupported chain, or invalid address. `detail` names the field that was rejected.
content:
application/json:
schema:
$ref: '#/components/schemas/CurrentServiceError'
examples:
Invalid request:
summary: Malformed or missing field
value:
code: '-1'
status: invalid request
detail: …
Unsupported chain:
summary: Chain not enabled for this endpoint
value:
code: '-1'
status: unsupported chain
detail: 'unsupported chainId: 137'
Invalid address:
summary: Address fails the format check for that chain
value:
code: '-1'
status: invalid address
detail: …
Unauthorized:
description: Missing or invalid `X-API-KEY`. This is the response customers see on current-service endpoints.
content:
application/json:
schema:
$ref: '#/components/schemas/MissingAPIKeyErrorResponse'
examples:
Missing API key:
summary: Missing or invalid API key
value:
code: '401'
status: Missing API key
detail: Missing API key
InternalServerError:
description: Server-side failure
content:
application/json:
schema:
$ref: '#/components/schemas/CurrentServiceError'
examples:
Internal server error:
summary: Internal server error
value:
code: '-2'
status: internal server error
detail: internal server error
RateLimitExceeded:
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/RateLimitExceededErrorResponse'
examples:
Rate limit exceeded:
summary: Rate limit exceeded error
value:
code: '429'
status: error
message: Rate limit exceeded
UnprocessableEntity:
description: Schema validation failed. `detail` names the failing field path.
content:
application/json:
schema:
$ref: '#/components/schemas/CurrentServiceError'
examples:
Field required:
summary: Schema validation
value:
code: '-1'
status: invalid request
detail: 'chainId: field required'
Field path:
summary: detail names the failing field path
value:
code: '-1'
status: invalid request
detail: evm_transactions[0].from
securitySchemes:
apiKeyAuth:
type: apiKey
in: header
name: X-API-KEY