> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.twelvelabs.io/v1.3/api-reference/create-embeddings-v1/video-embeddings/retrieve-video-embeddings/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.twelvelabs.io/_mcp/server. # Retrieve video embeddings GET https://api.twelvelabs.io/v1.3/embed/tasks/{task_id} This method retrieves embeddings for a specific video embedding task. Ensure the task status is `ready` before invoking this method. Refer to the [Retrieve the status of a video embedding tasks](/v1.3/api-reference/create-embeddings-v1/video-embeddings/retrieve-video-embedding-task-status) page for instructions on checking the task status. Reference: https://docs.twelvelabs.io/api-reference/create-embeddings-v1/video-embeddings/retrieve-video-embeddings ## Authentication - `x-api-key` header (required) — Your API key. You can find your API key on the API Keys page. ## Request ### Path parameters - `task_id` (string, required) — The unique identifier of your video embedding task. ### Query parameters - `embedding_option` (list of enum, optional) — Specifies which types of embeddings to retrieve. Values: `visual`, `audio`, `transcription`. For details, see the [Embedding options](/v1.3/docs/concepts/modalities#embedding-options) section. The platform returns all available embeddings when you omit this parameter. - Allowed values: `visual`, `audio`, `transcription`, `visual-text` ## Response ### 200 Video embeddings have successfully been retrieved. - `_id` (string, optional) — The unique identifier of the video embedding task. - `model_name` (string, optional) — The name of the video understanding model the platform used to create the embedding. - `status` (string, optional) — A string indicating the status of the video indexing task. It can take one of the following values: `processing`, `ready` or `failed`. - `created_at` (string, optional) — A string representing the date and time, in RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the resource was created. - `updated_at` (string, optional) — A string representing the date and time, in RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the resource was last updated. - `video_embedding` (EmbedTasksTaskIdGetResponsesContentApplicationJsonSchemaVideoEmbedding, optional) — An object containing the metadata associated with the embedding. ## Errors ### 400 Bad Request Error The request has failed. - `code` (string, optional) — A string representing the code associated with the error. See the [Error codes](/v1.3/api-reference/error-codes) page for details. - `message` (string, optional) — A human-readable string describing the error, intended to be suitable for display in a user interface. ## Types ### EmbedTasksTaskIdGetResponsesContentApplicationJsonSchemaVideoEmbedding An object containing the metadata associated with the embedding. - `metadata` (VideoEmbeddingMetadata, optional) — An object containing metadata associated with the embedding. - `segments` (list of VideoSegment, optional) — An array of objects containing the embeddings for each video segment and the associated information. ### VideoEmbeddingMetadata An object containing metadata associated with the embedding. - `input_url` (string, optional) — The URL of the media file used to generate the embedding. Present if a URL was provided in the request. - `input_filename` (string, optional) — The name of the media file used to generate the embedding. Present if a file was provided in the request. - `video_clip_length` (double, optional) — The duration for each clip in seconds, as specified in the request. Note that the platform automatically truncates video segments shorter than 2 seconds. For a 31-second video divided into 6-second segments, the final 1-second segment will be truncated. This truncation only applies to the last segment if it does not meet the minimum length requirement of 2 seconds. - `video_embedding_scope` (list of string, optional) — The scope you've specified in the request. - `video_embedding_option` (list of string, optional) — The `embedding_option` values used to generate the embedding. - `duration` (double, optional) — The total duration of the video in seconds. ### VideoSegment An object that contains the video embedding and its start time. Each segment is between 2 and 10 seconds. - `float` (list of double, optional) — An array of floating point numbers representing the embedding. You can use this array with cosine similarity for various downstream tasks. Note that the example response was truncated for brevity. - `start_offset_sec` (double, optional) — The start time in seconds from the beginning of the file. - `end_offset_sec` (double, optional) — The end time in seconds from the beginning of the file. - `embedding_option` (string, optional) — The type of the embedding. - `embedding_scope` (string, optional) — The scope of the video embedding. ## Examples **Response** ```json { "_id": "663e16ac4d11aff765088b3a", "model_name": "marengo3.0", "status": "ready", "created_at": "2024-03-01T00:00:00Z", "video_embedding": { "metadata": { "input_filename": "01.mp4", "video_clip_length": 6, "video_embedding_scope": [ "clip", "video" ], "duration": 18 }, "segments": [ { "float": [ -0.060086973, 0.016479108 ], "start_offset_sec": 0, "end_offset_sec": 6, "embedding_option": "visual", "embedding_scope": "clip" }, { "float": [ -0.056660935, 0.012404642 ], "start_offset_sec": 6, "end_offset_sec": 12, "embedding_option": "visual", "embedding_scope": "clip" }, { "float": [ -0.05971131, -0.00859428 ], "start_offset_sec": 0, "end_offset_sec": 12, "embedding_option": "visual", "embedding_scope": "video" }, { "float": [ -0.060086973, 0.016479108 ], "start_offset_sec": 0, "end_offset_sec": 6, "embedding_option": "audio", "embedding_scope": "clip" }, { "float": [ -0.056660935, 0.012404642 ], "start_offset_sec": 6, "end_offset_sec": 12, "embedding_option": "audio", "embedding_scope": "clip" }, { "float": [ -0.05971131, -0.00859428 ], "start_offset_sec": 12, "end_offset_sec": 18, "embedding_option": "audio", "embedding_scope": "clip" }, { "float": [ -0.05971131, -0.00859428 ], "start_offset_sec": 0, "end_offset_sec": 12, "embedding_option": "audio", "embedding_scope": "video" } ] } } ``` **SDK Code** ```python embed_tasks_retrieve_example import requests url = "https://api.twelvelabs.io/v1.3/embed/tasks/663da73b31cdd0c1f638a8e6" headers = {"x-api-key": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript embed_tasks_retrieve_example const url = 'https://api.twelvelabs.io/v1.3/embed/tasks/663da73b31cdd0c1f638a8e6'; const options = {method: 'GET', headers: {'x-api-key': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go embed_tasks_retrieve_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.twelvelabs.io/v1.3/embed/tasks/663da73b31cdd0c1f638a8e6" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-api-key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby embed_tasks_retrieve_example require 'uri' require 'net/http' url = URI("https://api.twelvelabs.io/v1.3/embed/tasks/663da73b31cdd0c1f638a8e6") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-api-key"] = '' response = http.request(request) puts response.read_body ``` ```java embed_tasks_retrieve_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.twelvelabs.io/v1.3/embed/tasks/663da73b31cdd0c1f638a8e6") .header("x-api-key", "") .asString(); ``` ```php embed_tasks_retrieve_example request('GET', 'https://api.twelvelabs.io/v1.3/embed/tasks/663da73b31cdd0c1f638a8e6', [ 'headers' => [ 'x-api-key' => '', ], ]); echo $response->getBody(); ``` ```csharp embed_tasks_retrieve_example using RestSharp; var client = new RestClient("https://api.twelvelabs.io/v1.3/embed/tasks/663da73b31cdd0c1f638a8e6"); var request = new RestRequest(Method.GET); request.AddHeader("x-api-key", ""); IRestResponse response = client.Execute(request); ``` ```swift embed_tasks_retrieve_example import Foundation let headers = ["x-api-key": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.twelvelabs.io/v1.3/embed/tasks/663da73b31cdd0c1f638a8e6")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```