跳转到内容
POST AI agent ready /v1/base64/decode

Base64 解码 API - 将 Base64 转换为纯文本

将 Base64 编码的字符串转换回可读的 UTF-8 文本。 支持标准和 URL 安全的 Base64 变体。 如果输入不是有效的 Base64,则返回明确的错误消息。

Parameters

stringrequired

The Base64-encoded string to decode.

boolean

Interpret the input as URL-safe Base64.

Code examples

curl -X POST https://api.botoi.com/v1/base64/decode \
  -H "Content-Type: application/json" \
  -d '{"encoded":"SGVsbG8sIFdvcmxkIQ==","urlSafe":false}'

When to use this API

读取 Base64 编码的 Webhook 负载

许多服务(Stripe、Twilio、GitHub)以 Base64 形式提供事件数据。 解码有效负载以检查原始 JSON 或 XML 正文。

从电子邮件中提取嵌入内容

MIME 电子邮件附件采用 Base64 编码。 在服务器端对其进行解码以检索原始文件或文本。

Frequently asked questions

如果输入的 Base64 无效,会发生什么情况?
API 返回一个错误响应,其中包含一条描述性消息,解释输入在何处偏离 Base64 规范。
我可以解码 Base64 编码的二进制数据(例如图像)吗?
此端点以 UTF-8 字符串形式返回解码后的内容。 对于二进制数据,您需要在解码后在客户端处理原始字节。
这是否处理填充字符(=)?
是的。 接受填充和未填充的 Base64 输入。
我如何知道输入是 URL 安全的还是标准 Base64?
如果字符串包含 - 或 _ 字符,则它是 URL 安全的 Base64。 如果包含+或/字符,则为标准Base64。

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.