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

# Analyze

> Extract insights and summaries from rich-media content

### Overview

The Analyze API extracts meaningful insights, summaries, and custom information from video and audio content across major social media platforms.
Simply provide a media URL and a question about the content, and the API will analyze the visual elements (if applicable) and transcriptions to deliver key takeaways and structured insights.

### Features

* **Markdown Format**: Receive analysis in formatted markdown, ideal for LLM applications.
* **Video Summaries**: Generate concise summaries of video content for quick insights.
* **Custom Queries**: Ask specific questions about the content to extract relevant information.
* **Brand Detection**: Automatically identify brands displayed or mentioned in the content.
* **Full Transcription**: Includes transcription and all its features for deeper analysis.
* **Platform Metadata**: Optionally retrieve media metrics such as upload time, like count, comment count,and thumbnail URL.
* **Webhook Support**: Get real-time notifications when the analysis is complete.

### Basic Usage

To analyze content, simply add the media URL to the `post_url` parameter. You can optionally include a `query` to ask specific questions about the content, and a `callback_url` to receive notifications when the analysis is complete.

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.scribesocial.ai/v1/analyze \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
    "post_url": "<string>",
    "callback_url": "<string>",
    "query": null
  }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.scribesocial.ai/v1/analyze"

  payload = {
      "post_url": "<string>",
      "callback_url": "<string>",
      "query": None
  }
  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.request("POST", url, json=payload, headers=headers)

  print(response.text)
  ```

  ```javascript JavaScript theme={null}
  const options = {
    method: 'POST',
    headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
    body: '{"post_url":"<string>","callback_url":"<string>","query":null}'
  };

  fetch('https://api.scribesocial.ai/v1/analyze', options)
    .then(response => response.json())
    .then(response => console.log(response))
    .catch(err => console.error(err));
  ```

  ```php PHP theme={null}
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.scribesocial.ai/v1/analyze",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{\n  \"post_url\": \"<string>\",\n  \"callback_url\": \"<string>\",\n  \"query\": null\n}",
    CURLOPT_HTTPHEADER => [
      "Authorization: Bearer <token>",
      "Content-Type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"strings"
  	"net/http"
  	"io/ioutil"
  )

  func main() {
  	url := "https://api.scribesocial.ai/v1/analyze"

  	payload := strings.NewReader("{\n  \"post_url\": \"<string>\",\n  \"callback_url\": \"<string>\",\n  \"query\": null\n}")

  	req, _ := http.NewRequest("POST", url, payload)

  	req.Header.Add("Authorization", "Bearer <token>")
  	req.Header.Add("Content-Type", "application/json")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.post("https://api.scribesocial.ai/v1/analyze")
    .header("Authorization", "Bearer <token>")
    .header("Content-Type", "application/json")
    .body("{\n  \"post_url\": \"<string>\",\n  \"callback_url\": \"<string>\",\n  \"query\": null\n}")
    .asString();
  ```
</CodeGroup>

#### Checking Analysis Status (Async Only)

If you're using a `callback_url`, the API response will include a `Location` header containing the operation polling URL, which you can use to check the status of the analysis.

Example Operation Polling URL: `https://api.scribesocial.ai/v1/transcribe-result/{operation-id}`

When the callback request is sent to your endpoint, it will include a `Scribe-Verification-Token` header.
This token corresponds to the API key ID used for the original request, allowing you to verify that the callback is coming from dScribe AI and is legitimate.

### Example Response

```json theme={null}
{
  "status": "completed",
  "operation_id": "abc123xyz789",
  "data": [
    {
      "video_summary": "In this video, the speaker provides a comprehensive introduction to machine learning fundamentals, covering basic concepts and practical applications in the healthcare industry...",
      "query_result": {
        "answer": "The main topics discussed are: 1) Introduction to ML concepts, 2) Healthcare applications, 3) Implementation challenges, 4) Future trends"
      },
      "detected_brands": [
        {
          "name": "TensorFlow",
          "description": "An open-source machine learning framework"
        },
        {
          "name": "PyTorch",
          "description": "Deep learning framework developed by Meta AI"
        }
      ],
      "video_url": "https://www.youtube.com/watch?v=example1",
      "post_url": "https://www.youtube.com/watch?v=example1",
      "description": "Part 1 of the machine learning tutorial series",
      "transcription": "Welcome to part one of our machine learning series...",
      "paragraphs": [
        {
          "sentences": [
            {
              "text": "Welcome to part one of our machine learning series.",
              "start": 0,
              "end": 3.2
            },
            {
              "text": "Today we'll cover the fundamental concepts.",
              "start": 3.2,
              "end": 6.5
            }
          ],
          "num_words": 18,
          "start": 0,
          "end": 6.5
        }
      ],
      "video_id": "example1",
      "transcribed_duration": 180,
      "total_duration": 180,
      "status": "completed",
      "platform": "youtube",
      "title": "Machine Learning Fundamentals - Part 1",
      "metadata": {
        "upload_time": "2024-01-15T10:30:00Z",
        "comment_count": 423,
        "like_count": 892,
        "thumbnail": "https://i.ytimg.com/vi/example1/maxresdefault.jpg",
        "retweet_count": null,
        "quote_count": null
      }
    }
  ],
  "markdown": "# Machine Learning Fundamentals - Part 1\n\n## Introduction (00:00)\nWelcome to part one of our machine learning series...\n\n## Key Concepts (01:23)\nLet's discuss the fundamental principles..."
}
```

For more details about request parameters, response fields, and status codes, check out our [Analyze API Reference](/api-reference/endpoint/analyze).

### Common Use Cases

1. **LLM Applications**: Enrich LLMs with structured visual insights and transcriptions to improve contextual understanding, retrieval, and summarization.
2. **Social Listening & Brand Monitoring**: Track brand mentions, logos, and product placements in both video frames and spoken dialogue, enabling deeper sentiment and trend analysis.
3. **Content Intelligence & Analysis**: Extract structured insights from visual elements and spoken words, categorizing information for better decision-making.
4. **Content Indexing & Searchability**: Make video and audio content searchable by generating transcriptions and tagging visual elements such as objects, faces, and text overlays.
5. **Compliance & Moderation**: Ensure compliance by analyzing both visual and audio content for policy violations, explicit material, and copyright concerns.
6. **Custom Queries & Deep Video Understanding**: Ask specific questions about both the visual and spoken content to extract targeted insights, such as identifying key moments, detecting logos, or summarizing actions.
