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

# TwittrAPI database

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

The TwittrAPI plugin syncs data locally. Use `corsair.twittrapi.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).

## Communities

Path: `twittrapi.db.communities.search`

```ts theme={null}
const rows = await corsair.twittrapi.db.communities.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 |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt` | `string` | equals, contains, startsWith, endsWith, in |
| `memberCount` | `number` | equals, gt, gte, lt, lte, in |
| `moderatorCount` | `number` | equals, gt, gte, lt, lte, in |
| `joinPolicy` | `string` | equals, contains, startsWith, endsWith, in |
| `nsfw` | `boolean` | equals |
| `topic` | `string` | equals, contains, startsWith, endsWith, in |
| `bannerUrl` | `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).*

***

## Friendships

Path: `twittrapi.db.friendships.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `following` | `boolean` | equals |
| `followedBy` | `boolean` | equals |
| `canDm` | `boolean` | equals |
| `blocking` | `boolean` | equals |
| `blockedBy` | `boolean` | equals |
| `muting` | `boolean` | equals |

*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).*

***

## Lists

Path: `twittrapi.db.lists.search`

```ts theme={null}
const rows = await corsair.twittrapi.db.lists.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 |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt` | `string` | equals, contains, startsWith, endsWith, in |
| `memberCount` | `number` | equals, gt, gte, lt, lte, in |
| `followerCount` | `number` | equals, gt, gte, lt, lte, in |
| `private` | `boolean` | equals |
| `bannerUrl` | `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).*

***

## Monitored Accounts

Path: `twittrapi.db.monitoredAccounts.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `userId` | `string` | equals, contains, startsWith, endsWith, in |
| `username` | `string` | equals, contains, startsWith, endsWith, in |
| `state` | `string` | equals, contains, startsWith, endsWith, in |
| `stage` | `string` | equals, contains, startsWith, endsWith, in |
| `latencyClass` | `string` | equals, contains, startsWith, endsWith, in |
| `subscribedAt` | `string` | equals, contains, startsWith, endsWith, in |
| `monitoringSince` | `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).*

***

## Monitor Events

Path: `twittrapi.db.monitorEvents.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `event` | `string` | equals, contains, startsWith, endsWith, in |
| `id` | `string` | equals, contains, startsWith, endsWith, in |
| `monitoredUserId` | `string` | equals, contains, startsWith, endsWith, in |
| `tweetId` | `string` | equals, contains, startsWith, endsWith, in |
| `tweetCreatedAt` | `string` | equals, contains, startsWith, endsWith, in |
| `detectedAt` | `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).*

***

## Monitor Webhooks

Path: `twittrapi.db.monitorWebhooks.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `id` | `number` | equals, gt, gte, lt, lte, in |
| `url` | `string` | equals, contains, startsWith, endsWith, in |
| `label` | `string` | equals, contains, startsWith, endsWith, in |
| `secret` | `string` | equals, contains, startsWith, endsWith, in |
| `active` | `boolean` | equals |
| `failureCount` | `number` | equals, gt, gte, lt, lte, in |
| `disabledAt` | `string` | equals, contains, startsWith, endsWith, in |
| `disabledReason` | `string` | equals, contains, startsWith, endsWith, in |
| `lastSuccessAt` | `string` | equals, contains, startsWith, endsWith, in |
| `lastFailureAt` | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt` | `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).*

***

## Trend Locations

Path: `twittrapi.db.trendLocations.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `woeid` | `number` | equals, gt, gte, lt, lte, in |
| `name` | `string` | equals, contains, startsWith, endsWith, in |
| `country` | `string` | equals, contains, startsWith, endsWith, in |
| `countryCode` | `string` | equals, contains, startsWith, endsWith, in |
| `placeType` | `string` | equals, contains, startsWith, endsWith, in |
| `parentId` | `number` | equals, gt, gte, lt, lte, 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).*

***

## Trends

Path: `twittrapi.db.trends.search`

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

### Searchable filters

| Field | Type | Operators |
| - | - | - |
| `entity_id` | `string` | equals, contains, startsWith, endsWith, in |
| `name` | `string` | equals, contains, startsWith, endsWith, in |
| `query` | `string` | equals, contains, startsWith, endsWith, in |
| `url` | `string` | equals, contains, startsWith, endsWith, in |
| `tweetVolume` | `number` | equals, gt, gte, lt, lte, 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).*

***

## Tweets

Path: `twittrapi.db.tweets.search`

```ts theme={null}
const rows = await corsair.twittrapi.db.tweets.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 |
| `url` | `string` | equals, contains, startsWith, endsWith, in |
| `text` | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt` | `string` | equals, contains, startsWith, endsWith, in |
| `lang` | `string` | equals, contains, startsWith, endsWith, in |
| `conversationId` | `string` | equals, contains, startsWith, endsWith, in |
| `isPinned` | `boolean` | equals |
| `source` | `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).*

***

## Users

Path: `twittrapi.db.users.search`

```ts theme={null}
const rows = await corsair.twittrapi.db.users.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 |
| `username` | `string` | equals, contains, startsWith, endsWith, in |
| `name` | `string` | equals, contains, startsWith, endsWith, in |
| `description` | `string` | equals, contains, startsWith, endsWith, in |
| `location` | `string` | equals, contains, startsWith, endsWith, in |
| `url` | `string` | equals, contains, startsWith, endsWith, in |
| `createdAt` | `string` | equals, contains, startsWith, endsWith, in |
| `avatarUrl` | `string` | equals, contains, startsWith, endsWith, in |
| `bannerUrl` | `string` | equals, contains, startsWith, endsWith, in |
| `verified` | `boolean` | equals |
| `verifiedType` | `string` | equals, contains, startsWith, endsWith, in |
| `protected` | `boolean` | equals |
| `isAutomated` | `boolean` | equals |

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