0

List updated content

by
Published Oct 17, 2025

This endpoint lists editorial images 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 date_updated_start and date_updated_end parameters to specify a range updates based on when the updates happened. You can also use the date_taken_start and date_taken_end parameters to specify a range of updates based on when the image was taken.

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 content
7
 * This endpoint lists editorial images 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 date_updated_start and date_updated_end parameters to specify a range updates based on when the updates happened. You can also use the date_taken_start and date_taken_end parameters to specify a range of updates based on when the image was taken.
8
 */
9
export async function main(
10
  auth: Shutterstock,
11
  _type: "edit" | "addition" | undefined,
12
  date_updated_start: string | undefined,
13
  date_updated_end: string | undefined,
14
  date_taken_start: string | undefined,
15
  date_taken_end: string | undefined,
16
  cursor: string | undefined,
17
  sort: "newest" | "oldest" | undefined,
18
  supplier_code: string | undefined,
19
  country: string | undefined,
20
  per_page: string | undefined,
21
) {
22
  const url = new URL(
23
    `https://api.shutterstock.com/v2/editorial/images/updated`,
24
  );
25
  for (const [k, v] of [
26
    ["type", _type],
27
    ["date_updated_start", date_updated_start],
28
    ["date_updated_end", date_updated_end],
29
    ["date_taken_start", date_taken_start],
30
    ["date_taken_end", date_taken_end],
31
    ["cursor", cursor],
32
    ["sort", sort],
33
    ["supplier_code", supplier_code],
34
    ["country", country],
35
    ["per_page", per_page],
36
  ]) {
37
    if (v !== undefined && v !== "" && k !== undefined) {
38
      url.searchParams.append(k, v);
39
    }
40
  }
41
  const response = await fetch(url, {
42
    method: "GET",
43
    headers: {
44
      Authorization: "Bearer " + auth.token,
45
    },
46
    body: undefined,
47
  });
48
  if (!response.ok) {
49
    const text = await response.text();
50
    throw new Error(`${response.status} ${text}`);
51
  }
52
  return await response.json();
53
}
54