Skip to main content
User Community Portal
Question

Sorting list of videos based on size

  • March 13, 2025
  • 1 reply
  • 30 views

Forum|alt.badge.img

I want to fetch the list of all videos linked to my brightcove account and this list should be sorted based on size of the videos.

While going through brightcove API docs I came across this reference: https://apis.support.brightcove.com/cms/references/reference.html#tag/Videos/operation/GetVideos. As you can see over here, there’s no size based sort supported as a query param.

Is there a way to achieve this fetch or should I fetch the list of videos and sort it based on size info provided in the Digital master field?

1 reply

  • Employee
  • October 16, 2025

You're absolutely right in your interpretation of the Brightcove CMS API — the Get Videos endpoint does not support sorting by video size directly via query parameters.

Here's the best way to achieve your goal:

  1. Use the CMS API to fetch all videos
    Call:

     

    GET /v1/accounts/{account_id}/videos

    This returns basic metadata, but not file size info directly.

  2. For each video, fetch the digital master information
    To get the video file size, use:

     

    GET /v1/accounts/{account_id}/videos/{video_id}/assets/digital_master

    The response includes:

     

    { "size": 105472300, "duration": 3600000, ... }

    • size is in bytes

    • You can use this for sorting

  3. Sort videos locally by the size field once you’ve collected all digital master assets