Transcribe through URL (Youtube, Google Drive, Dropbox, OneDrive)
π Upload a Google Drive URL for Transcription
Easily upload your files for processing by submitting them to the API. The endpoint will return an order_id
, which you can use to obtain the transcription result.
β οΈ Notice: Ensure the file is publicly accessible!
π Request Parameters
Here is a description of the parameters required for the request:
- url (string): The URL of the file to be transcribed.
- service (string): The transcription service type. Options are:
Standard
Subtitle
- language (string): The language code in ISO format, such as
tr-TR
for Turkish oren-US
for English. - folder_id (string, optional): The ID of the folder where the transcription will be stored. If not provided, the file will be saved in the "Recent Files" folder.
- file_name (string, optional): The name of the transcription file. If not provided, the file name will default to the original source name, such as the video title for a YouTube video.
import json
import requests
url = "https://api.tor.app/developer/transcription/url"
# Replace with your actual API key
api_key = "your_api_key"
# Set up the headers, including the API key
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}",
"Accept": "application/json",
}
# Here, adjust the url, service, language, and optionally folder_id and file_name
config = json.dumps(
{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"service": "Standard",
"language": "en-US",
#"folder_id": "your_folder_id", # optional folder_id
#"file_name": "example", # optional file_name
}
)
response = requests.post(url, headers=headers, data=config)
print(response.status_code)
response_json = response.json()
print(response_json["message"])
# This is your order ID to check the status of the transcription
print(response_json["order_id"])
const axios = require('axios');
const url = "https://api.tor.app/developer/transcription/url";
const apiKey = "your_api_key"; // Replace with your actual API key
const headers = {
"Content-Type": "application/json",
"Authorization": `Bearer ${apiKey}`,
"Accept": "application/json"
};
const config = {
url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
service: "Standard",
language: "en-US"
// "folder_id": "your_folder_id", // optional folder_id
// "file_name": "example" // optional file_name
};
axios.post(url, config, { headers })
.then(response => {
console.log(response.status);
console.log(response.data.message);
console.log("Order ID:", response.data.order_id);
})
.catch(error => {
console.error("Error:", error.response ? error.response.data : error.message);
});
import okhttp3.*;
import org.json.JSONObject;
public class TranscriptionRequest {
private static final String API_KEY = "your_api_key"; // Replace with your actual API key
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
String url = "https://api.tor.app/developer/transcription/url";
JSONObject config = new JSONObject();
config.put("url", "https://www.youtube.com/watch?v=dQw4w9WgXcQ");
config.put("service", "Standard");
config.put("language", "en-US");
// config.put("folder_id", "your_folder_id"); // optional folder_id
// config.put("file_name", "example"); // optional file_name
RequestBody body = RequestBody.create(config.toString(), MediaType.parse("application/json"));
Request request = new Request.Builder()
.url(url)
.post(body)
.addHeader("Authorization", "Bearer " + API_KEY)
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println("Status Code: " + response.code());
String responseBody = response.body().string();
JSONObject responseJson = new JSONObject(responseBody);
System.out.println("Message: " + responseJson.getString("message"));
System.out.println("Order ID: " + responseJson.getString("order_id"));
}
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class Program
{
private static readonly string apiKey = "your_api_key"; // Replace with your actual API key
public static async Task Main()
{
var client = new HttpClient();
var url = "https://api.tor.app/developer/transcription/url";
var config = new
{
url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
service = "Standard",
language = "en-US"
// folder_id = "your_folder_id", // optional folder_id
// file_name = "example" // optional file_name
};
var jsonConfig = new StringContent(JsonSerializer.Serialize(config), Encoding.UTF8, "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiKey}");
client.DefaultRequestHeaders.Add("Accept", "application/json");
var response = await client.PostAsync(url, jsonConfig);
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine("Status Code: " + (int)response.StatusCode);
var responseJson = JsonSerializer.Deserialize<JsonDocument>(responseBody);
Console.WriteLine("Message: " + responseJson.RootElement.GetProperty("message").GetString());
Console.WriteLine("Order ID: " + responseJson.RootElement.GetProperty("order_id").GetString());
}
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
const apiKey = "your_api_key" // Replace with your actual API key
func main() {
url := "https://api.tor.app/developer/transcription/url"
config := map[string]interface{}{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"service": "Standard",
"language": "en-US",
// "folder_id": "your_folder_id", // optional folder_id
// "file_name": "example", // optional file_name
}
configBytes, _ := json.Marshal(config)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(configBytes))
req.Header.Set("Authorization", "Bearer "+apiKey)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Accept", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
var responseJson map[string]interface{}
json.NewDecoder(resp.Body).Decode(&responseJson)
fmt.Println("Status Code:", resp.StatusCode)
fmt.Println("Message:", responseJson["message"])
fmt.Println("Order ID:", responseJson["order_id"])
}
require 'net/http'
require 'json'
require 'uri'
api_key = "your_api_key" # Replace with your actual API key
url = URI("https://api.tor.app/developer/transcription/url")
headers = {
"Content-Type" => "application/json",
"Authorization" => "Bearer #{api_key}",
"Accept" => "application/json"
}
config = {
url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
service: "Standard",
language: "en-US",
# folder_id: "your_folder_id", # optional folder_id
# file_name: "example" # optional file_name
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url, headers)
request.body = config.to_json
response = http.request(request)
response_data = JSON.parse(response.body)
puts "Status Code: #{response.code}"
puts "Message: #{response_data['message']}"
puts "Order ID: #{response_data['order_id']}"
<?php
$apiKey = "your_api_key"; // Replace with your actual API key
$url = "https://api.tor.app/developer/transcription/url";
$headers = [
"Authorization: Bearer $apiKey",
"Content-Type: application/json",
"Accept: application/json"
];
$config = [
"url" => "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"service" => "Standard",
"language" => "en-US"
// "folder_id" => "your_folder_id", // optional folder_id
// "file_name" => "example" // optional file_name
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($config));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$responseData = json_decode($response, true);
echo "Status Code: $httpCode\n";
echo "Message: " . $responseData["message"] . "\n";
echo "Order ID: " . $responseData["order_id"] . "\n";
?>
import okhttp3.*
import org.json.JSONObject
import java.io.IOException
fun main() {
val apiKey = "your_api_key" // Replace with your actual API key
val url = "https://api.tor.app/developer/transcription/url"
val client = OkHttpClient()
val config = JSONObject().apply {
put("url", "https://www.youtube.com/watch?v=dQw4w9WgXcQ")
put("service", "Standard")
put("language", "en-US")
// put("folder_id", "your_folder_id") // optional folder_id
// put("file_name", "example") // optional file_name
}
val body = RequestBody.create(MediaType.parse("application/json"), config.toString())
val request = Request.Builder()
.url(url)
.post(body)
.addHeader("Authorization", "Bearer $apiKey")
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
println("Request failed: ${e.message}")
}
override fun onResponse(call: Call, response: Response) {
response.use {
if (it.isSuccessful) {
val responseBody = it.body()?.string()
val jsonResponse = JSONObject(responseBody)
println("Status Code: ${it.code()}")
println("Message: ${jsonResponse.getString("message")}")
println("Order ID: ${jsonResponse.getString("order_id")}")
} else {
println("Failed with status code: ${it.code()}")
println("Response: ${it.body()?.string()}")
}
}
}
})
}
import Foundation
let apiKey = "your_api_key" // Replace with your actual API key
let url = URL(string: "https://api.tor.app/developer/transcription/url")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.addValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("application/json", forHTTPHeaderField: "Accept")
let config: [String: Any] = [
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"service": "Standard",
"language": "en-US"
// "folder_id": "your_folder_id", // optional folder_id
// "file_name": "example" // optional file_name
]
request.httpBody = try! JSONSerialization.data(withJSONObject: config, options: [])
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else { return }
let httpResponse = response as! HTTPURLResponse
let responseData = try! JSONSerialization.jsonObject(with: data) as! [String: Any]
print("Status Code: \(httpResponse.statusCode)")
print("Message: \(responseData["message"] as! String)")
print("Order ID: \(responseData["order_id"] as! String)")
}
task.resume()
import 'dart:convert';
import 'dart:io';
void main() async {
const apiKey = 'your_api_key'; // Replace with your actual API key
final url = Uri.parse("https://api.tor.app/developer/transcription/url");
final headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer $apiKey',
'Accept': 'application/json'
};
final config = jsonEncode({
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"service": "Standard",
"language": "en-US"
// "folder_id": "your_folder_id", // optional folder_id
// "file_name": "example" // optional file_name
});
final request = await HttpClient().postUrl(url)
..headers.add("Authorization", "Bearer $apiKey")
..headers.contentType = ContentType.json
..write(config);
final response = await request.close();
final responseBody = await response.transform(utf8.decoder).join();
final responseJson = jsonDecode(responseBody);
print("Status Code: ${response.statusCode}");
print("Message: ${responseJson['message']}");
print("Order ID: ${responseJson['order_id']}");
}
200 OK
{
"statusCode": 200,
"body": {
"message": "URL is successfully submitted for transcription.",
"order_id": "1731070869643507993"
}
}
400 Missing Required Fields
{
"statusCode": 400,
"body": {
'message': f"Missing required fields: "
}
}
400 Invalid URL
{
"statusCode": 400,
"body": {
'message': "Invalid URL: "
}
}
500 Internal Server Error
{
"statusCode": 500,
"body": "Internal server error"
}
# The word "new line" will trigger a line break in the transcription
config = json.dumps(
{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"service": "Standard",
"language": "en-US",
"triggering_word: "new line"
#"folder_id": "01J4788HH1AAQ6XBCR3JNWMV67", # optional folder_id
}
)
Updated about 1 month ago