Uploading through URL (Youtube, Google Drive, Dropbox, Onedrive)

🌐 Online File Upload API

With our API, you can conveniently upload files using your favorite platforms. Currently, we support file uploads from:

If you would like to upload a file by providing a link, please use the following sample code:

Notice

Before providing the link, please make sure your file is public.

import json
import requests

url = "https://api.transkriptor.com/2/Upload-URL"

headers = {}
headers["Content-Type"] = "application/json"

# here adjust the url,apiKey, service, language
data = json.dumps({
    "url": "https://www.youtube.com/watch?v=wqlCzaLfEBg",
    "apiKey": "xxxxxx",
    "service": "Standard",
    "language": "en-US"
})

resp = requests.post(url, headers=headers, data=data)
print(resp.status_code)

# this is your order id to use later
print(resp.text)
const axios = require('axios');

const url = "https://api.transkriptor.com/2/Upload-URL";

const headers = {
    "Content-Type": "application/json"
};

// here adjust the url, apiKey, service, language
const data = JSON.stringify({
    "url": "https://www.youtube.com/watch?v=wqlCzaLfEBg",
    "apiKey": "xxxxxx",
    "service": "Standard",
    "language": "en-US"
});

axios.post(url, data, { headers })
    .then(response => {
        console.log(response.status);
        // this is your order id to use later
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });

import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import org.json.JSONObject;

public class Main {

    public static void main(String[] args) {
        // here adjust the url, apiKey, service, language
        JSONObject data = new JSONObject();
        data.put("url", "https://www.youtube.com/watch?v=wqlCzaLfEBg");
        data.put("apiKey", "xxxxxx");
        data.put("service", "Standard");
        data.put("language", "en-US");

        try {
            HttpResponse<JsonNode> response = Unirest.post("https://api.transkriptor.com/2/Upload-URL")
                    .header("Content-Type", "application/json")
                    .body(data)
                    .asJson();

            // Status code
            System.out.println(response.getStatus());

            // This is your order id to use later
            System.out.println(response.getBody());
        } catch (UnirestException e) {
            e.printStackTrace();
        }
    }
}

using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static readonly HttpClient client = new HttpClient();

    static async Task Main(string[] args)
    {
        var url = "https://api.transkriptor.com/2/Upload-URL";
        
        client.DefaultRequestHeaders.Add("Content-Type", "application/json");
        
        // here adjust the url, apiKey, service, language
        var data = new
        {
            url = "https://www.youtube.com/watch?v=wqlCzaLfEBg",
            apiKey = "xxxxxx",
            service = "Standard",
            language = "en-US"
        };
        
        var content = new StringContent(
            Newtonsoft.Json.JsonConvert.SerializeObject(data), 
            Encoding.UTF8, 
            "application/json"
        );
        
        try
        {
            var response = await client.PostAsync(url, content);

            // Status code
            Console.WriteLine(response.StatusCode);

            // This is your order id to use later
            Console.WriteLine(await response.Content.ReadAsStringAsync());
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }
    }
}

package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	url := "https://api.transkriptor.com/2/Upload-URL"

	// here adjust the url, apiKey, service, language
	var jsonData = []byte(`{
		"url": "https://www.youtube.com/watch?v=wqlCzaLfEBg",
		"apiKey": "xxxxxx",
		"service": "Standard",
		"language": "en-US"
	}`)

	req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
	if err != nil {
		panic(err)
	}
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	// Status code
	fmt.Println("Response status code:", resp.StatusCode)

	// This is your order id to use later
	body, _ := ioutil.ReadAll(resp.Body)
	fmt.Println("Response body:", string(body))
}

require 'net/http'
require 'uri'
require 'json'

url = URI("https://api.transkriptor.com/2/Upload-URL")

# here adjust the url, apiKey, service, language
data = {
    "url": "https://www.youtube.com/watch?v=wqlCzaLfEBg",
    "apiKey": "xxxxxx",
    "service": "Standard",
    "language": "en-US"
}.to_json

headers = {
    'Content-Type': 'application/json'
}

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url, headers)
request.body = data

response = http.request(request)

# Status code
puts response.code

# This is your order id to use later
puts response.body

<?php
$url = "https://api.transkriptor.com/2/Upload-URL";
$headers = array(
    "Content-Type: application/json",
);

// here adjust the url, apiKey, service, language
$data = json_encode(array(
    "url" => "https://www.youtube.com/watch?v=wqlCzaLfEBg",
    "apiKey" => "xxxxxx",
    "service" => "Standard",
    "language" => "en-US",
));

$options = array(
    'http' => array(
        'method'  => 'POST',
        'header'  => $headers,
        'content' => $data,
    ),
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

if ($result === FALSE) { /* Handle error */ }

// Status code
var_dump(http_response_code());

// This is your order id to use later
var_dump($result);
?>

import okhttp3.MediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody

fun main() {
    val client = OkHttpClient()

    val url = "https://api.transkriptor.com/2/Upload-URL"
    val mediaType = MediaType.parse("application/json")

    // here adjust the url, apiKey, service, language
    val data = """
    {
        "url": "https://www.youtube.com/watch?v=wqlCzaLfEBg",
        "apiKey": "xxxxxx",
        "service": "Standard",
        "language": "en-US"
    }
    """.trimIndent()

    val body = RequestBody.create(mediaType, data)

    val request = Request.Builder()
        .url(url)
        .post(body)
        .addHeader("Content-Type", "application/json")
        .build()

    val response = client.newCall(request).execute()

    // Status code
    println(response.code())

    // This is your order id to use later
    println(response.body()?.string())
}

import Foundation

let url = URL(string: "https://api.transkriptor.com/2/Upload-URL")!

// here adjust the url, apiKey, service, language
let data: [String: Any] = [
    "url": "https://www.youtube.com/watch?v=wqlCzaLfEBg",
    "apiKey": "xxxxxx",
    "service": "Standard",
    "language": "en-US"
]

let jsonData = try! JSONSerialization.data(withJSONObject: data)

var request = URLRequest(url: url)
request.httpMethod = "POST"
request.httpBody = jsonData
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let error = error {
        print("Error: \(error)")
    } else if let httpResponse = response as? HTTPURLResponse {
        // Status code
        print("Response status code: \(httpResponse.statusCode)")

        if let data = data, let str = String(data: data, encoding: .utf8) {
            // This is your order id to use later
            print("Response body: \(str)")
        }
    }
}

task.resume()

import 'dart:convert';
import 'package:http/http.dart' as http;

void main() async {
  final url = 'https://api.transkriptor.com/2/Upload-URL';

  // here adjust the url, apiKey, service, language
  final data = jsonEncode({
    "url": "https://www.youtube.com/watch?v=wqlCzaLfEBg",
    "apiKey": "xxxxxx",
    "service": "Standard",
    "language": "en-US"
  });

  final response = await http.post(
    Uri.parse(url),
    headers: {"Content-Type": "application/json"},
    body: data,
  );

  // Status code
  print('Response status: ${response.statusCode}');

  // This is your order id to use later
  print('Response body: ${response.body}');
}