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

# Overview

> Read collections, NFTs, listings, offers and marketplace events, and search OpenSea's catalogue.

Use **OpenSea** through Corsair: one client, typed API calls.

OpenSea uses an `x-api-key` header. Create a key at
[docs.opensea.io](https://docs.opensea.io/reference/api-keys) from a signed-in
account, then save it for the `opensea` integration. Every marketplace route
requires it: a request with no key answers 401 and
`{"errors":["Missing an API Key, ..."]}`.

Every `chain` argument takes a slug from `chains.list`, such as `ethereum` or
`base`. OpenSea adds chains over time, so the slug is sent as given and the
API refuses one it does not index.

`collections.list` also accepts a `chain` filter.

Order lookups come in two shapes. `orders.get` wraps the result under `order`;
`offers.best` returns the order bare. Both carry the Seaport `protocol_data`
and the `order_hash` that identifies the order.

Most paged routes take a `next` cursor and return it back; pass the previous
response's `next` as this call's `next`, which is `null` on the last page.
Three routes differ: `collections.top`, `collections.trending` and
`collections.holders` take `cursor` instead of `next`.

`traits.list` answers the trait names on a collection, the type of each, and
under `counts` every value with how many NFTs carry it. To select NFTs by
trait, pass `collection.nfts` a `traits` filter: a JSON array sent as a
string, such as `[{"traitType":"Background","value":"Red"}]`. Several filters
are AND-combined.

Prices arrive as base-unit strings. An 18-decimal wei amount such as
`"5900000000000000000"` does not fit a JavaScript number, so the value stays a
string and `decimals` tells you where to put the point.

**What you get:**

* 24 typed API operations

## Setup

**1. Install**

```bash npm theme={null}
npm install corsair @corsair-dev/opensea better-sqlite3
npm install --save-dev @types/better-sqlite3
```

```bash yarn theme={null}
yarn add corsair @corsair-dev/opensea better-sqlite3
yarn add --dev @types/better-sqlite3
```

```bash pnpm theme={null}
pnpm install corsair @corsair-dev/opensea better-sqlite3
pnpm install --save-dev @types/better-sqlite3
```

```bash bun theme={null}
bun add corsair @corsair-dev/opensea better-sqlite3
bun add --dev @types/better-sqlite3
```

**2. Add the plugin**

```ts corsair.ts theme={null}
import Database from 'better-sqlite3';
import { createCorsair } from 'corsair';
import { opensea } from '@corsair-dev/opensea';

export const corsair = createCorsair({
	plugins: [
		opensea(),
	],
	database: new Database('corsair.db'),
	kek: process.env.CORSAIR_KEK!,
	multiTenancy: true,
	hub: {
		projectApiKey: process.env.CORSAIR_API_KEY!,
		signingSecret: process.env.CORSAIR_SIGNING_SECRET!,
	},
});
```

With `multiTenancy: true`, scope calls with `corsair.withTenant(id)`. See [Quick start](https://docs.corsair.dev/quick-start.md) for KEK + Hub keys, and [Multi-tenancy](https://docs.corsair.dev/concepts/multi-tenancy.md) for account isolation.

**3. Choose authentication**

> [tab] API Key (Recommended)
>
> No setup required yet. When you make your first request as a tenant, Corsair prompts for the API key.
>
> ```ts theme={null}
> opensea()
> ```
>
> More: [API Key](https://docs.corsair.dev/concepts/api-key)

**4. Connect a tenant**

Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see [Connect / OAuth](https://docs.corsair.dev/management/connect).

```ts theme={null}
const { connectUrl } = await corsair.manage.connect.createLink({
	plugin: 'opensea',
	tenantId: 'acme',
});
// redirect the user's browser to connectUrl
```

## Example API calls

**Read one collection**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.opensea.api.collections.get({ slug: 'boredapeyachtclub' });
```

**List collections, ten at a time**

```ts theme={null}
const tenant = corsair.withTenant('acme');
await tenant.opensea.api.collections.list({ limit: 10 });
```

See the full list on the [API](https://docs.corsair.dev/plugins/opensea/api.md) page.

## What's next

> [card] [API reference](https://docs.corsair.dev/plugins/opensea/api.md)
>
> Every `opensea.api.*` operation with input and output types.

> [card] [Connect / OAuth](https://docs.corsair.dev/management/connect)
>
> createLink, Hub delivery, and tenant connect flows.

> [card] [Use with agents](https://docs.corsair.dev/mcp-adapters/mcp-adapters)
>
> Expose this plugin's operations as MCP tools.


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