API Endpoints Overview
The SHA224.com REST API provides a comprehensive set of endpoints for generating, verifying, and working with SHA-224 hashes. Our API is designed to be simple to use, highly reliable, and secure.
Base URL for all API requests:
https://api.sha224.com/v1
Important Notes:
- All API requests must use HTTPS
- Requests must include a valid API key in the Authorization header
- Rate limits apply based on your subscription plan
- All endpoints return JSON responses
- HTTP status codes are used to indicate success or failure
Hash Generation Endpoints
Generate Hash from Text
Compute a SHA-224 hash for plain text input.
Request Body
{
"text": "string",
"encoding": "utf8" // optional, defaults to utf8
}
Response
{
"hash": "string", // SHA-224 hash as a hexadecimal string
"input_length": number, // Length of input in bytes
"timestamp": "string" // ISO 8601 timestamp
}
Example Request
curl -X POST https://api.sha224.com/v1/hash/text \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hello, world!"}'
Example Response
{
"hash": "8552d8b7a7dc5476cb9e25dee69a8091290764b7f2a64fe6e78e9568",
"input_length": 13,
"timestamp": "2025-05-15T12:34:56Z"
}
Generate Hash from File
Compute a SHA-224 hash for file contents. Upload file as multipart/form-data.
Request Parameters
file
- File to hash (multipart/form-data)chunk_size
- (Optional) Size of chunks to process for large files
Response
{
"hash": "string", // SHA-224 hash as a hexadecimal string
"filename": "string", // Original filename
"filesize": number, // Size in bytes
"timestamp": "string" // ISO 8601 timestamp
}
Example Request
curl -X POST https://api.sha224.com/v1/hash/file \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@/path/to/your/file.pdf"
Generate Hash from URL
Fetch content from a URL and compute its SHA-224 hash.
Request Body
{
"url": "string", // URL to fetch and hash
"timeout": number // optional, timeout in seconds
}
Response
{
"hash": "string", // SHA-224 hash as a hexadecimal string
"url": "string", // Original URL
"content_length": number, // Size in bytes
"timestamp": "string" // ISO 8601 timestamp
}
Hash Verification Endpoints
Verify Hash
Verify if a given hash matches the computed hash of the provided input.
Request Body
{
"hash": "string", // Expected SHA-224 hash
"text": "string", // Text to verify (mutually exclusive with file)
"encoding": "string" // optional, defaults to utf8
}
Response
{
"valid": boolean, // Whether the hash matches
"expected": "string", // The hash you provided
"computed": "string", // The computed hash
"timestamp": "string" // ISO 8601 timestamp
}
Verify File Hash
Verify if a given hash matches the computed hash of the uploaded file.
Request Parameters
hash
- Expected SHA-224 hashfile
- File to verify (multipart/form-data)
Response
{
"valid": boolean, // Whether the hash matches
"expected": "string", // The hash you provided
"computed": "string", // The computed hash
"filename": "string", // Original filename
"timestamp": "string" // ISO 8601 timestamp
}
Batch Operations
Batch Hash Generation
Generate SHA-224 hashes for multiple text inputs in a single request.
Request Body
{
"items": [
{
"id": "string", // Optional identifier for the item
"text": "string" // Text to hash
},
// More items...
],
"encoding": "string" // optional, defaults to utf8
}
Response
{
"results": [
{
"id": "string", // The identifier you provided
"hash": "string", // SHA-224 hash as a hexadecimal string
"input_length": number // Length of input in bytes
},
// More results...
],
"count": number, // Number of items processed
"timestamp": "string" // ISO 8601 timestamp
}
Batch Verification
Verify multiple hash-text pairs in a single request.
Request Body
{
"items": [
{
"id": "string", // Optional identifier for the item
"hash": "string", // Expected SHA-224 hash
"text": "string" // Text to verify
},
// More items...
],
"encoding": "string" // optional, defaults to utf8
}
Response
{
"results": [
{
"id": "string", // The identifier you provided
"valid": boolean, // Whether the hash matches
"expected": "string", // The hash you provided
"computed": "string" // The computed hash
},
// More results...
],
"count": number, // Number of items processed
"timestamp": "string" // ISO 8601 timestamp
}
Utility Endpoints
Compare Hashes
Compare two SHA-224 hashes securely (constant-time comparison).
Request Body
{
"hash1": "string", // First SHA-224 hash
"hash2": "string" // Second SHA-224 hash
}
Response
{
"match": boolean, // Whether the hashes match
"timestamp": "string" // ISO 8601 timestamp
}
Get API Status
Check the current status of the API and your account.
Response
{
"status": "string", // "operational", "degraded", "maintenance", etc.
"version": "string", // API version
"rate_limit": {
"limit": number, // Requests per minute
"remaining": number, // Remaining requests
"reset": "string" // When the rate limit resets
},
"account": {
"plan": "string", // Your subscription plan
"requests_today": number, // Requests made today
"requests_quota": number // Daily quota
},
"timestamp": "string" // ISO 8601 timestamp
}
Error Handling
The API uses standard HTTP status codes to indicate the success or failure of a request.
Status Code | Description |
---|---|
200 OK | The request was successful. |
400 Bad Request | The request was invalid or malformed. |
401 Unauthorized | Missing or invalid API key. |
403 Forbidden | The API key doesn't have permission to perform the request. |
404 Not Found | The requested resource doesn't exist. |
429 Too Many Requests | Rate limit exceeded. |
500 Internal Server Error | An error occurred on the server. |
Error responses include a JSON body with additional information:
{
"error": {
"code": "string", // Error code
"message": "string", // Human-readable error message
"details": { /* Additional error details */ }
}
}
Rate Limits
API requests are subject to rate limiting based on your subscription plan. The current limits are:
Plan | Requests per Minute | Requests per Day |
---|---|---|
Free | 10 | 1,000 |
Basic | 60 | 10,000 |
Pro | 300 | 100,000 |
Enterprise | 1,000+ | Custom |
Rate limit information is included in the HTTP headers of each response:
X-RateLimit-Limit
: Number of requests allowed per minuteX-RateLimit-Remaining
: Number of requests remaining in the current rate limit windowX-RateLimit-Reset
: Time when the rate limit resets (Unix timestamp)
When a rate limit is exceeded, the API will return a 429 Too Many Requests status code.