> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudglue.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Structured Data Extraction

> Turn your videos into structured data

## Quick Start

First, make sure you have Cloudglue set up by following the [setup guide](/getting-started/setup-cloudglue).

## Extract Structured Data

Using Cloudglue's Extract API, transform your video content into programmable, structured data that you can easily integrate into your applications. In this guide, we'll demonstrate a simple schema that extracts basic concepts like people, objects, and locations - but you can define any custom schema that matches your specific needs and downstream applications.

<Tabs>
  <Tab title="Python" value="python">
    ```python theme={null}
    from cloudglue import Cloudglue

    # Initialize client (API key will be loaded from environment)
    client = Cloudglue()

    # Upload your video file
    uploaded = client.files.upload(
        'path/to/local/video.mp4',
        wait_until_finish=True
    )

    # Define the extraction schema
    schema = {
        "people": ["string"],
        "objects": ["string"],
        "locations": ["string"]
    }

    # Start extraction using the uploaded file URI
    extraction = client.extract.run(
        url=uploaded.uri,
        prompt="Extract all people, notable objects, and locations that appear in this video",
        schema=schema,
    )

    # Print the results
    print(extraction.data)
    ```

    For more details about the Python SDK, check out our [Python SDK Documentation](/sdks/python).
  </Tab>

  <Tab title="Node" value="node">
    ```typescript theme={null}
    /// <reference lib="dom" />

    import { Cloudglue } from '@cloudglue/cloudglue-js';
    import * as fs from 'fs';
    import * as path from 'path';

    const client = new Cloudglue();
    const filePath = 'path/to/video.mp4';

    // Read and prepare file for upload
    const fileBuffer = await fs.promises.readFile(filePath);
    const file = new File([fileBuffer], path.basename(filePath));

    // Upload and wait for file processing
    const uploadResult = await client.files.uploadFile({ file });
    const fileDetails = await client.files.waitForReady(uploadResult.data.id);

    // Define the extraction schema
    const schema = {
      people: ["string"],
      objects: ["string"],
      locations: ["string"]
    };

    // Start extraction and wait for completion
    const job = await client.extract.createExtract(
      fileDetails.uri,
      {
        prompt: "Extract all people, notable objects, and locations that appear in this video",
        schema: schema
      }
    );
    const extractJob = await client.extract.waitForReady(job.job_id);

    console.log(extractJob.data);
    ```

    For more details about the Node.js SDK, check out our [JavaScript SDK Documentation](/sdks/javascript).
  </Tab>
</Tabs>

For more detailed examples and advanced usage, check out our [API Reference](/api-reference/endpoint/extract/post).
