Use ListTranscriptionJobs
with an Amazon SDK or CLI
The following code examples show how to use ListTranscriptionJobs
.
- .NET
-
- Amazon SDK for .NET
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository
. /// <summary> /// List transcription jobs, optionally with a name filter. /// </summary> /// <param name="jobNameContains">Optional name filter for the transcription jobs.</param> /// <returns>A list of transcription job summaries.</returns> public async Task<List<TranscriptionJobSummary>> ListTranscriptionJobs(string? jobNameContains = null) { var response = await _amazonTranscribeService.ListTranscriptionJobsAsync( new ListTranscriptionJobsRequest() { JobNameContains = jobNameContains }); return response.TranscriptionJobSummaries; }
-
For API details, see ListTranscriptionJobs in Amazon SDK for .NET API Reference.
-
- CLI
-
- Amazon CLI
-
To list your transcription jobs
The following
list-transcription-jobs
example lists the transcription jobs associated with your Amazon account and Region.aws transcribe list-transcription-jobs
Output:
{ "NextToken": "NextToken", "TranscriptionJobSummaries": [ { "TranscriptionJobName": "speak-id-job-1", "CreationTime": "2020-08-17T21:06:15.391000+00:00", "StartTime": "2020-08-17T21:06:15.416000+00:00", "CompletionTime": "2020-08-17T21:07:05.098000+00:00", "LanguageCode": "language-code", "TranscriptionJobStatus": "COMPLETED", "OutputLocationType": "SERVICE_BUCKET" }, { "TranscriptionJobName": "job-1", "CreationTime": "2020-08-17T20:50:24.207000+00:00", "StartTime": "2020-08-17T20:50:24.230000+00:00", "CompletionTime": "2020-08-17T20:52:18.737000+00:00", "LanguageCode": "language-code", "TranscriptionJobStatus": "COMPLETED", "OutputLocationType": "SERVICE_BUCKET" }, { "TranscriptionJobName": "sdk-test-job-4", "CreationTime": "2020-08-17T20:32:27.917000+00:00", "StartTime": "2020-08-17T20:32:27.956000+00:00", "CompletionTime": "2020-08-17T20:33:15.126000+00:00", "LanguageCode": "language-code", "TranscriptionJobStatus": "COMPLETED", "OutputLocationType": "SERVICE_BUCKET" }, { "TranscriptionJobName": "Diarization-speak-id", "CreationTime": "2020-08-10T22:10:09.066000+00:00", "StartTime": "2020-08-10T22:10:09.116000+00:00", "CompletionTime": "2020-08-10T22:26:48.172000+00:00", "LanguageCode": "language-code", "TranscriptionJobStatus": "COMPLETED", "OutputLocationType": "SERVICE_BUCKET" }, { "TranscriptionJobName": "your-transcription-job-name", "CreationTime": "2020-07-29T17:45:09.791000+00:00", "StartTime": "2020-07-29T17:45:09.826000+00:00", "CompletionTime": "2020-07-29T17:46:20.831000+00:00", "LanguageCode": "language-code", "TranscriptionJobStatus": "COMPLETED", "OutputLocationType": "SERVICE_BUCKET" } ] }
For more information, see Getting Started (Amazon Command Line Interface)
in the Amazon Transcribe Developer Guide. -
For API details, see ListTranscriptionJobs
in Amazon CLI Command Reference.
-
- Java
-
- SDK for Java 2.x
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository
. public class ListTranscriptionJobs { public static void main(String[] args) { TranscribeClient transcribeClient = TranscribeClient.builder() .region(Region.US_EAST_1) .build(); listTranscriptionJobs(transcribeClient); } public static void listTranscriptionJobs(TranscribeClient transcribeClient) { ListTranscriptionJobsRequest listJobsRequest = ListTranscriptionJobsRequest.builder() .build(); transcribeClient.listTranscriptionJobsPaginator(listJobsRequest).stream() .flatMap(response -> response.transcriptionJobSummaries().stream()) .forEach(jobSummary -> { System.out.println("Job Name: " + jobSummary.transcriptionJobName()); System.out.println("Job Status: " + jobSummary.transcriptionJobStatus()); System.out.println("Output Location: " + jobSummary.outputLocationType()); // Add more information as needed // Retrieve additional details for the job if necessary GetTranscriptionJobResponse jobDetails = transcribeClient.getTranscriptionJob( GetTranscriptionJobRequest.builder() .transcriptionJobName(jobSummary.transcriptionJobName()) .build()); // Display additional details System.out.println("Language Code: " + jobDetails.transcriptionJob().languageCode()); System.out.println("Media Format: " + jobDetails.transcriptionJob().mediaFormat()); // Add more details as needed System.out.println("--------------"); }); } }
-
For API details, see ListTranscriptionJobs in Amazon SDK for Java 2.x API Reference.
-
- JavaScript
-
- SDK for JavaScript (v3)
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository
. List transcription jobs.
// Import the required AWS SDK clients and commands for Node.js import { ListTranscriptionJobsCommand } from "@aws-sdk/client-transcribe"; import { transcribeClient } from "./libs/transcribeClient.js"; // Set the parameters export const params = { JobNameContains: "KEYWORD", // Not required. Returns only transcription // job names containing this string }; export const run = async () => { try { const data = await transcribeClient.send( new ListTranscriptionJobsCommand(params) ); console.log("Success", data.TranscriptionJobSummaries); return data; // For unit tests. } catch (err) { console.log("Error", err); } }; run();
Create the client.
import { TranscribeClient } from "@aws-sdk/client-transcribe"; // Set the AWS Region. const REGION = "REGION"; //e.g. "us-east-1" // Create an Amazon Transcribe service client object. const transcribeClient = new TranscribeClient({ region: REGION }); export { transcribeClient };
-
For more information, see Amazon SDK for JavaScript Developer Guide.
-
For API details, see ListTranscriptionJobs in Amazon SDK for JavaScript API Reference.
-
- Python
-
- SDK for Python (Boto3)
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository
. def list_jobs(job_filter, transcribe_client): """ Lists summaries of the transcription jobs for the current AWS account. :param job_filter: The list of returned jobs must contain this string in their names. :param transcribe_client: The Boto3 Transcribe client. :return: The list of retrieved transcription job summaries. """ try: response = transcribe_client.list_transcription_jobs(JobNameContains=job_filter) jobs = response["TranscriptionJobSummaries"] next_token = response.get("NextToken") while next_token is not None: response = transcribe_client.list_transcription_jobs( JobNameContains=job_filter, NextToken=next_token ) jobs += response["TranscriptionJobSummaries"] next_token = response.get("NextToken") logger.info("Got %s jobs with filter %s.", len(jobs), job_filter) except ClientError: logger.exception("Couldn't get jobs with filter %s.", job_filter) raise else: return jobs
-
For API details, see ListTranscriptionJobs in Amazon SDK for Python (Boto3) API Reference.
-
For a complete list of Amazon SDK developer guides and code examples, see Using this service with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.