> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fastpix.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fastpix.com/docs/_mcp/server.

# Get all clips of a media

GET https://api.fastpix.com/v1/on-demand/{mediaId}/media-clips

This endpoint retrieves a list of all media clips associated with a given source media ID. It helps you organize and manage media efficiently by providing metadata such as clip media IDs and other relevant details.

A media clip is a segmented portion of an original media file (source media). Clips are often created for various purposes such as previews, highlights, or customized edits. This API allows you to fetch all such clips linked to a specific source media, making it easier to track and manage clips.

#### How it works

* The endpoint returns metadata for all media clips associated with the given `mediaId`.
* Results are paginated to efficiently handle large datasets.
* Each entry includes detailed metadata such as media `id`, `duration`, and `status`.
* Helps in organizing clips effectively by providing structured information.

#### Example

Imagine you’re managing a video editing platform where users upload full-length videos and create short clips for social media sharing. To keep track of all clips linked to a particular video, you call this API with the sourceMediaId. The response provides a list of all associated clips, allowing you to manage, edit, or repurpose them as needed.

Related guide: Create clips from existing media

Reference: https://fastpix.com/docs/video-on-demand-api/manage-videos/get-media-clips

## Authentication

- `Authorization` header (basic auth, required) — FastPix APIs are secured with Basic Authentication. Use your Access Token ID as the username and Secret Key as the password in the Authorization header of each API request. * Username: Access Token ID * Password: Secret Key Activate your FastPix account to generate your API credentials. See the guide here

## Request

### Path parameters

- `mediaId` (string, required) — The unique identifier assigned to the media when created. The value must be a valid UUID.

### Query parameters

- `offset` (integer, optional, default: 1) — Offset determines the starting point for data retrieval within a paginated list.
- `limit` (integer, optional, default: 10) — The number of media clips to retrieve per request.
- `orderBy` (enum, optional, default: desc) — The values in the list can be arranged in two ways DESC (Descending) or ASC (Ascending).
  - Allowed values: `asc`, `desc`

## Response

### 200

Get media clips

- `success` (boolean, optional) — Shows the request status. Returns true for success and false for failure.
- `data` (list of MediaClipResponseDataItems, optional)
- `pagination` (MediaClipResponsePagination, optional)

## Types

### MediaClipResponseDataItems

- `id` (string, optional) — The unique identifier assigned to the media by FastPix.
- `duration` (double, optional) — Duration of the media in seconds.
- `status` (enum, optional) — The current processing status of the media.
  - Allowed values: `Created`, `Downloading`, `Downloaded`, `Validating`, `In Queue`, `Processing`, `Ready`, `Failed`
- `thumbnail` (string, optional) — A video thumbnail that acts as a preview image for the video.
- `createdAt` (datetime, optional) — Timestamp of when the media was created.
- `playbackIds` (list of MediaClipResponseDataItemsPlaybackIdsItems, optional)

### MediaClipResponsePagination

- `totalRecords` (integer, optional) — Total number of records available.
- `currentOffset` (integer, optional) — The starting offset of the current result set.
- `offsetCount` (integer, optional) — The number of items returned in the current response.

### MediaClipResponseDataItemsPlaybackIdsItems

- `id` (string, optional) — The unique identifier for playback.
- `accessPolicy` (string, optional) — The access policy of the playback.

## Examples

**Response**

```json
{
  "success": true,
  "data": [
    {
      "id": "b62427ec-07fd-4a89-b3c0-94909aaaa1da",
      "duration": 13.5,
      "status": "Ready",
      "thumbnail": "https://images.fastpix.app/66dc7b0b-9dfb-4721-a738-837f89ccbd0a/thumbnail.png",
      "createdAt": "2025-03-12T06:17:26.403017Z",
      "playbackIds": [
        {
          "id": "66dc7b0b-9dfb-4721-a738-837f89ccbd0a",
          "accessPolicy": "public"
        }
      ]
    }
  ],
  "pagination": {
    "totalRecords": 4,
    "currentOffset": 1,
    "offsetCount": 4
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.fastpix.com/v1/on-demand/fc733e3f-2fba-4c3d-9388-2511dc50d15f/media-clips"

response = requests.get(url, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://api.fastpix.com/v1/on-demand/fc733e3f-2fba-4c3d-9388-2511dc50d15f/media-clips';
const credentials = btoa("<username>:<password>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.fastpix.com/v1/on-demand/fc733e3f-2fba-4c3d-9388-2511dc50d15f/media-clips"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<password>")

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

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

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

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.fastpix.com/v1/on-demand/fc733e3f-2fba-4c3d-9388-2511dc50d15f/media-clips")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.fastpix.com/v1/on-demand/fc733e3f-2fba-4c3d-9388-2511dc50d15f/media-clips")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.fastpix.com/v1/on-demand/fc733e3f-2fba-4c3d-9388-2511dc50d15f/media-clips', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.fastpix.com/v1/on-demand/fc733e3f-2fba-4c3d-9388-2511dc50d15f/media-clips");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fastpix.com/v1/on-demand/fc733e3f-2fba-4c3d-9388-2511dc50d15f/media-clips")! 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()
```