Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
100 requests per minute
Endpoints
1 endpoint available
Overview
The Base64 Encoder/Decoder API converts text and images to and from Base64 format. Supports both encoding (text/image to Base64) and decoding (Base64 to text/image).
Operations
- encode - Convert text or image data to Base64
- decode - Convert Base64 back to text or image
Input Types
- text - Plain text strings (UTF-8 supported)
- image - Base64-encoded image data or data URLs
Use Cases
- Embed images in HTML/CSS as data URIs
- Encode data for URL parameters
- Convert images for email signatures
- Transmit binary data over text-based protocols
- Store binary data in JSON
Endpoints
POST
/v1/tools/base64-encoder-decoderEncode or decode text/images to/from Base64
Request Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string Enum: encode, decode | Required | The operation to perform |
| type | string Enum: text, image | Required | The type of data being processed |
| input | string | Required | The input data (text to encode, Base64 to decode, or image data URL) |
Response Example
{
"success": true,
"result": {
"output": "SGVsbG8gV29ybGQh",
"operation": "encode",
"type": "text"
}
}Error Codes
400
Invalid request body or missing required fields401
Missing or invalid API key422
Invalid Base64 string or unsupported format429
Rate limit exceeded500
Internal server errorCode Examples
# Encode text to Base64
curl -X POST https://api.opentools.ca/v1/tools/base64-encoder-decoder \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation": "encode", "type": "text", "input": "Hello World!"}'
# Decode Base64 to text
curl -X POST https://api.opentools.ca/v1/tools/base64-encoder-decoder \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation": "decode", "type": "text", "input": "SGVsbG8gV29ybGQh"}'