Obtener estado de la traducción
curl --request GET \
--url https://api.voicecheap.ai/v1/translate/{projectId}/status \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.voicecheap.ai/v1/translate/{projectId}/status"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.voicecheap.ai/v1/translate/{projectId}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voicecheap.ai/v1/translate/{projectId}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.voicecheap.ai/v1/translate/{projectId}/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.voicecheap.ai/v1/translate/{projectId}/status")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voicecheap.ai/v1/translate/{projectId}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"projectId": "<string>",
"projectName": "<string>",
"originalVideoUrl": "<string>",
"originalLanguage": "<string>",
"targetLanguage": "<string>",
"duration": 123,
"createdAt": 123,
"workflow": "<string>",
"transcriptionStatus": "<string>",
"transcripts": {
"transcripts.original": {},
"transcripts.translations": [
{}
]
},
"workId": "<string>",
"translatedVersionId": "<string>",
"actualProgressStep": "<string>",
"translationAndTranscriptionProgress": 123,
"dubbingStep": "<string>",
"dubbingProgress": 123,
"status": "<string>",
"lipSync": {
"lipSync.jobId": "<string>",
"lipSync.status": "<string>",
"lipSync.videoUrl": "<string>",
"lipSync.errorMessage": "<string>",
"lipSync.type": "<string>",
"lipSync.createdAt": "<string>",
"lipSync.requestedAt": "<string>",
"lipSync.completedAt": "<string>",
"lipSync.failedAt": "<string>",
"lipSync.timedOutAt": "<string>",
"lipSync.activeSpeakerDetectionEnabled": true
},
"translatedVideoUrl": "<string>",
"translatedAudioUrl": "<string>",
"error": {
"error.code": "<string>",
"error.message": "<string>"
}
}Traducción
Obtener estado de la traducción
Compruebe el estado de un proyecto de traducción y recupere los resultados
Obtener estado de la traducción
curl --request GET \
--url https://api.voicecheap.ai/v1/translate/{projectId}/status \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.voicecheap.ai/v1/translate/{projectId}/status"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.voicecheap.ai/v1/translate/{projectId}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voicecheap.ai/v1/translate/{projectId}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.voicecheap.ai/v1/translate/{projectId}/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.voicecheap.ai/v1/translate/{projectId}/status")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voicecheap.ai/v1/translate/{projectId}/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"projectId": "<string>",
"projectName": "<string>",
"originalVideoUrl": "<string>",
"originalLanguage": "<string>",
"targetLanguage": "<string>",
"duration": 123,
"createdAt": 123,
"workflow": "<string>",
"transcriptionStatus": "<string>",
"transcripts": {
"transcripts.original": {},
"transcripts.translations": [
{}
]
},
"workId": "<string>",
"translatedVersionId": "<string>",
"actualProgressStep": "<string>",
"translationAndTranscriptionProgress": 123,
"dubbingStep": "<string>",
"dubbingProgress": 123,
"status": "<string>",
"lipSync": {
"lipSync.jobId": "<string>",
"lipSync.status": "<string>",
"lipSync.videoUrl": "<string>",
"lipSync.errorMessage": "<string>",
"lipSync.type": "<string>",
"lipSync.createdAt": "<string>",
"lipSync.requestedAt": "<string>",
"lipSync.completedAt": "<string>",
"lipSync.failedAt": "<string>",
"lipSync.timedOutAt": "<string>",
"lipSync.activeSpeakerDetectionEnabled": true
},
"translatedVideoUrl": "<string>",
"translatedAudioUrl": "<string>",
"error": {
"error.code": "<string>",
"error.message": "<string>"
}
}Obtener estado de la traducción
Recupere el estado actual de un proyecto de traducción. Utilice este endpoint para consultar el progreso y obtener la URL del video traducido cuando el procesamiento se haya completado.Solicitud
Encabezados
string
requerido
Su clave API VoiceCheap. Obtenga una en app.voicecheap.ai/page-api.
Parámetros de ruta
string
requerido
El identificador único del proyecto de traducción devuelto desde el endpoint Start Translation.
Respuesta
La estructura de la respuesta varía según el estado de la traducción.Campos comunes
string
requerido
El identificador único del proyecto
string
requerido
El nombre del proyecto
string
requerido
URL del archivo de video/audio original cargado
string
requerido
El idioma original detectado o especificado
string
requerido
El idioma de destino para la traducción
number
requerido
Duración del contenido en segundos
number
requerido
Marca de tiempo Unix de cuando se creó el proyecto
string
requerido
Flujo de trabajo de la API que creó el proyecto:
translation o transcription.string
requerido
Estado de la transcripción de origen:
processing, success o failed. Esta señal es independiente de la finalización del doblaje.object
requerido
Transcripciones normalizadas disponibles.
string
Identificador de trabajo de traducción para la versión traducida reportada actualmente.
string
Identificador de versión traducida para la versión traducida reportada actualmente.
string
Paso actual del proyecto. Durante la creación o transcripción, esto refleja el paso de creación activo.
Los ejemplos incluyen
downloading_content, content_validation y transcription_processing.
Una vez que comienza el doblaje, puede cambiar a un paso de doblaje activo como smart_sync o audio_assembling.
status: processing no se empareja con actualProgressStep: done.number
Porcentaje de progreso aproximado para la creación/transcripción del proyecto (0-100)
string
Paso de doblaje actual para el idioma de destino (p. ej.,
smart_sync, audio_enhancement, video_upload)number
Porcentaje de progreso aproximado para el doblaje (0-100)
string
requerido
Estado actual de la traducción:
processing, success o failedCampos de Lip Sync
Cuando se solicitó la sincronización labial, la respuesta incluye un objetolipSync adicional:
object
Estado y detalles de salida de la sincronización labial (solo presente cuando se solicitó la sincronización labial)
Mostrar propiedades de lipSync
Mostrar propiedades de lipSync
string
Identificador del trabajo de sincronización labial
string
Estado de la sincronización labial:
PENDING, PROCESSING, COMPLETED, FAILED, REJECTED o CANCELEDstring
URL del video con sincronización labial. Utilice esta URL para la salida final con sincronización labial cuando
lipSync.status sea COMPLETED.string
Detalles del error si la sincronización labial falló
string
Modo de sincronización labial:
standard, pro o studio.string
Marca de tiempo ISO de cuando se creó el intento de sincronización labial.
string
Marca de tiempo ISO de cuando se solicitó el intento de sincronización labial, cuando esté disponible.
string
Marca de tiempo ISO de cuando se completó la sincronización labial, cuando esté disponible.
string
Marca de tiempo ISO de cuando falló la sincronización labial, cuando esté disponible.
string
Marca de tiempo ISO de cuándo se agotó el tiempo de espera de la sincronización labial, cuando esté disponible.
boolean
Si la detección de hablante activo estaba habilitada para este intento de sincronización labial.
Cuando se solicita la sincronización labial, la traducción permanece en
processing hasta que lipSync.status sea COMPLETED. Si la sincronización labial falla, el estado se convierte en
failed y el error.code es LIPSYNC_FAILED. Cuando la sincronización labial tiene éxito, lea el activo con sincronización labial desde lipSync.videoUrl; translatedVideoUrl
es la salida de video traducido antes de la superposición de sincronización labial.Utilice
GET /v1/projects/{projectId} cuando necesite el historial completo de versiones traducidas o el historial completo de sincronización labial.Campos de respuesta de éxito
Para los flujos de trabajo de traducción, se incluyen los siguientes campos cuandostatus es success. Un flujo de trabajo solo de transcripción llega a success sin campos de medios traducidos.
string
URL para descargar el archivo de video traducido
string
URL para descargar el archivo de audio traducido por separado
Campos de respuesta de error
Cuandostatus es failed, se incluye el siguiente campo adicional:
object
Ejemplos
curl -X GET "https://api.voicecheap.ai/v1/translate/abc123-def456-ghi789/status" \
-H "x-api-key: vc_your-api-key"
type TranslationStatus = 'processing' | 'success' | 'failed';
interface Transcript {
source: 'original' | 'translated';
language: string;
text: string;
segments: Array<{
index: number;
text: string;
begin: number;
end: number;
speaker: number;
}>;
}
interface TranslationStatusBase {
projectId: string;
projectName: string;
originalVideoUrl: string;
originalLanguage: string;
targetLanguage: string;
duration: number;
createdAt: number;
workflow: 'translation' | 'transcription';
transcriptionStatus: TranslationStatus;
transcripts: {
original: Transcript | null;
translations: Transcript[];
};
workId?: string;
translatedVersionId?: string;
actualProgressStep?: string;
translationAndTranscriptionProgress?: number;
dubbingStep?: string;
dubbingProgress?: number;
lipSync?: {
jobId: string;
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'REJECTED' | 'CANCELED';
videoUrl: string;
errorMessage: string | null;
type: 'standard' | 'pro' | 'studio';
createdAt?: string;
requestedAt?: string;
completedAt?: string;
failedAt?: string;
timedOutAt?: string;
activeSpeakerDetectionEnabled?: boolean;
};
}
interface TranslationStatusProcessing extends TranslationStatusBase {
status: 'processing';
}
interface TranslationStatusSuccess extends TranslationStatusBase {
status: 'success';
translatedVideoUrl?: string;
translatedAudioUrl?: string;
}
interface TranslationStatusFailed extends TranslationStatusBase {
status: 'failed';
error: {
code: string;
message: string;
};
}
type TranslationStatusResponse = TranslationStatusProcessing | TranslationStatusSuccess | TranslationStatusFailed;
async function getTranslationStatus(projectId: string): Promise<TranslationStatusResponse> {
const response = await fetch(`https://api.voicecheap.ai/v1/translate/${projectId}/status`, {
method: 'GET',
headers: {
'x-api-key': 'vc_your-api-key',
},
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.message || 'Failed to get status');
}
return response.json();
}
// Polling function with typed response handling
async function pollUntilComplete(projectId: string, intervalMs: number = 10000): Promise<TranslationStatusSuccess> {
while (true) {
const status = await getTranslationStatus(projectId);
if (status.status === 'success') {
return status;
}
if (status.status === 'failed') {
throw new Error(`Translation failed: ${status.error.message}`);
}
console.log('Still processing...');
await new Promise((resolve) => setTimeout(resolve, intervalMs));
}
}
// Usage
try {
const result = await pollUntilComplete('abc123-def456-ghi789');
console.log('Translated video:', result.translatedVideoUrl);
console.log('Translated audio:', result.translatedAudioUrl);
} catch (error) {
console.error('Error:', error);
}
const response = await fetch('https://api.voicecheap.ai/v1/translate/abc123-def456-ghi789/status', {
method: 'GET',
headers: {
'x-api-key': 'vc_your-api-key',
},
});
const status = await response.json();
if (status.status === 'success') {
console.log('Translated video:', status.translatedVideoUrl);
} else if (status.status === 'processing') {
console.log('Still processing...');
} else if (status.status === 'failed') {
console.error('Translation failed:', status.error.message);
}
import requests
import time
headers = {'x-api-key': 'vc_your-api-key'}
project_id = 'abc123-def456-ghi789'
# Poll until complete
while True:
response = requests.get(
f'https://api.voicecheap.ai/v1/translate/{project_id}/status',
headers=headers
)
status = response.json()
if status['status'] == 'success':
print(f"Translated video: {status['translatedVideoUrl']}")
print(f"Translated audio: {status['translatedAudioUrl']}")
break
elif status['status'] == 'failed':
print(f"Translation failed: {status['error']['message']}")
break
else:
print("Still processing...")
time.sleep(10) # Wait 10 seconds before polling again
<?php
$apiKey = 'vc_your-api-key';
$projectId = 'abc123-def456-ghi789';
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voicecheap.ai/v1/translate/{$projectId}/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"x-api-key: {$apiKey}"
]
]);
$response = curl_exec($curl);
$status = json_decode($response, true);
switch ($status['status']) {
case 'success':
echo "Translated video: " . $status['translatedVideoUrl'] . "\n";
echo "Translated audio: " . $status['translatedAudioUrl'];
break;
case 'processing':
echo "Still processing...";
break;
case 'failed':
echo "Failed: " . $status['error']['message'];
break;
}
Ejemplos de respuesta
Estado de procesamiento
{
"projectId": "abc123-def456-ghi789",
"projectName": "My Spanish Translation",
"originalVideoUrl": "https://storage.voicecheap.ai/...",
"originalLanguage": "en",
"targetLanguage": "spanish",
"duration": 125.5,
"createdAt": 1702234567890,
"workflow": "translation",
"transcriptionStatus": "processing",
"transcripts": { "original": null, "translations": [] },
"actualProgressStep": "downloading_content",
"translationAndTranscriptionProgress": 11,
"dubbingStep": "smart_sync",
"dubbingProgress": 30,
"status": "processing"
}
Estado de procesamiento (Lip Sync solicitado)
{
"projectId": "abc123-def456-ghi789",
"projectName": "My Spanish Translation",
"originalVideoUrl": "https://storage.voicecheap.ai/...",
"originalLanguage": "en",
"targetLanguage": "spanish",
"duration": 125.5,
"createdAt": 1702234567890,
"workflow": "translation",
"transcriptionStatus": "success",
"transcripts": { "original": null, "translations": [] },
"actualProgressStep": "finalizing",
"translationAndTranscriptionProgress": 95,
"dubbingStep": "video_upload",
"dubbingProgress": 95,
"status": "processing",
"lipSync": {
"jobId": "syncjob_123",
"status": "PROCESSING",
"videoUrl": "",
"errorMessage": null,
"type": "standard"
}
}
Estado de éxito
{
"projectId": "abc123-def456-ghi789",
"projectName": "My Spanish Translation",
"originalVideoUrl": "https://storage.voicecheap.ai/...",
"originalLanguage": "en",
"targetLanguage": "spanish",
"duration": 125.5,
"createdAt": 1702234567890,
"workflow": "translation",
"transcriptionStatus": "success",
"transcripts": { "original": null, "translations": [] },
"status": "success",
"translatedVideoUrl": "https://storage.voicecheap.ai/translated/...",
"translatedAudioUrl": "https://storage.voicecheap.ai/audio/..."
}
Estado de éxito (Lip Sync completado)
{
"projectId": "abc123-def456-ghi789",
"projectName": "My Spanish Translation",
"originalVideoUrl": "https://storage.voicecheap.ai/...",
"originalLanguage": "en",
"targetLanguage": "spanish",
"duration": 125.5,
"createdAt": 1702234567890,
"workflow": "translation",
"transcriptionStatus": "success",
"transcripts": { "original": null, "translations": [] },
"actualProgressStep": "done",
"dubbingStep": "done",
"dubbingProgress": 100,
"status": "success",
"translatedVideoUrl": "https://storage.voicecheap.ai/translated/...",
"translatedAudioUrl": "https://storage.voicecheap.ai/audio/...",
"lipSync": {
"jobId": "syncjob_123",
"status": "COMPLETED",
"videoUrl": "https://storage.voicecheap.ai/lipsync/...",
"errorMessage": null,
"type": "pro"
}
}
Estado de error
{
"projectId": "abc123-def456-ghi789",
"projectName": "My Spanish Translation",
"originalVideoUrl": "https://storage.voicecheap.ai/...",
"originalLanguage": "en",
"targetLanguage": "spanish",
"duration": 125.5,
"createdAt": 1702234567890,
"workflow": "translation",
"transcriptionStatus": "failed",
"transcripts": { "original": null, "translations": [] },
"status": "failed",
"error": {
"code": "TRANSCRIPTION_FAILED",
"message": "Could not transcribe the audio. Please ensure the audio quality is sufficient."
}
}
Mejores prácticas de sondeo
Intervalo de sondeo recomendado: 10-30 segundosEl tiempo de traducción varía según la duración y la complejidad del video. Para un video típico de 2 minutos, espere de 2 a 5 minutos de tiempo de procesamiento.
Límite de tasa: 30 solicitudes por minutoEvite realizar sondeos con una frecuencia superior a una vez cada 2 segundos para mantenerse dentro de los límites de tasa.
Errores
| Estado | Código | Descripción |
|---|---|---|
| 401 | INVALID_API_KEY | La clave API proporcionada no es válida |
| 403 | FORBIDDEN | No tiene acceso a este proyecto |
| 404 | PROJECT_NOT_FOUND | El proyecto especificado no existe |
| 429 | RATE_LIMIT_EXCEEDED | Demasiadas solicitudes (límite: 30 solicitudes por minuto) |
¿Esta página le ayudó?

