Batch Lookup
Resolve multiple phone number hashes in a single request. Ideal for bulk processing workflows with up to 100 hashes per call.
/v1/lookup/batchLook up multiple phone numbers by their SHA-256 hashes. Returns an array of results with phone number and carrier information for each matched hash.
Request Headers
Content-TypestringRequiredMust be application/json.
X-API-KeystringRequiredYour Decode Hash API key. Starts with sk_live_ or sk_test_.
Request Body
hashesstring[]RequiredAn array of SHA-256 hashes to look up. Each must be a valid 64-character hexadecimal string. Maximum 100 hashes per request.
Response Body
resultsobject[]Array of lookup results. Each object contains the original hash, resolved phone number, and carrier.
results[].hashstringThe original hash that was submitted for lookup.
results[].phonestringThe resolved phone number in E.164 format. Null if the hash was not found.
results[].carrierstringThe mobile carrier name. Null if the hash was not found.
results[].foundbooleanWhether the hash was successfully resolved.
lookup_time_msnumberTotal time taken to resolve all hashes, in milliseconds.
curl -X POST https://api.decode.cowdi.co/v1/lookup/batch \
-H "Content-Type: application/json" \
-H "X-API-Key: sk_live_xxx" \
-d '{
"hashes": [
"9a880505fc5c7953ad6770d71055719bc9f00d963c815207a1a657402d5b7a54",
"3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b",
"ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d"
]
}'{
"results": [
{
"hash": "9a880505fc5c7953ad6770d71055719bc9f00d963c815207a1a657402d5b7a54",
"phone": "+254746604674",
"carrier": "Safaricom",
"found": true
},
{
"hash": "3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b",
"phone": "+254722345678",
"carrier": "Airtel",
"found": true
},
{
"hash": "ef2d127de37b942baad06145e54b0c619a1f22327b2ebbcfbec78f5564afe39d",
"phone": null,
"carrier": null,
"found": false
}
],
"lookup_time_ms": 4.5
}Partial Results
Unlike the single lookup endpoint, batch requests always return a 200 status even if some hashes are not found. Check the found field on each result to determine if the hash was successfully resolved.
Note: Each hash in the batch counts as one lookup against your monthly quota, regardless of whether it was found or not.
Errors
This endpoint may return the following error responses:
400The hashes field is missing, empty, or exceeds 100 items.
401Invalid or missing API key.
402Not enough remaining quota to process the batch. No hashes are looked up.
422One or more hashes are not valid 64-character hex strings.
429Rate limit exceeded. See the Rate Limits page.