Exporter la transcription du projet
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_bodyTranscription
Exporter la transcription du projet
Récupérer une transcription de projet originale ou traduite au format JSON, SRT ou VTT
Exporter la transcription du projet
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_bodyExporter la transcription du projet
Récupérer une transcription à partir d’un projet VoiceCheap existant sans utiliser les points de terminaison de l’application web interne. Le point de terminaison prend en charge la transcription source et chaque transcription en langue cible disponible. Les requêtes réussies renvoient le code HTTP200.
Requête
string
requis
Votre clé API VoiceCheap.
string
requis
Identifiant de projet renvoyé par Créer un projet ou Démarrer la traduction.
string
requis
original ou translated.string
Requis lorsque
source est translated. Utilisez le nom de la langue cible stocké sur le projet, tel que french.string
défaut:"json"
json, srt ou vtt.boolean
défaut:"false"
Inclure les étiquettes de locuteur visibles dans le fichier SRT ou VTT. Le format JSON inclut toujours les numéros de locuteur.
Exemples
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 pour la sortie traduite.
Erreurs
| Statut | Code | Description |
|---|---|---|
| 400 | TARGET_LANGUAGE_REQUIRED | La sortie traduite a été demandée sans langue |
| 401 | INVALID_API_KEY | La clé API est manquante ou invalide |
| 403 | FORBIDDEN | La clé API ne peut pas accéder à ce projet |
| 404 | PROJECT_NOT_FOUND | Le projet n’existe pas |
| 404 | TRANSCRIPT_NOT_FOUND | La transcription source ou traduite demandée est absente |
| 409 | TRANSCRIPT_NOT_READY | La transcription demandée est en cours de traitement |
Cette page vous a-t-elle été utile ?

