Übersetzungsstatus abrufen
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>"
}
}Übersetzung
Übersetzungsstatus abrufen
Überprüfen Sie den Status eines Übersetzungsprojekts und rufen Sie die Ergebnisse ab
Übersetzungsstatus abrufen
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>"
}
}Übersetzungsstatus abrufen
Rufen Sie den aktuellen Status eines Übersetzungsprojekts ab. Verwenden Sie diesen Endpunkt, um den Fortschritt abzufragen und die URL des übersetzten Videos zu erhalten, sobald die Verarbeitung abgeschlossen ist.Anfrage
Header
string
erforderlich
Ihr VoiceCheap API-Schlüssel. Erhalten Sie einen unter app.voicecheap.ai/page-api.
Pfadparameter
string
erforderlich
Die eindeutige Kennung des Übersetzungsprojekts, die vom Start Translation-Endpunkt zurückgegeben wird.
Antwort
Die Antwortstruktur variiert je nach Übersetzungsstatus.Allgemeine Felder
string
erforderlich
Die eindeutige Kennung des Projekts
string
erforderlich
Der Name des Projekts
string
erforderlich
URL zur ursprünglichen hochgeladenen Video-/Audiodatei
string
erforderlich
Die erkannte oder angegebene Originalsprache
string
erforderlich
Die Zielsprache für die Übersetzung
number
erforderlich
Dauer des Inhalts in Sekunden
number
erforderlich
Unix-Zeitstempel, zu dem das Projekt erstellt wurde
string
erforderlich
API-Workflow, der das Projekt erstellt hat:
translation oder transcription.string
erforderlich
Status der Quelltranskription:
processing, success oder failed. Dieses Signal ist unabhängig vom Abschluss der Synchronisation.object
erforderlich
string
Kennung der Übersetzungsarbeit für die aktuell gemeldete übersetzte Version.
string
Kennung der übersetzten Version für die aktuell gemeldete übersetzte Version.
string
Aktueller Projektschritt. Während der Erstellung oder Transkription spiegelt dies den aktiven Erstellungsschritt wider.
Beispiele sind
downloading_content, content_validation und transcription_processing.
Sobald die Synchronisation beginnt, kann sie zu einem aktiven Synchronisationsschritt wie smart_sync oder audio_assembling wechseln.
status: processing lässt sich nicht mit actualProgressStep: done kombinieren.number
Ungefährer Fortschrittsprozentsatz für die Projekterstellung/-transkription (0-100)
string
Aktueller Synchronisationsschritt für die Zielsprache (z. B.
smart_sync, audio_enhancement, video_upload)number
Ungefährer Fortschrittsprozentsatz für die Synchronisation (0-100)
string
erforderlich
Aktueller Status der Übersetzung:
processing, success oder failedLip Sync Felder
Wenn eine Lippensynchronisation angefordert wurde, enthält die Antwort ein zusätzlicheslipSync-Objekt:
object
Status und Details der Lippensynchronisation (nur vorhanden, wenn eine Lippensynchronisation angefordert wurde)
Anzeigen Lippensynchronisationseigenschaften
Anzeigen Lippensynchronisationseigenschaften
string
Auftragskennung für die Lippensynchronisation
string
Status der Lippensynchronisation:
PENDING, PROCESSING, COMPLETED, FAILED, REJECTED oder CANCELEDstring
URL des lippensynchronisierten Videos. Verwenden Sie diese URL für das endgültige lippensynchronisierte Ergebnis, wenn
lipSync.status den Wert COMPLETED hat.string
Fehlerdetails, falls die Lippensynchronisation fehlgeschlagen ist
string
Modus der Lippensynchronisation:
standard, pro oder studio.string
ISO-Zeitstempel, zu dem der Versuch der Lippensynchronisation erstellt wurde.
string
ISO-Zeitstempel, zu dem der Versuch der Lippensynchronisation angefordert wurde, sofern verfügbar.
string
ISO-Zeitstempel, zu dem die Lippensynchronisation abgeschlossen wurde, sofern verfügbar.
string
ISO-Zeitstempel, zu dem die Lippensynchronisation fehlgeschlagen ist, sofern verfügbar.
string
ISO-Zeitstempel, wann die Lippensynchronisation abgelaufen ist, falls verfügbar.
boolean
Ob die Erkennung aktiver Sprecher für diesen Versuch der Lippensynchronisation aktiviert war.
Wenn eine Lippensynchronisation angefordert wird, bleibt die Übersetzung in
processing, bis lipSync.status COMPLETED ist. Wenn die Lippensynchronisation fehlschlägt, ändert sich der Status zu
failed und error.code ist LIPSYNC_FAILED. Wenn die Lippensynchronisation erfolgreich ist, lesen Sie das lippensynchronisierte Asset von lipSync.videoUrl; translatedVideoUrl
ist die übersetzte Videoausgabe vor dem Overlay der Lippensynchronisation.Verwenden Sie
GET /v1/projects/{projectId}, wenn Sie den vollständigen Verlauf der übersetzten Version oder den vollständigen Verlauf der Lippensynchronisation benötigen.Felder für erfolgreiche Antworten
Für Übersetzungs-Workflows sind die folgenden Felder enthalten, wennstatus success ist. Ein Workflow, der nur aus Transkription besteht, erreicht success ohne übersetzte Medienfelder.
string
URL zum Herunterladen der übersetzten Videodatei
string
URL zum separaten Herunterladen der übersetzten Audiodatei
Felder für fehlerhafte Antworten
Wennstatus failed ist, ist das folgende zusätzliche Feld enthalten:
object
Beispiele
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;
}
Antwortbeispiele
Verarbeitungsstatus
{
"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"
}
Verarbeitungsstatus (Lip Sync angefordert)
{
"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"
}
}
Erfolgsstatus
{
"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/..."
}
Erfolgsstatus (Lip Sync abgeschlossen)
{
"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"
}
}
Fehlerstatus
{
"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."
}
}
Best Practices für das Polling
Empfohlenes Polling-Intervall: 10-30 SekundenDie Übersetzungszeit variiert je nach Videolänge und Komplexität. Rechnen Sie bei einem typischen 2-Minuten-Video mit 2-5 Minuten Verarbeitungszeit.
Ratenbegrenzung: 30 Anfragen pro MinuteVermeiden Sie es, häufiger als alle 2 Sekunden abzufragen, um innerhalb der Ratenbegrenzungen zu bleiben.
Fehler
| Status | Code | Beschreibung |
|---|---|---|
| 401 | INVALID_API_KEY | Der bereitgestellte API-Schlüssel ist ungültig |
| 403 | FORBIDDEN | Sie haben keinen Zugriff auf dieses Projekt |
| 404 | PROJECT_NOT_FOUND | Das angegebene Projekt existiert nicht |
| 429 | RATE_LIMIT_EXCEEDED | Zu viele Anfragen (Limit: 30 Anfragen pro Minute) |
War diese Seite hilfreich?

