> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Scraper Cloud API reference

> API reference for Web Scraper Cloud: every `webscraperio.api.*` operation with input and output types.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Account

### get

`account.get`

Read the account user and the page credits left; the cheapest way to check a token

**Risk:** `read`

```ts theme={null}
await corsair.webscraperio.api.account.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   email?: string | null,
>   firstname?: string | null,
>   lastname?: string | null,
>   page_credits?: number | null
> } | null
> ```

***

## Sitemaps

### create

`sitemaps.create`

Create a sitemap from the definition the browser extension exports, selectors included

**Risk:** `write`

```ts theme={null}
await corsair.webscraperio.api.sitemaps.create({ sitemap: { _id: 'product_catalogue', startUrl: ['https://acme.example/products'], selectors: [{ id: 'name', parentSelectors: ['_root'], type: 'SelectorText', selector: 'h1.title', multiple: false }] } });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `sitemap` | `Record<string, any>` | Yes | The sitemap definition in the form the browser extension exports: `_id`, `startUrl` (an array of URLs) and `selectors`. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   name?: string | null,
>   sitemap?: string | null
> } | null
> ```

***

### get

`sitemaps.get`

Read one sitemap: its id, name and definition (start URLs and selectors) as a JSON string

**Risk:** `read`

```ts theme={null}
await corsair.webscraperio.api.sitemaps.get({ id: 42 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | The sitemap id, from sitemaps.list. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `data` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   name?: string | null,
>   sitemap?: string | null
> } | null
> ```

***

### list

`sitemaps.list`

List the sitemaps on the account (id and name), a page at a time, optionally filtered by tag

**Risk:** `read`

```ts theme={null}
await corsair.webscraperio.api.sitemaps.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `page` | `number` | No | The page to return, 1-based. Defaults to 1. |
| `tag` | `string` | No | Only return sitemaps carrying this tag. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `data` | `object[] \| null` | No | — |
| `current_page` | `number \| null` | No | — |
| `last_page` | `number \| null` | No | — |
| `total` | `number \| null` | No | — |
| `per_page` | `number \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   name?: string | null,
>   sitemap?: string | null
> }[] | null
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.