0

Get Quota

by
Published Oct 17, 2025

Get quota information for the given subscription type. This includes the maximum number of subscriptions that can be active this month, the current total number of active subscriptions and the remaining amount that can be created this month. To get quota information regarding the deletion of subscriptions, please reach out to [email protected]

Script yelp Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Yelp = {
3
  apiKey: string;
4
};
5
/**
6
 * Get Quota
7
 * Get quota information for the given subscription type.
8
This includes the maximum number of subscriptions that can be active this month, the current total number of active subscriptions and the remaining amount that can be created this month.
9
To get quota information regarding the deletion of subscriptions, please reach out to partner-support@yelp.com
10

11
 */
12
export async function main(
13
  auth: Yelp,
14
  quota_subscription_type: "YELP_KNOWLEDGE",
15
) {
16
  const url = new URL(
17
    `https://api.yelp.com/v3/businesses//subscriptions/${quota_subscription_type}/quota`,
18
  );
19

20
  const response = await fetch(url, {
21
    method: "GET",
22
    headers: {
23
      Authorization: "Bearer " + auth.apiKey,
24
    },
25
    body: undefined,
26
  });
27
  if (!response.ok) {
28
    const text = await response.text();
29
    throw new Error(`${response.status} ${text}`);
30
  }
31
  return await response.json();
32
}
33