xtract.bot
POST /api/hex-decode

Decode hex-encoded bytes back to binary. Tolerant of whitespace, the `0x` prefix, and `:` separators (such as colon-separated MAC-address style hex).

Parses a hex string and returns the original bytes. Tolerant of: - Whitespace and newlines (stripped before decoding). - An optional `0x` prefix. - Colon separators (e.g. `aa:bb:cc:dd` — the format `xxd` and `tcpdump` produce). Mixed case is fine. The number of hex characters must be even.

Inputs

NameTypeDefaultDescription
data*stringHex string to decode.

Response

Modes: binary, base64-json. Cache: yes (24h TTL).

Code samples

Built from the hello example.


curl -X POST https://api.xtract.bot/api/hex-decode \
  -H "Content-Type: application/json" \
  -H "Accept: application/octet-stream" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "data": "68656c6c6f"
}'