Documentation - API v2

There is newer API version

Introduction

Using this API you can automatically send files for transcription and subtitling.

How it works?

server communication
  • 1. Your server sends url of file
  • 2. Price is calculated
  • 3. Payment from your wallet
  • 4. When file is finished, we will ping your server's url that order has been finished

Getting ready

API token

All requests sent to gotranscript.com API must have token.
Example: https://gotranscript.com/api/v2/....?api_token=API_TOKEN

Callback url

We will send POST request to your website url when transcription/subtitling will be finished.

Set your website url down below.

login to see form

Code

All code examples will be in PHP. And for simplicity we will use curlGet() and curlPost() functions.

<?php

function curlGet($url) {
    return curl($url);
}

function curlPost($url, array $data) {
    return curl($url, $data);
}

function curl($url, array $data = null) {
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    if ($data) {
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    }
    $response = curl_exec($ch);
    curl_close($ch);

    return $response;
} 

1 step. Add file

Send your file url and parameters how file should be processed to gotranscript.com.

<?php

$url = 'https://gotranscript.com/api/v2/audios/add?api_token=API_TOKEN';
$data = [
    'url' => 'http://your-url.com/audio.mp3',
    'from' => 0,
    'till' => 120, // file will we transcribed from 00:00:00 till 00:02:00 (2 minutes)
    'language' => 'english',
    'text_format' => 'clean_verbatim',
    'timestamping' => 'not_required',
    'turnaround_time' => '5_days',
    'number_of_speakers' => '1_or_2',
    'subtitles_and_cc' => 'not_required',
    'comment' => 'Instructions for transcribers [optional]',
];

echo curlPost($url, $data); 
  • url - file you want to transcribe/subtitle. Url must be available until file is finished!
  • from - start file transcription from this amount of seconds.
  • till - finish file transcription at this amount of seconds.
  • language - values: english, french, spanish, italian, lithuanian, filipino, russian, portuguese, dutch, german, turkish, serbian, croatian, bosnian, arabic, chinese (simplified), japanese, hebrew, indonesian, swedish, korean, romanian, vietnamese, catalan, swahili, persian (farsi), persian (dari), chinese (traditional)
  • text_format - values: clean_verbatim, full_verbatim
  • timestamping - values: not_required, every_2_minutes, change_of_speaker
  • turnaround_time - values: 1_days, 2_days, 3_days, 4_days, 5_days
  • number_of_speakers - values: 1_or_2, 3_or_more
  • subtitles_and_cc - values: not_required, srt

2 step. Price

Response will be in JSON format. You will get audio id and audio price.

{
   "mode":"test",
   "status":"success",
   "data":{
      "audio":{
         "id":777,
         "price":77.77
      }
   }
} 

If you forgot to change API_TOKEN or made other mistake, error will look like this:

{
   "mode":"live",
   "status":"error",
   "errors":{"error":"Wrong api token"}
} 

3 step. Payment

Make payment from your wallet. Don't forget to change AUDIO_ID.

<?php

$url = 'https://gotranscript.com/api/v2/audios/AUDIO_ID/pay?api_token=API_TOKEN';

echo curlGet($url); 

Response:

{
   "mode":"test",
   "status":"success",
   "data":null
} 

4 step. Transcription/subtitles download url

When our transcribers will finish file, POST request will be sent to your server. Code on our server looks like this:

// CODE ON gotranscript.com SERVER

$url = 'http://your-server.com/file-finished';
$data = [
    'mode' => 'live',
    'status' => 'success',
    'audio_id' => 777,
    'transcription_url' => 'https://gotranscript.com/api/v2/test/test-file/1?api_token=test', // API_TOKEN value will be set automatically
    'subtitles_url' => 'https://gotranscript.com/api/v2/test/test-file/2?api_token=test', // present only when "srt" is chosen as "subtitles_and_cc" parameter
];

$response = curlPost($url, $data);

if ($reponse == 'ok') {
    // your server received data
} else {
    // retry request in 1 hour (up to 10 times)
} 

When your server receives data, it must output ok. If it will not output ok, we will send this request again every hour up to 10 times.

To test how your server responds to request from gotranscript.com, click on link below.

Test request to your server (without subtitles)
Test request to your server (with subtitles)

Monitoring

Orders

When api is used in live mode (not in testing), you can go to login. There you will see your orders, and their status.

Discount

All orders made through API receive 20% discount.

Need help? Contact us: info@gotranscript.com