textstringrequerido
Parameter defines the text you want to translate. Its length can't exceed 5,000 characters, emojis and some rare characters count as two.
https://api.sandbase.ai/v1/api/google/translateTranslate text with Google Translate between a source and target language code and get the translation with detected language.
Su salida aparecerá aquí
Complete las entradas y luego haga clic en Ejecutar.
Translate text with Google Translate between a source and target language code and get the translation with detected language.
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.
| Name | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Parameter defines the text you want to translate. Its length can't exceed 5,000 characters, emojis and some rare characters count as two. |
from | string | Yes | 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 (S |
to | string | Yes | 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 |
json_restrictor | string | No | 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. |
$0.010 per successful call. Failed calls are not charged.
Empiece a construir
Endpoint de la API de la plataforma con autenticación unificada y seguimiento de uso.
curl -X POST "https://api.sandbase.ai/v1/api/google/translate" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "zh-CN",
"from": "en",
"text": "Hello, how are you?"
}'Configure su clave de API de SandBase en el entorno de su servidor. Las solicitudes usan autenticación Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserve su clave en el servidor. No la exponga en código del navegador.
textstringrequeridoParameter defines the text you want to translate. Its length can't exceed 5,000 characters, emojis and some rare characters count as two.
fromstringrequeridoParameter 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.
tostringrequeridoParameter 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.
json_restrictorstringParameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.
Respuesta de ejemplo guardada para esta API; no se realiza ninguna solicitud en vivo al verla.
No se ha publicado ninguna respuesta guardada. Ejecute la API en Playground para inspeccionar su respuesta.
Explorar más
| API | Precio | Respuesta |
|---|---|---|
Google TranslateEsta API Google | $0.01 por llamada | JSON |
Google | $0.01 por llamada | JSON |
Google | $0.015 por llamada | JSON |
Google | Desde $0.002 por llamada | JSON |
Google | Desde $0.0015 por llamada | JSON |
Google | $0.01 por llamada | JSON |
Preguntas
Envía una solicitud POST a https://api.sandbase.ai/v1/api/google/translate con tu clave API de SandBase en el encabezado Authorization (Bearer) y los parámetros como un cuerpo JSON. También puedes probarlo en el Playground de esta página sin escribir código.
$0.01 por llamada, facturado desde tu saldo de SandBase. Solo se te cobra por las llamadas que haces; no hay suscripción.
Requeridos: text (string), from (string) y to (string). Opcionales: json_restrictor (string). La tabla de Parámetros y el Playground de esta página enumeran todos los campos.
Una respuesta JSON devuelta en la misma solicitud HTTP (sincrónica).
No. Google Translate funciona a través de SandBase, así que una sola clave API de SandBase cubre este endpoint y todas las demás APIs y modelos del catálogo. No necesitas solicitar acceso a la API de Google por separado.