YTAPI.devDocs

Get batch status

getBatchJob(id): BatchJobResponse

GET
https://api.ytapi.dev/v1/batch/{id}

Poll or inspect the status and results of an asynchronous batch job. While running, status will be pending or processing. Once finished, status will be completed (or failed) with populated results and exact credits_deducted.

API Key

All requests require a valid API key from the developer dashboard.

Headers: Authorization: Bearer YOUR_API_KEYorX-API-Key: YOUR_API_KEY

See Authentication for headers and rate limits.

Path Parameters

ParameterTypeRequiredDescription
idpath
stringYes

The unique batch job ID returned by POST /v1/batch.

Response (HTTP 200)

{
  "id": string,                  // Batch job identifier
  "status": string,              // Lifecycle state: "pending", "processing", "completed", or "failed"
  "total": number,               // Total tasks in the batch
  "successful": number,          // Number of successfully finished tasks (status: 200)
  "failed": number,              // Number of failed tasks
  "credits_deducted": number,    // Actual billable credits deducted
  "duration_ms": number,         // Execution time in milliseconds
  "results": [                   // Array of individual task results once completed
    {
      "id": string,              // Caller-specified task id
      "type": string,            // "transcript" or "basic_info"
      "video_id": string,        // YouTube video ID
      "status": number,          // HTTP status code (200, 404, etc.)
      "data": any,               // Extracted transcript or video metadata payload (when status=200)
      "error": {                 // Structured error envelope (when status != 200)
        "code": string,
        "message": string
      }
    }
  ],
  "created_at": string,          // ISO 8601 creation timestamp
  "completed_at": string | null  // ISO 8601 completion timestamp
}