Base64 Decode API Endpoint - Free Public API
Endpoint URL:
https://aisenseapi.com/services/v1/base64_decode
Description:
This endpoint decodes a Base64-encoded string back into its original format. It accepts input as JSON with a data field containing the Base64-encoded string or as raw text with Content-Type: text/plain. The response format supports JSON (default) or raw binary output based on the Accept header.
If the input is invalid, an appropriate error message will be returned.
Response Format
- Content-Type:
application/json(default) orapplication/octet-stream(for binary data)
Example Success Responses
Decoded JSON Data (when Base64 contains JSON)
{
"type": "json",
"decoded_data": {
"key": "value"
}
}
Decoded Binary Data (when Base64 contains raw binary or non-JSON text)
{
"type": "binary",
"decoded_data_storage_url": "https://aisenseapi.com/services/v1/storage/123e4567-e89b-12d3-a456-426614174000",
"expire_timestamp": 1738457158
}
Binary Output (when Accept: application/octet-stream is set)
The API streams the raw binary data directly to the client.
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="decoded_data.bin"
Example Error Responses
{ "error": "Invalid Base64 input." }{ "error": "No data to decode or invalid input." }{ "error": "UUID generation failed" }{ "error": "Unsupported Accept header." }
Input Requirements
- Input can be sent as JSON: json
{ "data": "SGVsbG8gd29ybGQ=" } - Or as plain text with
Content-Type: text/plain:SGVsbG8gd29ybGQ=
Use Cases
- Decoding Base64-encoded JSON data for API responses
- Reverting encoded binary files to their original format
- Processing Base64-encoded text data stored in communication protocols
- Temporary storage of decoded binary files with UUID retrieval
How to Use
1. Send a POST request to
https://aisenseapi.com/services/v1/base64_decode
2. Choose your input format
- JSON input: json
{ "data": "SGVsbG8gd29ybGQ=" } - Plain text input:
SGVsbG8gd29ybGQ=
3. Specify the desired response format
- JSON response (default):
Add the headerAccept: application/json - Binary response:
Add the headerAccept: application/octet-stream
4. Handle the response
- If the input is valid JSON, the decoded data is returned directly.
- If the decoded data is binary or non-JSON text, it is stored, and a storage URL is returned instead.
- If the client requests binary output, the decoded data is streamed.
Example cURL Requests
JSON Input with JSON Response
curl -X POST https://aisenseapi.com/services/v1/base64_decode \
-H "Content-Type: application/json" \
-d '{"data":"SGVsbG8gd29ybGQ="}'
Plain Text Input with Binary Response
curl -X POST https://aisenseapi.com/services/v1/base64_decode \
-H "Content-Type: text/plain" \
-H "Accept: application/octet-stream" \
--data "SGVsbG8gd29ybGQ=" \
-o output.bin
Key Features
- Supports both JSON and plain text Base64 input
- Flexible output: JSON (default) or binary based on the
Acceptheader - Provides temporary storage for large or non-JSON data, retrievable via UUID
- Ensures clear error handling for invalid input or unsupported formats
- No authentication required – free public API