Skip to main content

Endpoint

POST https://api.bunny.build/api/v1/hash

Authentication

HeaderRequiredValue
X-API-KeyYesYour API key (bun_...)
Content-TypeYesapplication/json

Overview

Compute cryptographic hash digests for any input string using one or more algorithms in a single request. The response returns hex-encoded digests keyed by algorithm name, making it easy to compare or store multiple hashes simultaneously without running separate requests.

Use cases

  • Verify file or payload integrity using checksum comparison
  • Migrate legacy password hashes during authentication system upgrades
  • Generate consistent fingerprints for deduplication pipelines
  • Produce content-addressable identifiers for caching layers

Request body

FieldTypeRequiredDescription
inputstringYesThe string to hash
algorithmsarray of stringsNoAlgorithms to compute. Defaults to all. Options: md5, sha1, sha256, sha384, sha512, sha512-256

Example

{
  "input": "hello world",
  "algorithms": ["sha256", "md5"]
}

Response

200 OK

FieldTypeDescription
inputstringThe original input string
hashesobjectMap of algorithm name to hex-encoded digest
Example
{
  "input": "hello world",
  "hashes": {
    "sha256": "b94d27b9934d3e08a52e52d7da7dabfac484efe04294e576f01c87a7cbc1ab15",
    "md5": "5eb63bbbe01eeed093cb22bb8f5acdc3"
  }
}

401 Unauthorized

{
  "detail": "Missing API key. Include X-API-Key header."
}

402 Payment Required

{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}

422 Unprocessable Entity

{
  "detail": "Field 'input' is required."
}

429 Too Many Requests

{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}

cURL example

curl -X POST https://api.bunny.build/api/v1/hash \
  -H "X-API-Key: bun_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"input": "hello world", "algorithms": ["sha256", "md5"]}'