> ## 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.

# SearchAPI database

> SearchAPI local sync in Corsair: the entities stored in your database, the `.search()` filters each one accepts, and the filter operators.

The SearchAPI plugin syncs data locally. Use `corsair.searchapi.db.<entity>.search({ data, limit?, offset? })` with the filters listed per entity.

> [!NOTE]
>
> **New to Corsair?** See [database operations](https://docs.corsair.dev/concepts/database.md), [data synchronization](https://docs.corsair.dev/concepts/integrations.md), and [multi-tenancy](https://docs.corsair.dev/concepts/multi-tenancy.md).

## Accounts

Path: `searchapi.db.accounts.search`

```ts theme={null}
const rows = await corsair.searchapi.db.accounts.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `id` | `string` | equals, contains, startsWith, endsWith, in |
| `currentMonthUsage` | `number` | equals, gt, gte, lt, lte, in |
| `monthlyAllowance` | `number` | equals, gt, gte, lt, lte, in |
| `remainingCredits` | `number` | equals, gt, gte, lt, lte, in |
| `remainingSearches` | `number` | equals, gt, gte, lt, lte, in |
| `searchesThisHour` | `number` | equals, gt, gte, lt, lte, in |
| `hourlyRateLimit` | `number` | equals, gt, gte, lt, lte, in |
| `periodStart` | `string` | equals, contains, startsWith, endsWith, in |
| `periodEnd` | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](https://docs.corsair.dev/concepts/database.md).*

***

## Locations

Path: `searchapi.db.locations.search`

```ts theme={null}
const rows = await corsair.searchapi.db.locations.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `id` | `string` | equals, contains, startsWith, endsWith, in |
| `name` | `string` | equals, contains, startsWith, endsWith, in |
| `canonicalName` | `string` | equals, contains, startsWith, endsWith, in |
| `countryCode` | `string` | equals, contains, startsWith, endsWith, in |
| `targetType` | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](https://docs.corsair.dev/concepts/database.md).*

***

## Searches

Path: `searchapi.db.searches.search`

```ts theme={null}
const rows = await corsair.searchapi.db.searches.search({
    data: { /* filters below */ },
    limit: 100,
    offset: 0,
});
```

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `id` | `string` | equals, contains, startsWith, endsWith, in |
| `status` | `string` | equals, contains, startsWith, endsWith, in |
| `engine` | `string` | equals, contains, startsWith, endsWith, in |

*Every `.search()` also accepts `limit` and `offset` for pagination. `.list()` is available on the same path without the `.search` suffix in code — see [database operations](https://docs.corsair.dev/concepts/database.md).*

***


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