Projekttranskript exportieren
curl --request POST \
--url https://api.voicecheap.ai/v1/projects/{projectId}/transcript \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"source": "<string>",
"targetLanguage": "<string>",
"outputFormat": "<string>",
"includeSpeakerLabels": true
}
'import requests
url = "https://api.voicecheap.ai/v1/projects/{projectId}/transcript"
payload = {
"source": "<string>",
"targetLanguage": "<string>",
"outputFormat": "<string>",
"includeSpeakerLabels": True
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source: '<string>',
targetLanguage: '<string>',
outputFormat: '<string>',
includeSpeakerLabels: true
})
};
fetch('https://api.voicecheap.ai/v1/projects/{projectId}/transcript', 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/projects/{projectId}/transcript",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source' => '<string>',
'targetLanguage' => '<string>',
'outputFormat' => '<string>',
'includeSpeakerLabels' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voicecheap.ai/v1/projects/{projectId}/transcript"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"targetLanguage\": \"<string>\",\n \"outputFormat\": \"<string>\",\n \"includeSpeakerLabels\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.voicecheap.ai/v1/projects/{projectId}/transcript")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"targetLanguage\": \"<string>\",\n \"outputFormat\": \"<string>\",\n \"includeSpeakerLabels\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voicecheap.ai/v1/projects/{projectId}/transcript")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"<string>\",\n \"targetLanguage\": \"<string>\",\n \"outputFormat\": \"<string>\",\n \"includeSpeakerLabels\": true\n}"
response = http.request(request)
puts response.read_bodyTranskription
Projekttranskript exportieren
Rufen Sie ein ursprüngliches oder übersetztes Projekttranskript als JSON, SRT oder VTT ab
Projekttranskript exportieren
curl --request POST \
--url https://api.voicecheap.ai/v1/projects/{projectId}/transcript \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"source": "<string>",
"targetLanguage": "<string>",
"outputFormat": "<string>",
"includeSpeakerLabels": true
}
'import requests
url = "https://api.voicecheap.ai/v1/projects/{projectId}/transcript"
payload = {
"source": "<string>",
"targetLanguage": "<string>",
"outputFormat": "<string>",
"includeSpeakerLabels": True
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source: '<string>',
targetLanguage: '<string>',
outputFormat: '<string>',
includeSpeakerLabels: true
})
};
fetch('https://api.voicecheap.ai/v1/projects/{projectId}/transcript', 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/projects/{projectId}/transcript",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source' => '<string>',
'targetLanguage' => '<string>',
'outputFormat' => '<string>',
'includeSpeakerLabels' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voicecheap.ai/v1/projects/{projectId}/transcript"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"targetLanguage\": \"<string>\",\n \"outputFormat\": \"<string>\",\n \"includeSpeakerLabels\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.voicecheap.ai/v1/projects/{projectId}/transcript")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"targetLanguage\": \"<string>\",\n \"outputFormat\": \"<string>\",\n \"includeSpeakerLabels\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voicecheap.ai/v1/projects/{projectId}/transcript")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"<string>\",\n \"targetLanguage\": \"<string>\",\n \"outputFormat\": \"<string>\",\n \"includeSpeakerLabels\": true\n}"
response = http.request(request)
puts response.read_bodyProjekttranskript exportieren
Rufen Sie ein Transkript aus einem bestehenden VoiceCheap-Projekt ab, ohne interne Web-App-Endpunkte zu verwenden. Der Endpunkt unterstützt das Quelltranskript und jedes verfügbare Transkript in der Zielsprache. Erfolgreiche Anfragen geben HTTP200 zurück.
Anfrage
string
erforderlich
Ihr VoiceCheap API-Schlüssel.
string
erforderlich
Projektkennung, die von Projekt erstellen oder Übersetzung starten zurückgegeben wird.
string
erforderlich
original oder translated.string
Erforderlich, wenn
source gleich translated ist. Verwenden Sie den Namen der Zielsprache, der im Projekt gespeichert ist, wie z. B. french.string
Standard:"json"
json, srt oder vtt.boolean
Standard:"false"
Sichtbare Sprecher-Labels in SRT oder VTT einfügen. JSON enthält immer Sprechernummern.
Beispiele
cURL — Original JSON
curl -X POST "https://api.voicecheap.ai/v1/projects/project_123/transcript" \
-H "x-api-key: vc_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"source": "original",
"outputFormat": "json"
}'
cURL — Translated SRT
curl -X POST "https://api.voicecheap.ai/v1/projects/project_123/transcript" \
-H "x-api-key: vc_your-api-key" \
-H "Content-Type: application/json" \
-d '{
"source": "translated",
"targetLanguage": "french",
"outputFormat": "srt",
"includeSpeakerLabels": true
}' \
--output project_123-fr.srt
workId für die übersetzte Ausgabe.
Fehler
| Status | Code | Beschreibung |
|---|---|---|
| 400 | TARGET_LANGUAGE_REQUIRED | Übersetzte Ausgabe wurde ohne Sprache angefordert |
| 401 | INVALID_API_KEY | API-Schlüssel fehlt oder ist ungültig |
| 403 | FORBIDDEN | API-Schlüssel kann nicht auf dieses Projekt zugreifen |
| 404 | PROJECT_NOT_FOUND | Projekt existiert nicht |
| 404 | TRANSCRIPT_NOT_FOUND | Angefordertes Quell- oder übersetztes Transkript fehlt |
| 409 | TRANSCRIPT_NOT_READY | Angefordertes Transkript wird noch verarbeitet |
War diese Seite hilfreich?

