# Inspect an asset

> GET /api/v1/projects/{id}/media/{asset_id}: Inspect an asset

Source: https://stuarty.com/docs/api/media.inspect/

## Authentication

Send the secret in the header `Authorization: Bearer <secret>`: the local token in local mode, an [API key](/docs/self-hosting/api-keys) in network mode. An API key needs the `read` scope; the local token has every scope. See the [API overview](/docs/api/overview) for both modes.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | min length 1 |
| `asset_id` | `string` | yes | min length 1 |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `timeline_id` | `string` | no | The timeline of the project; required when the project has several. |
| `sections` | `string` | no | Comma separated: probe (default), transcript, silences, loudness, beats. |
| `min_silence` | `string` | no | The shortest silence to list, as a time; default 0.4s. |
| `cursor` | `string` | no | The next_cursor of the previous page. |
| `limit` | `integer` | no | The page size; the default depends on the operation. |

## Responses

### 200 OK

Content type `application/json`. Schema: [`MediaInspectResult`](/docs/api/schemas#mediainspectresult).

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `asset_id` | `string` | no |  |
| `available` | array of `string` | no |  |
| `beats` | [`BeatGrid`](/docs/api/schemas#beatgrid) or `any` or `null` or `null` | no |  |
| `error` | [`Error`](/docs/api/schemas#error) or `any` or `null` or `null` | no |  |
| `fillers` | [`TranscriptDetectResult`](/docs/api/schemas#transcriptdetectresult) or `any` or `null` or `null` | no |  |
| `kind` | `string` | no |  |
| `loudness` | [`Loudness`](/docs/api/schemas#loudness) or `any` or `null` or `null` | no |  |
| `next_cursor` | `string` or `null` | no |  |
| `probe` | [`ProbeSummary`](/docs/api/schemas#probesummary) or `any` or `null` or `null` | no |  |
| `progress` | `number (double)` | no |  |
| `silences` | array of [`TimeRange`](/docs/api/schemas#timerange) | no |  |
| `state` | `string` | no |  |
| `strip` | [`Strip`](/docs/api/schemas#strip) or `any` or `null` or `null` | no |  |
| `text` | `string` | no |  |
| `untrusted` | [`UntrustedData`](/docs/api/schemas#untrusteddata) or `any` or `null` or `null` | no |  |
| `untrusted_notice` | `string` | no |  |
| `words` | [`TranscriptViewResult`](/docs/api/schemas#transcriptviewresult) or `any` or `null` or `null` | no |  |
| `zooms` | array of [`ClipZoom`](/docs/api/schemas#clipzoom) | no |  |

### 400

Validation failed; errors maps each field to its messages and issues lists each problem with its code, key and params

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### 401 Unauthorized

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### 403

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### 404

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### 429

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

### Any other status

Error (RFC 9457 problem details)

Content type `application/problem+json`. Schema: [`Problem`](/docs/api/schemas#problem).

```bash
curl -X GET "http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/media/ASSET_ID" \
  -H "Authorization: Bearer $STUARTY_KEY"
```

```python
import os

import requests

response = requests.get(
    "http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/media/ASSET_ID",
    headers={"Authorization": f"Bearer {os.environ['STUARTY_KEY']}"},
    timeout=30,
)
response.raise_for_status()
print(response.json())
```

```javascript
const response = await fetch("http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/media/ASSET_ID", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.STUARTY_KEY}`,
  },
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log(await response.json());
```

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	url := "http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/media/ASSET_ID"
	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("STUARTY_KEY"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, err := io.ReadAll(res.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(res.Status, string(out))
}
```

```php
<?php

$ch = curl_init("http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/media/ASSET_ID");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("STUARTY_KEY"),
    ],
]);

$response = curl_exec($ch);
if ($response === false) {
    throw new RuntimeException(curl_error($ch));
}
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;
```

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/media/ASSET_ID"))
            .header("Authorization", "Bearer " + System.getenv("STUARTY_KEY"))
            .GET()
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}
```

```csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;

using var client = new HttpClient();
using var request = new HttpRequestMessage(
    HttpMethod.Get, "http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/media/ASSET_ID");
request.Headers.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("STUARTY_KEY"));

using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```

```ruby
require "net/http"
require "uri"

uri = URI("http://127.0.0.1:7878/api/v1/projects/PROJECT_ID/media/ASSET_ID")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch('STUARTY_KEY')}"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
puts "#{response.code} #{response.body}"
```

**Response examples**

```json
{
  "asset_id": "string",
  "available": [
    "string"
  ],
  "beats": {
    "confidence": 0,
    "count": 0,
    "first_ms": [
      0
    ],
    "reason": "string",
    "tempo_bpm": 0
  },
  "error": {
    "code": "string",
    "details": {},
    "hint": "string",
    "message": "string",
    "op_index": 0,
    "path": "string",
    "retryable": false
  },
  "fillers": {
    "asset_id": "string",
    "filler_rules": false,
    "language": "string",
    "project_id": "string",
    "revision": 0,
    "rule": "string",
    "suggestions": [
      {}
    ],
    "text": "string",
    "untrusted_notice": "string"
  },
  "kind": "string",
  "loudness": {
    "integrated_lufs": 0,
    "range_lu": 0,
    "true_peak_dbtp": 0
  },
  "next_cursor": "string",
  "probe": {
    "animated": false,
    "audio_codec": "string",
    "channels": 0,
    "container": "string",
    "duration": {
      "frame": 0,
      "seconds": 0
    },
    "frame_rate": "string",
    "frames": 0,
    "has_audio": false,
    "height": 0,
    "kind": "string",
    "loop_duration_ms": 0,
    "sample_rate": 0,
    "size_bytes": 0,
    "video_codec": "string",
    "width": 0
  },
  "progress": 0,
  "silences": [
    {
      "end": {},
      "start": {}
    }
  ],
  "state": "string",
  "strip": {
    "columns": 0,
    "count": 0,
    "interval_ms": 0,
    "tile_h": 0,
    "tile_w": 0
  },
  "text": "string",
  "untrusted": {
    "metadata": {},
    "name": "string",
    "suggestions": [
      {}
    ],
    "transcript": [
      {}
    ],
    "words": [
      {}
    ]
  },
  "untrusted_notice": "string",
  "words": {
    "asset_id": "string",
    "language": "string",
    "project_id": "string",
    "revision": 0,
    "skipped_items": [
      "string"
    ],
    "text": "string",
    "untrusted_notice": "string",
    "words": [
      {}
    ]
  },
  "zooms": [
    {
      "end": {},
      "item_id": "string",
      "n": 0,
      "start": {}
    }
  ]
}
```

```json
{
  "code": "string",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "string",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "string",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 0,
  "title": "string",
  "type": "string"
}
```

```json
{
  "code": "E_UNAUTHORIZED",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "send the local token as Authorization: Bearer <token>, or run `stuarty open` to open the editor in a browser",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "the request carries no credentials.",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 401,
  "title": "string",
  "type": "string"
}
```

```json
{
  "code": "string",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "string",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "string",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 0,
  "title": "string",
  "type": "string"
}
```

```json
{
  "code": "string",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "string",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "string",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 0,
  "title": "string",
  "type": "string"
}
```

```json
{
  "code": "string",
  "detail": "string",
  "details": {},
  "errors": {},
  "hint": "string",
  "instance": "string",
  "issues": [
    {
      "code": "string",
      "key": "string",
      "message": "string",
      "on": "string",
      "params": {},
      "path": "string"
    }
  ],
  "message": "string",
  "op_index": 0,
  "path": "string",
  "request_id": "string",
  "retryable": false,
  "status": 0,
  "title": "string",
  "type": "string"
}
```

The examples are built from the schemas of the OpenAPI document, so a value is a placeholder of its type. The fields that carry the real values are in the tables.
