> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.voicecheap.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Vertaalstatus ophalen

> Controleer de status van een vertaalproject en haal resultaten op

# Vertaalstatus ophalen

Haal de huidige status van een vertaalproject op. Gebruik dit eindpunt om de voortgang te peilen en de URL van de vertaalde video te verkrijgen wanneer de verwerking is voltooid.

## Aanvraag

### Headers

**x-api-key** `string` *required*

Uw VoiceCheap API-sleutel. Haal er een op via [app.voicecheap.ai/page-api](https://app.voicecheap.ai/page-api).

### Padparameters

**projectId** `string` *required*

De unieke identificatie van het vertaalproject die wordt geretourneerd door het [Start Translation](https://api-docs.voicecheap.ai/docs/nl/api-reference/translate.md)-eindpunt.

> [!NOTE]
>
> Een project dat is gemaakt met [Project aanmaken](https://api-docs.voicecheap.ai/docs/nl/api-reference/create-project.md) schakelt over naar de workflow `translation` zodra [Project nasynchroniseren](https://api-docs.voicecheap.ai/docs/nl/api-reference/dub-project.md) erop wordt aangeroepen: dit endpoint volgt dan de nieuwste nasynchronisatierun.

## Antwoord

De antwoordstructuur varieert op basis van de vertaalstatus.

### Algemene velden

**projectId** `string` *required*

De unieke identificatie van het project

**projectName** `string` *required*

De naam van het project

**originalVideoUrl** `string` *required*

URL naar het originele geüploade video-/audiobestand

**originalLanguage** `string` *required*

De gedetecteerde of opgegeven brontaal

**targetLanguage** `string` *required*

De doeltaal voor vertaling

**duration** `number` *required*

Duur van de inhoud in seconden

**createdAt** `number` *required*

Unix-tijdstempel waarop het project is aangemaakt

**workflow** `string` *required*

API-workflow die het project heeft aangemaakt: `translation` of `transcription`.

**transcriptionStatus** `string` *required*

Status van bron-transcriptie: `processing`, `success` of `failed`. Dit signaal staat los van de voltooiing van de nasynchronisatie.

**transcripts** `object` *required*

Beschikbare genormaliseerde transcripties.

**transcripts eigenschappen**

**transcripts.original** `object | null`

Transcriptie in de brontaal indien beschikbaar, inclusief tijdstempels en sprekers.

**transcripts.translations** `array`

Beschikbare transcripten in de doeltaal, met taal en werk-id. Vertaalde segmenten bevatten `finalSpeedFactor` zodra ze zijn ingesproken (zie [Projecttranscriptie exporteren](https://api-docs.voicecheap.ai/docs/nl/api-reference/project-transcript.md)).

**workId** `string`

Identificatie van het vertaalwerk voor de momenteel gerapporteerde vertaalde versie.

**translatedVersionId** `string`

Identificatie van de vertaalde versie voor de momenteel gerapporteerde vertaalde versie.

**actualProgressStep** `string`

Huidige projectstap. Tijdens het aanmaken of transcriberen weerspiegelt dit de actieve aanmaakstap.
Voorbeelden zijn `downloading_content`, `content_validation` en `transcription_processing`.
Zodra de nasynchronisatie begint, kan dit overschakelen naar een actieve nasynchronisatiestap zoals `smart_sync` of `audio_assembling`.
`status: processing` kan samengaan met `actualProgressStep: done` terwijl een latere stap, zoals lipsynchronisatie, nog loopt.

**translationAndTranscriptionProgress** `number`

Geschat voortgangspercentage voor het aanmaken/transcriberen van het project (0-100)

**dubbingStep** `string`

Huidige nasynchronisatiestap voor de doeltaal (bijv. `smart_sync`, `audio_enhancement`, `video_upload`)

**dubbingProgress** `number`

Geschat voortgangspercentage voor nasynchronisatie (0-100)

**status** `string` *required*

Huidige status van de vertaling: `processing`, `success` of `failed`

### Lip Sync velden

Wanneer lipsynchronisatie werd aangevraagd, bevat het antwoord een extra `lipSync`-object:

**lipSync** `object`

Status en uitvoerdetails van lipsynchronisatie (alleen aanwezig wanneer lipsynchronisatie werd aangevraagd)

**lipSync eigenschappen**

**lipSync.jobId** `string`

Identificatie van de lipsynchronisatietaak

**lipSync.status** `string`

Status van lipsynchronisatie: `PENDING`, `PROCESSING`, `COMPLETED`, `FAILED`, `REJECTED` of `CANCELED`

**lipSync.videoUrl** `string`

URL van de video met lipsynchronisatie. Gebruik deze URL voor de uiteindelijke lipsynchronisatie-uitvoer wanneer `lipSync.status` gelijk is aan `COMPLETED`.

**lipSync.errorMessage** `string | null`

Vaste VoiceCheap-foutmelding, of null als er geen fout is vastgelegd.

**lipSync.type** `string`

Modus voor lipsynchronisatie: `standard`, `pro` of `studio`.

**lipSync.createdAt** `string`

ISO-tijdstempel waarop de lipsynchronisatiepoging is aangemaakt.

**lipSync.requestedAt** `string`

ISO-tijdstempel waarop de lipsynchronisatiepoging werd aangevraagd, indien beschikbaar.

**lipSync.completedAt** `string`

ISO-tijdstempel waarop de lipsynchronisatie is voltooid, indien beschikbaar.

**lipSync.failedAt** `string`

ISO-tijdstempel waarop de lipsynchronisatie is mislukt, indien beschikbaar.

**lipSync.timedOutAt** `string`

ISO-tijdstempel wanneer de lipsynchronisatie een time-out kreeg, indien beschikbaar.

**lipSync.activeSpeakerDetectionEnabled** `boolean`

Of detectie van de actieve spreker was ingeschakeld voor deze poging tot lipsynchronisatie.

> [!NOTE]
>
> Wanneer lipsynchronisatie wordt aangevraagd, blijft de vertaling in `processing` totdat `lipSync.status` `COMPLETED` is. Als de lipsynchronisatie mislukt, wordt de status
> `failed` en de `error.code` is `LIPSYNC_FAILED`. Wanneer de lipsynchronisatie slaagt, lees het lipsynchronisatie-asset uit `lipSync.videoUrl`; `translatedVideoUrl`
> is de vertaalde video-output vóór de lipsynchronisatie-overlay.

> [!TIP]
>
> Gebruik `GET /v1/projects/{projectId}` wanneer u de volledige vertaalde versiegeschiedenis of de volledige lipsynchronisatiegeschiedenis nodig heeft.

### Velden voor succesvolle respons

Voor vertaalworkflows worden de volgende velden opgenomen wanneer `status` `success` is. Een workflow die alleen uit transcriptie bestaat, bereikt `success` zonder vertaalde mediavelden.

**translatedVideoUrl** `string`

URL om het vertaalde videobestand te downloaden

**translatedAudioUrl** `string`

URL om het vertaalde audiobestand afzonderlijk te downloaden

### Velden voor mislukte respons

Wanneer `status` `failed` is, wordt het volgende extra veld opgenomen:

**error** `object`

Foutdetails

**fouteigenschappen**

**error.code** `string`

Machineleesbare foutcode

**error.message** `string`

Menselijk leesbare foutbeschrijving

## Voorbeelden

```bash cURL theme={null}
curl -X GET "https://api.voicecheap.ai/v1/translate/abc123-def456-ghi789/status" \
  -H "x-api-key: vc_your-api-key"
```

```typescript TypeScript theme={null}
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);
}
```

```javascript JavaScript theme={null}
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);
}
```

```python Python theme={null}
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 PHP theme={null}
<?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;
}
```

## Respons-voorbeelden

### Verwerkingsstatus

```json theme={null}
{
  "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"
}
```

### Verwerkingsstatus (Lip Sync aangevraagd)

```json theme={null}
{
  "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"
  }
}
```

### Status succes

```json theme={null}
{
  "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/..."
}
```

### Status succes (Lip Sync voltooid)

```json theme={null}
{
  "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"
  }
}
```

### Status mislukt

```json theme={null}
{
  "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": "The transcription could not be completed. Please try again."
  }
}
```

## Best practices voor polling

> [!NOTE]
>
> **Aanbevolen polling-interval:** 10-30 seconden
>
> De vertaaltijd varieert op basis van videolengte en complexiteit. Reken voor een typische video van 2 minuten op 2-5 minuten verwerkingstijd.

> [!WARNING]
>
> **Snelheidslimiet:** 30 verzoeken per minuut
>
> Vermijd vaker dan eens per 2 seconden te pollen om binnen de snelheidslimieten te blijven.

## Fouten

| Status | Code | Beschrijving |
| - | - | - |
| 401 | `INVALID_API_KEY` | De opgegeven API-sleutel is ongeldig |
| 403 | `FORBIDDEN` | U heeft geen toegang tot dit project |
| 404 | `PROJECT_NOT_FOUND` | Het opgegeven project bestaat niet |
| 429 | `RATE_LIMIT_EXCEEDED` | Te veel verzoeken (limiet: 30 verzoeken per minuut) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.