0

List available services

by
Published Oct 17, 2025

Returns a paginated list of the services available to you, for all Linode regions. > 📘 > > Only authorized users can run this operation. > --- - __CLI__. ``` linode-cli account get-availability ``` [Learn more...](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-the-linode-cli) - __OAuth scopes__. ``` account:read_only ``` [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)

Script linode Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Linode = {
3
  token: string;
4
};
5
/**
6
 * List available services
7
 * Returns a paginated list of the services available to you, for all Linode regions.
8

9
> 📘
10
>
11
> Only authorized users can run this operation.
12

13

14
>
15

16
---
17

18

19
- __CLI__.
20

21
    ```
22
    linode-cli account get-availability
23
    ```
24

25
    [Learn more...](https://techdocs.akamai.com/cloud-computing/docs/getting-started-with-the-linode-cli)
26

27
- __OAuth scopes__.
28

29
    ```
30
    account:read_only
31
    ```
32

33
    [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)
34
 */
35
export async function main(
36
  auth: Linode,
37
  apiVersion: "v4" | "v4beta",
38
  page: string | undefined,
39
  page_size: string | undefined,
40
) {
41
  const url = new URL(
42
    `https://api.linode.com/${apiVersion}/account/availability`,
43
  );
44
  for (const [k, v] of [
45
    ["page", page],
46
    ["page_size", page_size],
47
  ]) {
48
    if (v !== undefined && v !== "" && k !== undefined) {
49
      url.searchParams.append(k, v);
50
    }
51
  }
52
  const response = await fetch(url, {
53
    method: "GET",
54
    headers: {
55
      Authorization: "Bearer " + auth.token,
56
    },
57
    body: undefined,
58
  });
59
  if (!response.ok) {
60
    const text = await response.text();
61
    throw new Error(`${response.status} ${text}`);
62
  }
63
  return await response.json();
64
}
65