Blog

A New API Endpoint to Paginate Through Historical Transcripts

Changelog
A New API Endpoint to Paginate Through Historical Transcripts
Share on social icon.Share on social icon.Share on social icon.Share on social icon.

Every day, millions of transcriptions are created using the AssemblyAI API. Developers transcribe videos, podcasts, phone calls, interviews, and a slew of other types of content that we never imagined back when we started the company in 2017.

A common ask we get from developers is for an easy way to query for, and paginate through, all the transcriptions they’ve historically created with the AssemblyAI API. Traditionally, we’ve advised developers to store the IDs of all the transcriptions they create. That way a developer can, at any time, query the AssemblyAI API for the details of a historical transcription with a GET request like below:

GET /v2/transcript/{transcript_id}

But over time we’ve found that storing these transcription IDs may not always be easy for developers, as it often requires a schema change to a database which is never fun. More commonly, developers integrating the AssemblyAI API want to be able to query for a list of transcriptions that are still processing, failed, or queued, to help them debug their applications as they are building.

That’s why today we are happy to make available our new List Endpoint, which give developers the ability to query for, and paginate through, all of their historical transcriptions. For example, here’s how we can quickly query for the most recent 200 completed transcriptions on our account:

curl --request GET \
--url https://api.assemblyai.com/v2/transcript?limit=200&status=completed \
--header 'authorization: YOUR-ASSEMBLYAI-TOKEN' \
--header 'content-type: application/json'

The above query will return a JSON response like this:

{
    "transcripts": [
         {
            "id": "3hg73t53o-fb8f-437c-9c5f-f852dc9b859b",
            "resource_url": "https://api.assemblyai.com/v2/transcript/3hg73t53o-fb8f-437c-9c5f-f852dc9b859b",
            "status": "completed",
            "created": "2021-05-04T23:30:03.272084",
            "completed": "2021-05-04T23:31:00.918176",
            "audio_url": "https://cdn.assemblyai.com/upload/60e31fd4-1f90-49d9-abb2-6d60433020a6"
        },
        {
            "id": "3t05k0dqa-3fe9-4dc5-bd93-985765402323",
            "resource_url": "https://api.assemblyai.com/v2/transcript/3t05k0dqa-3fe9-4dc5-bd93-985765402323",
            "status": "completed",
            "created": "2021-05-03T19:38:53.567626",
            "completed": "2021-05-03T19:39:21.827162",
            "audio_url": "https://cdn.assemblyai.com/upload/730b9ca0-1029-4519-9697-9c0e96123bc0"
        },
        {
            "id": "8w5chxgaz-dcf5-4647-8cb4-cdfeaccdaa7d",
            "resource_url": "https://api.assemblyai.com/v2/transcript/8w5chxgaz-dcf5-4647-8cb4-cdfeaccdaa7d",
            "status": "completed",
            "created": "2021-05-03T19:38:06.985813",
            "completed": "2021-05-03T19:38:31.671583",
            "audio_url": "https://cdn.assemblyai.com/upload/730b9ca0-1029-4519-9697-9c0e96123bc0"
        }
        ...
    ],
    "page_details": {
        "limit": 200,
        "result_count": 200,
        "current_url": "https://api.assemblyai.com/v2/transcript?limit=200&status=completed",
        "prev_url": "https://api.assemblyai.com/v2/transcript?limit=200&status=completed&before_id=8w5chxgaz-dcf5-4647-8cb4-cdfeaccdaa7d",
        "next_url": "https://api.assemblyai.com/v2/transcript?limit=200&status=completed&after_id=3hg73t53o-fb8f-437c-9c5f-f852dc9b859b"
    },
}    

As you can see above, the API returns a list of our most recent completed transcripts. The API only returns up to 200 transcriptions in the API response, so you can easily make iterative GET requests to the prev_url or next_url in the page_details section of the JSON response to “iterate” to the next “page” of transcriptions, giving you the ability to paginate through all of the transcriptions in your account. You can also filter the results by status, to query for only your “processing” transcriptions, for example. 

For more details on this new API endpoint, check out the API Docs here - and if you have any questions at all, just let us know! You can email support@assemblyai.com any time, and you can also use the chat in the bottom right corner of the page to chat live with our support team! 

Subscribe to our blog!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

You may also like

Checkout some of our recent research and product updates

Fine-Tuning Transformers for NLP
Deep Learning
Tutorials
Fine-Tuning Transformers for NLP

Since being first developed and released in the Attention Is All You Need paper Transformers have completely redefined the field of Natural Language Processing. In this blog, we show you how to quickly fine-tune Transformers for numerous downstream tasks, that often perform really well out of the box.

Transcribing Zoom Recordings Using the Zoom API and AssemblyAI
Tutorials
Transcribing Zoom Recordings Using the Zoom API and AssemblyAI

In this post, we’re going to show you how to transcribe your Zoom recordings by connecting Zoom’s API with AssemblyAI’s automatic speech recognition API. In just a few lines of code, you'll see how you can accurately transcribe your Zoom recordings!

Open Sourcing Drone Deploy ECS
Engineering
Open Sourcing Drone Deploy ECS

We’re excited to announce that we’ve open sourced another project! `drone-deploy-ecs` is a Drone plugin that enables you to deploy updates to ECS. Our engineering team has recently made the decision to migrate from Docker on EC2 to AWS ECS. We knew that moving to ECS would require us to refactor our deployment processes, so we figured we’d wrap our deployment process into a single tool that fit into our CICD solution.

ADVANCED TRANSCRIPTON FEATURES

Unlock your media with our advanced features like PII Redaction,
Keyword Boosts, Automatic Transcript Highlights, and more