If you’re using Python or TypeScript, see Transcribe an audio file.
Get started
Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for a free account and get your API key from your dashboard. The entire source code of this guide can be viewed here.Step-by-step instructions
- 1 Create a new file and import the necessary libraries for making an HTTP request.
- 2 Set up the API endpoint and headers. The headers should include your API key.
- 3 Upload your local file to the AssemblyAI API.
-
4
Use the
upload_url
returned by the AssemblyAI API to create a JSON payload containing theaudio_url
parameter. We delete uploaded files from our servers either after the transcription has completed, or 24 hours after you uploaded the file. After the file has been deleted, the correspondingupload_url
is no longer valid. -
5
Make a
POST
request to the AssemblyAI API endpoint with the payload and headers. -
6
After making the request, you’ll receive an ID for the transcription. Use it to poll the API every few seconds to check the status of the transcript job. Once the status is
completed
, you can retrieve the transcript from the API response.
Understanding the response
The AssemblyAI API returns JSON-formatted output. Your transcription will be located in thetext
key. You’ll also find a timestamp and a confidence score for each word inside of the words
key, as well as other parameters assigned by the API such as language_code
and language_model
.
Refer to the API reference for a breakdown of every element in your transcript output.