Sand AISand AI MAGI-2MAGI-2 hiện đã có trên SandBase: video 1080p với âm thanh gốcDùng thử ngay

Google Translate

Tài liệu API
https://api.sandbase.ai/v1/api/google/translate

Translate text with Google Translate between a source and target language code and get the translation with detected language.

Giá
$0.01USD / lượt gọi
Phương thức
POST
Phản hồi
JSON
Tham số
3 bắt buộc · 1 tùy chọn

Phòng thử nghiệm

Đầu vào
Parameter defines the text you want to translate. Its length can't exceed 5,000 characters, emojis and some rare characters count as two.
Parameter defines the language of the text you want to translate. It's a two or three-letter language code, optionally followed by a region or script code (e.g., `es` for Spanish, `pt-PT` for Portuguese (Portugal), or `zh-CN` for Chinese (Simplified)). Use `auto` to detect the language of the text. Head to the Google Translate languages page for a full list of supported languages.
Parameter defines the language you want to translate the text into. It's a two or three-letter language code, optionally followed by a region or script code (e.g., `es` for Spanish, `pt-PT` for Portuguese (Portugal), or `zh-CN` for Chinese (Simplified)). Head to the Google Translate languages page for a full list of supported languages.
Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.
Đầu raSẵn sàng

Đầu ra của bạn sẽ xuất hiện ở đây

Hoàn tất đầu vào, rồi nhấp Run.

README API

Google Translate

Translate text with Google Translate between a source and target language code and get the translation with detected language.

Request

curl -X POST "https://api.sandbase.ai/v1/api/google/translate" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello, how are you?", "from": "en", "to": "zh-CN"}'

The result is returned in outputs[0].data as structured JSON.

Parameters

NameTypeRequiredDescription
textstringYesParameter defines the text you want to translate. Its length can't exceed 5,000 characters, emojis and some rare characters count as two.
fromstringYesParameter defines the language of the text you want to translate. It's a two or three-letter language code, optionally followed by a region or script code (e.g., es for Spanish, pt-PT for Portuguese (Portugal), or zh-CN for Chinese (S
tostringYesParameter defines the language you want to translate the text into. It's a two or three-letter language code, optionally followed by a region or script code (e.g., es for Spanish, pt-PT for Portuguese (Portugal), or zh-CN for Chinese
json_restrictorstringNoParameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.

Pricing

$0.010 per successful call. Failed calls are not charged.

Khám phá thêm

APIs liên quan

Tất cả APIs
APIGiáPhản hồi
Google$0.01 mỗi lần gọiJSON
Google$0.01 mỗi lần gọiJSON
Google$0.015 mỗi lần gọiJSON
GoogleTừ $0.002 mỗi lần gọiJSON
GoogleTừ $0.0015 mỗi lần gọiJSON
Google$0.01 mỗi lần gọiJSON

Hướng dẫn:Best Google API in 2026: Pricing Compared

Câu hỏi

FAQ

Làm thế nào để dùng API Google Translate?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/google/translate với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.

API Google Translate có giá bao nhiêu?

$0.01 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.

API Google Translate chấp nhận những tham số nào?

Bắt buộc: text (string), from (string) và to (string). Tùy chọn: json_restrictor (string). Bảng Parameters và Playground trên trang này liệt kê mọi trường.

API Google Translate trả về gì?

Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ).

Tôi có cần tài khoản nhà phát triển hoặc API key của Google không?

Không. Google Translate chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Google.