Library / SDK
ProjectOpenSea/opensea-sdk avatar
ProjectOpenSea/opensea-sdk

@opensea/sdk rewrites snake_case API responses to camelCase, and the type you annotate with decides whether that bites

TypeScript SDK for the OpenSea marketplace

2,336 stars1,023 forksTypeScriptMIT

At a glance

What is it?
ProjectOpenSea/opensea-sdk is a read-only mirror of OpenSea's TypeScript SDK for orderbook access, listings, offers, trades and cross-chain swaps. Its sharpest edge is the response casing rewrite, which makes some wrongly typed code compile and then read undefined.
Who is it for?
Use @opensea/sdk if you build in TypeScript against OpenSea and can live with a mirror whose public code trails the private monorepo by weeks. Avoid annotating SDK return values with @opensea/api-types, and avoid relying on the deprecated flat sdk.api methods, which are removed in the next major.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 12 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 28, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • ProjectOpenSea/opensea-sdk2,336 ★ · -2
Star history
Repository2026-10-132026-11-28
ProjectOpenSea/opensea-sdk2.3k2.3k

-2 Stars in the last 46 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The GitHub repository is a read-only mirror of a private monorepo

The README opens with a notice: this package is developed in a private monorepo and mirrored to ProjectOpenSea/opensea-sdk when a version is released. The public code can trail the internal main branch by weeks.

Pull requests opened on the mirror cannot be merged there. They are read, and a fix worth taking is recreated in the monorepo. The README adds a practical consequence. A fix that has landed internally is not public until the next release, so filing an issue before writing a patch is the quickest way to find out whether a bug is already fixed.

The release cadence shows the mirror in motion. v12.13.0 was tagged 2026-10-19, v12.13.1 on 2026-10-20 and v12.13.2 on 2026-10-27, and the last push is 2026-10-22. If you read the code on GitHub to debug a problem, you are reading the state at the last release, not what the OpenSea team is working on now.

Getting an API key takes one call, and the instant key lasts 7 days

Every SDK instance needs an API key. For quick experimentation, the README shows a free-tier key requested in code, with no signup, valid for 7 days:

typescript
import { ethers } from "ethers";
import { OpenSeaSDK, Chain } from "@opensea/sdk";

const provider = new ethers.JsonRpcProvider("https://eth-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY");
const { apiKey } = await OpenSeaSDK.requestInstantApiKey();
const sdk = new OpenSeaSDK(provider, { chain: Chain.Mainnet, apiKey });

The same key can be requested from the shell:

bash
curl -s -X POST https://api.opensea.io/api/v2/auth/keys | jq -r '.api_key'

A service that calls requestInstantApiKey on every start will keep working, but it silently depends on a key that expires within a week. For production, the README sends you to opensea.io/settings/developer for a permanent key. Those keys do not expire, get higher rate limits and can be rotated from your account.

sdk.api groups methods by domain, and the flat methods are scheduled for removal

The API surface is organized into namespaces: sdk.api.collections.getCollection(slug), sdk.api.nfts.getNFT(...), sdk.api.offers.getAllOffers(...), and further groups for accounts, assets, chains, drops, events, listings, orders, tokens, tools (beta), transactions and walletAuth. Search stays flat as sdk.api.search(args).

The older flat methods, such as sdk.api.getCollection(slug), still work. They carry @deprecated tags that name their replacements, and the README says they are removed in the next major. Four of them change names, and developerDocs/api-reference.md lists those four.

If your code base calls the flat names, the compiler will keep passing today. The break arrives at the next major version, so search for the deprecated calls and move them before you take that upgrade. Treat the deprecation tag in your editor as the warning, since nothing at runtime announces it.

Annotating a response with an api-types schema compiles and then reads undefined

The API speaks snake_case. The SDK rewrites response keys to camelCase before handing them back, and rewrites camelCase request bodies and query params to snake_case on the way out. So collection.bannerImageUrl is what you read, and banner_image_url is what crosses the wire.

The package @opensea/api-types describes the wire, so its types stay snake_case. Annotating an SDK return value with one of them is a trap. TypeScript rejects the pairing only when the wire type has a required snake_case key somewhere in its tree. Of the 166 schemas in the spec that declare snake_case properties directly, 15 take the camelized value with no error. AccountResolveResponse is one: its one required property, address, has no underscore to rewrite, so the camelCase keys pass through as extras.

The result is code that compiles while every snake_case field reads undefined at runtime. Use the SDK's own response type instead, such as ResolveAccountResponse imported from @opensea/sdk, or wrap the wire type:

typescript
import type { AccountResolveResponse } from "@opensea/api-types";
import type { Camelize } from "@opensea/sdk";

const account: Camelize<AccountResolveResponse> = await sdk.api.accounts.resolveAccount("vitalik.eth");

camelizeResponse: false only types correctly when the compiler sees the literal

The rewrite can be turned off per call with camelizeResponse: false. The README gives a concrete reason: getTraits is keyed by collection-authored trait names, so the rewrite would report a dark_brown trait as darkBrown and merge two traits that differ only in casing.

The value has to be the literal false. api.get, api.post and api.request overload on that literal and return the raw T, so the declared type is the wire shape the call returns. TypeScript keeps the literal only where the property is written inline at the call site or the object is declared as const.

Two other spellings compile and still skip the rewrite at runtime, but they declare the type as Camelize<T>. One passes a boolean variable the compiler cannot see through. The other uses a const object whose false widens to boolean. In both cases the type claims camelCase properties the response does not have, and the error shows up only when the code runs.

ethers v6 is a hard dependency and viem is an optional peer behind a subpath

The default entry creates the SDK from an ethers provider, as the first example shows with ethers.JsonRpcProvider. package.json lists ethers ^6.16.0 and @opensea/seaport-js ^4.2.0 as dependencies, alongside @noble/hashes and @opensea/api-types.

Viem support lives under a separate import path. The README's viem quick start imports OpenSeaSDK and Chain from '@opensea/sdk/viem', and package.json declares viem ^2.0.0 as a peer dependency marked optional. An ethers-only project does not need viem installed, and a viem project still pulls ethers in as a regular dependency.

The exports map also defines a third entry, @opensea/sdk/stream, with its own types. The README excerpt does not describe the stream API, so read src/ or the docs at docs.opensea.io/reference before using it. The package is marked type commonjs with main at lib/index.js, so check how your bundler resolves it.

The README answers none of the trust or tax questions people search for

Searches around this project mix developer terms such as OpenSea API, opensea js and opensea sdk github with questions about whether OpenSea is trustworthy, whether it reports to the IRS and whether selling an NFT there is free. The repository answers none of those. It is MIT-licensed code, and the README says only that OpenSea is the largest marketplace for NFTs and tokens.

Fees, reporting and legal obligations for sellers are marketplace and tax questions, and an SDK package does not document them. Its job is the API: reading the official orderbook, filtering it, creating listings and offers, completing trades programmatically and swapping tokens across chains. Read the marketplace's own terms for the rest.

Editorial conclusion

Use @opensea/sdk if you build in TypeScript against OpenSea and can live with a mirror whose public code trails the private monorepo by weeks. Avoid annotating SDK return values with @opensea/api-types, and avoid relying on the deprecated flat sdk.api methods, which are removed in the next major. Before shipping, check that your pinned release contains the fix you need, because a fix merged internally is not public until the next release.

Frequently asked questions

How do I get an OpenSea API key for the OpenSea SDK?

Call OpenSeaSDK.requestInstantApiKey() for a free-tier key valid for 7 days, or POST to https://api.opensea.io/api/v2/auth/keys. For production, create a permanent key at opensea.io/settings/developer.

Can I send a pull request to opensea-sdk on GitHub?

You can open one, but it cannot be merged on the mirror. The package is developed in a private monorepo, and a fix worth taking is recreated there.

Does @opensea/sdk work with viem as well as ethers?

Yes. Import OpenSeaSDK and Chain from '@opensea/sdk/viem'. viem ^2.0.0 is an optional peer dependency, while ethers ^6.16.0 is a regular dependency.

Official sources

  1. License: MIT
  2. ProjectOpenSea/opensea-sdk on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/projectopensea-opensea-sdk.svg)](https://hysenlabs.com/projects/projectopensea-opensea-sdk)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/projectopensea-opensea-sdk.svg)](https://hysenlabs.com/projects/projectopensea-opensea-sdk)

Was this useful?