Dev portal

Blacklist API#

OKX DEX aggregator calls the project’s blacklist endpoint to retrieve malicious addresses that should be blocked. The endpoint supports full-list queries and incremental queries using the optional startTime parameter. Request method: GET Endpoint: {project_domain}/OKXDEX/rfq/blacklist

Request Headers#

ParameterTypeRequiredDescription
x-api-keyStringYesThe API key provided by the project to OKX DEX.

Request Parameters#

ParameterTypeRequiredDescription
startTimeIntegerNoUnix timestamp in seconds. Returns only addresses whose creation time satisfies create_time > startTime. If omitted, returns the full blacklist.

Query and Compatibility Rules#

  • Full-list query: Omit startTime to retrieve the complete blacklist.
  • Incremental query: Provide startTime to retrieve addresses added after the specified timestamp. Return an empty array if there are no new addresses.
  • Backward compatibility: If the project does not support incremental queries, it may ignore startTime and return the full blacklist. OKX deduplicates the results.
  • Both query modes use the same response structure. No pagination or timestamp fields are added.

Response Parameters#

ParameterTypeRequiredDescription
codeStringYesBusiness status code. "0" indicates success; any other value indicates failure.
msgStringYesAn empty string on success, or an error message on failure.
blacklistString[]YesBlacklisted addresses. In full-list mode, returns the complete list. In incremental mode, returns only addresses added after the specified timestamp. Returns [] if there are no matching addresses.

Address Format#

Ethereum addresses must be 0x-prefixed and contain 42 characters. Other chain address formats are also supported. The source specification requires lowercase addresses. For case-sensitive address formats, such as Solana addresses, confirm the applicable normalization rules before implementation. Converting these addresses to lowercase may invalidate them.

HTTP Status Code Handling#

HTTP Status CodeMeaningOKX Behavior
200 with code="0"Request succeededParse and process the blacklist.
404Endpoint not found; the project may not provide this APILog at debug level, treat as an empty list, and do not trigger an alert.
400Invalid request parametersLog at warn level and retain the last cached data.
401Invalid API keyLog at warn level and retain the last cached data.
500Internal server errorLog at warn level and retain the last cached data.

Request Examples

shell
# Full-list query
curl --request GET \
  --url 'https://api.example.com/OKXDEX/rfq/blacklist' \
  --header 'x-api-key: YOUR_PROJECT_API_KEY'
# Incremental query: startTime is a Unix timestamp in seconds
curl --request GET \
  --url 'https://api.example.com/OKXDEX/rfq/blacklist?startTime=1749600000' \
  --header 'x-api-key: YOUR_PROJECT_API_KEY'

Response Example

json
{
  "code": "0",
  "msg": "",
  "blacklist": [
    "0x742d35cc6634c0532925a3b8d36e639608b05a98",
    "0x1234567890123456789012345678901234567890",
    "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"
  ]
}

Response Example — No Matching Addresses

json
{
  "code": "0",
  "msg": "",
  "blacklist": []
}

Business Error Response Body Example

json
{
  "code": "1",
  "msg": "Invalid API Key",
  "blacklist": []
}