GET
/
transcribe
/
{task_id}
curl --request GET \
  --url https://client.camb.ai/apis/transcribe/{task_id} \
  --header 'x-api-key: <api-key>'
{
  "status": "SUCCESS",
  "run_id": 123
}

Monitor the progress of your speech-to-text conversion in real-time with our status tracking endpoint. This essential companion to our transcription service lets you check the current state of your audio processing job and retrieve completed transcripts. By polling this endpoint, you can track your transcription task’s lifecycle and handle potential processing issues proactively.

This endpoint works in conjunction with the main /transcribe endpoint, which initiates the transcription process and provides the task_id required for status checks.

Implementing Status Checking

Here’s how to implement transcription status monitoring in your application using Python:

import requests
import time

# Your API authentication
headers = {
    "x-api-key": "your-api-key",  # Replace with your actual API key
    "Content-Type": "application/json"
}

def check_transcription_status(task_id):
    """
    Polls the status endpoint to track a transcription task's progress.
    Continues checking until the task reaches a terminal state.
    """
    if not task_id:
        print("Error: No task ID provided")
        return None

    terminal_states = ["SUCCESS", "ERROR"]
    current_status = None

    while current_status not in terminal_states:
        try:
            # Make the status request
            response = requests.get(
                f"https://client.camb.ai/apis/transcribe/{task_id}",
                headers=headers
            )

            # Verify the request was successful
            response.raise_for_status()

            # Extract the status information
            status_data = response.json()
            current_status = status_data.get("status")

            # Display current progress information
            print(f"Status: {current_status}")
            if current_status == "PENDING":
                continue
                
            # Handle completed state
            if current_status == "SUCCESS":
                print("Transcription completed successfully!")
                return status_data

            # Handle failed state
            if current_status == "ERROR":
                print(f"Transcription failed: {status_data.get('message')}")
                return status_data

            # Wait before next check to avoid excessive requests
            time.sleep(15)  # Poll every 15 seconds

        except requests.exceptions.RequestException as e:
            print(f"Error checking transcription status: {e}")
            if hasattr(e, 'response') and e.response is not None:
                print(f"Response content: {e.response.text}")
            return None

    return None

# Example usage with a task_id from transcription request
task_id = "your_task_id"  # Replace with your actual task ID
final_status = check_transcription_status(task_id)

Best Practices for Status Monitoring

Ensure efficient tracking of your transcription tasks with these professional recommendations:

  1. Optimized Polling Intervals: Start with 15-second intervals and gradually increase to 60 seconds for long audio files
  2. Terminal State Handling: Implement robust error handling for both success and failure scenarios

Authorizations

x-api-key
string
header
required

The x-api-key is a custom header required for authenticating requests to our API. Include this header in your request with the appropriate API key value to securely access our endpoints. You can find your API key(s) in the 'API' section of our studio website.

Path Parameters

task_id
string
required

This parameter represents a unique identifier for a task. It is used in various API endpoints to query the status or result of a specific task. The task_id is typically returned when a task is created.

Response

200
application/json

Successful Response

The response is of type object.