By on April 3, 2013

Video topic extraction and transcription via Speech2Topic API

← Back to Blog Home

This is a quick tutorial on how to transcribe and extract topics from videos using the Yactraq Speech2Topic API in Mashape.

(Note: Yactraq is giving away $500 to the winner Yactraq category for this coming Mashape April Hackathon on Apr 6th, 2013.  We require a number of teams to submit to this category to unlock the prize :))

This is particularly useful if you’re trying to get context in the video, which can be used to query ad services to pull relevant content.

The process is very simple, we send a link (YouTube) of a video to be processed by the Yactraq API, and we get back a result with information on topics and transcribed words. This result metadata will indicate when in the video these topics and words occur.

Here’s a sample of the response from a processed video:

[snippet id=”1111″]

And here’s what an app that consumes it looks like in action:

Getting started on Speech2Topic API

Step 1:  Get a Mashape key.  All calls to any Mashape API requires a Mashape key.  If you haven’t done so yet, you can sign up for an account at  You can get your Mashape key in your Dashboard.

Step 2:  Request for a Yactraq developer account.  We need the Yactraq account so we can make a proper request to process our videos.  To request for an account, follow the instructions here.

Step 3:  Submit a video processing request through the Yactraq Speech2Topics API.  To do this, you would need the YouTube url of the video you want to extract topics from.  Make a note of the video id of it as well (e.g., the video id is “zFOnOLXrMBQ”).  We also need information from our Yactraq account, particularly “secret” and “adset” which you can get by logging in to .  Also set “start” and “tx” to 1.

My request looks like below:

Yactraq Speech2Topic API Request

Yactraq Speech2Topic API Request


Then hit “Test Endpoint”.  If your request is successful, you would get a response like below:

Yactraq API Sample Response

Yactraq API Sample Response


Step 4: Get some coffee and wait for your request to be processed (According to Yactraq the waiting time takes about half or a third of your video length).

Then you can try to check the status by calling the same endpoint, only this time set “start” to “0” or leave it blank.  This will tell the API to get the results, instead of initiating a new request.

Check status by calling the same endpoint with start empty or 0

Check status by calling the same endpoint with start empty or 0


If your request is successful, you should get a lengthy response like the one I showed you at the beginning of this tutorial.  What you didn’t see there are the transcription results which look like this:

[snippet id=”1112″]

For both parts of the response, there are “ts” values per topic or word transcribed.  You can use this ts (timestamp in seconds) value to see where the words and topics occurred in the video.

I have created a sample app that shows how this can be done here. (the app in the video at the top).

We hope this will get you started in building your own apps that use the Speech2Topic API in Mashape.  Let us know if you have suggestions or comments for our next tutorial!


Share Post: