Esporta trascrizione del progetto
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_bodyTrascrizione
Esporta trascrizione del progetto
Recupera una trascrizione del progetto originale o tradotta come JSON, SRT o VTT
Esporta trascrizione del progetto
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_bodyEsporta trascrizione del progetto
Recupera una trascrizione da un progetto VoiceCheap esistente senza utilizzare endpoint dell’applicazione web interna. L’endpoint supporta la trascrizione sorgente e ogni trascrizione in lingua di destinazione disponibile. Le richieste riuscite restituiscono HTTP200.
Richiesta
string
obbligatorio
La tua chiave API VoiceCheap.
string
obbligatorio
Identificatore del progetto restituito da Crea progetto o Avvia traduzione.
string
obbligatorio
original o translated.string
Obbligatorio quando
source è translated. Utilizza il nome della lingua di destinazione memorizzato nel progetto, come french.string
predefinito:"json"
json, srt o vtt.boolean
predefinito:"false"
Includi etichette visibili del parlante in SRT o VTT. Il formato JSON include sempre i numeri dei parlanti.
Esempi
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 per l’output tradotto.
Errori
| Stato | Codice | Descrizione |
|---|---|---|
| 400 | TARGET_LANGUAGE_REQUIRED | È stato richiesto l’output tradotto senza una lingua |
| 401 | INVALID_API_KEY | La chiave API manca o non è valida |
| 403 | FORBIDDEN | La chiave API non può accedere a questo progetto |
| 404 | PROJECT_NOT_FOUND | Il progetto non esiste |
| 404 | TRANSCRIPT_NOT_FOUND | La trascrizione sorgente o tradotta richiesta è assente |
| 409 | TRANSCRIPT_NOT_READY | La trascrizione richiesta è ancora in fase di elaborazione |
Questa pagina è stata utile?

