0

List updated videos

by
Published Oct 17, 2025

This endpoint lists videos that have been updated in the specified time period to update content management systems (CMS) or digital asset management (DAM) systems. In most cases, use the `interval` parameter to show videos that were updated recently, but you can also use the `start_date` and `end_date` parameters to specify a range of no more than three days. Do not use the `interval` parameter with either `start_date` or `end_date`.

Script shutterstock Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Shutterstock = {
3
  token: string;
4
};
5
/**
6
 * List updated videos
7
 * This endpoint lists videos that have been updated in the specified time period to update content management systems (CMS) or digital asset management (DAM) systems. In most cases, use the `interval` parameter to show videos that were updated recently, but you can also use the `start_date` and `end_date` parameters to specify a range of no more than three days. Do not use the `interval` parameter with either `start_date` or `end_date`.
8
 */
9
export async function main(
10
  auth: Shutterstock,
11
  start_date: string | undefined,
12
  end_date: string | undefined,
13
  interval: string | undefined,
14
  page: string | undefined,
15
  per_page: string | undefined,
16
  sort: "newest" | "oldest" | undefined,
17
) {
18
  const url = new URL(`https://api.shutterstock.com/v2/videos/updated`);
19
  for (const [k, v] of [
20
    ["start_date", start_date],
21
    ["end_date", end_date],
22
    ["interval", interval],
23
    ["page", page],
24
    ["per_page", per_page],
25
    ["sort", sort],
26
  ]) {
27
    if (v !== undefined && v !== "" && k !== undefined) {
28
      url.searchParams.append(k, v);
29
    }
30
  }
31
  const response = await fetch(url, {
32
    method: "GET",
33
    headers: {
34
      Authorization: "Bearer " + auth.token,
35
    },
36
    body: undefined,
37
  });
38
  if (!response.ok) {
39
    const text = await response.text();
40
    throw new Error(`${response.status} ${text}`);
41
  }
42
  return await response.json();
43
}
44