Generate captions automatically
curl --request POST \
--url https://api.pnplayer.com/v1/api/video/{videoId}/captions/transcribe \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"videoId": "<string>",
"targetLanguages": [
"en",
"es"
]
}
'import requests
url = "https://api.pnplayer.com/v1/api/video/{videoId}/captions/transcribe"
payload = {
"videoId": "<string>",
"targetLanguages": ["en", "es"]
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({videoId: '<string>', targetLanguages: ['en', 'es']})
};
fetch('https://api.pnplayer.com/v1/api/video/{videoId}/captions/transcribe', 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.pnplayer.com/v1/api/video/{videoId}/captions/transcribe",
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([
'videoId' => '<string>',
'targetLanguages' => [
'en',
'es'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <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.pnplayer.com/v1/api/video/{videoId}/captions/transcribe"
payload := strings.NewReader("{\n \"videoId\": \"<string>\",\n \"targetLanguages\": [\n \"en\",\n \"es\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<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.pnplayer.com/v1/api/video/{videoId}/captions/transcribe")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"videoId\": \"<string>\",\n \"targetLanguages\": [\n \"en\",\n \"es\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pnplayer.com/v1/api/video/{videoId}/captions/transcribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"videoId\": \"<string>\",\n \"targetLanguages\": [\n \"en\",\n \"es\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "success"
}{
"message": "<string>"
}{
"message": "Forbidden"
}Captions
Generate captions automatically
Queues automatic transcription for the video in each target language. Generated tracks appear on the video once processing completes. The video ID must be sent in the body as well as the path. Requires the UPDATE_MEDIA scope.
POST
/
v1
/
api
/
video
/
{videoId}
/
captions
/
transcribe
Generate captions automatically
curl --request POST \
--url https://api.pnplayer.com/v1/api/video/{videoId}/captions/transcribe \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"videoId": "<string>",
"targetLanguages": [
"en",
"es"
]
}
'import requests
url = "https://api.pnplayer.com/v1/api/video/{videoId}/captions/transcribe"
payload = {
"videoId": "<string>",
"targetLanguages": ["en", "es"]
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({videoId: '<string>', targetLanguages: ['en', 'es']})
};
fetch('https://api.pnplayer.com/v1/api/video/{videoId}/captions/transcribe', 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.pnplayer.com/v1/api/video/{videoId}/captions/transcribe",
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([
'videoId' => '<string>',
'targetLanguages' => [
'en',
'es'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <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.pnplayer.com/v1/api/video/{videoId}/captions/transcribe"
payload := strings.NewReader("{\n \"videoId\": \"<string>\",\n \"targetLanguages\": [\n \"en\",\n \"es\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<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.pnplayer.com/v1/api/video/{videoId}/captions/transcribe")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"videoId\": \"<string>\",\n \"targetLanguages\": [\n \"en\",\n \"es\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pnplayer.com/v1/api/video/{videoId}/captions/transcribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"videoId\": \"<string>\",\n \"targetLanguages\": [\n \"en\",\n \"es\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "success"
}{
"message": "<string>"
}{
"message": "Forbidden"
}Authorizations
apiKeyAuthbearerAuth
API key created in the dashboard or via POST /v1/api/api-keys. Keys are prefixed pn_ and do not expire until revoked.
Path Parameters
Video ID (GUID)
Example:
"657bb740-a71b-4529-a012-528021c31a92"
Body
application/json
Response
Transcription queued
Example:
"success"
