0

License sound effects

by
Published Oct 17, 2025

This endpoint licenses sounds effect assets.

Script shutterstock Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Shutterstock = {
3
  token: string;
4
};
5
/**
6
 * License sound effects
7
 * This endpoint licenses sounds effect assets.
8
 */
9
export async function main(
10
  auth: Shutterstock,
11
  body: {
12
    sound_effects: {
13
      sfx_id: string;
14
      audio_layout?: "ambisonic" | "5.1" | "stereo";
15
      format?: "wav" | "mp3";
16
      search_id?: string;
17
      subscription_id: string;
18
    }[];
19
  },
20
) {
21
  const url = new URL(`https://api.shutterstock.com/v2/sfx/licenses`);
22

23
  const response = await fetch(url, {
24
    method: "POST",
25
    headers: {
26
      "Content-Type": "application/json",
27
      Authorization: "Bearer " + auth.token,
28
    },
29
    body: JSON.stringify(body),
30
  });
31
  if (!response.ok) {
32
    const text = await response.text();
33
    throw new Error(`${response.status} ${text}`);
34
  }
35
  return await response.json();
36
}
37