Learn more about OpenSea’s NFT API and developer platform
NFTs, or non-fungible tokens, are digital items on the blockchain that are provably unique. Since its conception, the asset class has grown to include collectibles in image, video, and audio formats, game items, digital art, event tickets, domain names, and even ownership records for physical assets. And the use cases continue to grow.
Most often tied to the Ethereum blockchain, NFTs rely on ERC-721 & ERC-1155 token standards, and if you build on the latter, allow for semi-fungibility—the ability to create tokens that are exchangeable/fungible when minted, but become inexchangable/non-fungible upon redemption. Some examples of semi-fungible tokens include concert tickets, gift vouchers, and coupons. Recently, there has also been talk of “soulbound” NFTs that would be non-transferable upon acquisition, allowing individuals to verify their identity, confirm attendance at events, and hold distributed, participation-based governance rights in decentralized organizations (DAOs). Soulbound NFTs would serve to expand the NFT space beyond the social signaling and financial incentives that currently dominate as a result of the ability to trade these assets on secondary markets.
Meanwhile, as the market for buying & selling NFTs continues to grow to become an outsized part of the Web3 space, with more than $41 billion in trading volume at the end of 2021, developers are flocking to the space to build upon this unique asset class.
NFTs offer a unique opportunity for both application developers and smart contract developers. Whether or not the projects you’re building require you to interface directly with the blockchain, an important requirement is being able to access an index of the NFT ecosystem, with detailed information about ownership, collections, and events. For smart contract developers, equally valuable is the ability to build native NFT marketplaces through functionality that enables the buying & selling of NFTs.
OpenSea, the leading peer-to-peer marketplace for NFTs and other digital assets, fulfills these key developer requirements through its API & SDK, a straightforward to integrate and use toolset that already provides the backbone for most mainstream dApps that deal with NFTs today. But such a large portion of the market relying on such a centralized system isn’t without its problems, especially as OpenSea’s platform has recently faced reliability issues, and there are several viable alternatives to OpenSea’s API.
OpenSea serves as a horizontal, peer-to-peer marketplace for digital goods, allowing users to buy, sell, and auction NFTs, rare digital items and crypto collectibles. For developers, OpenSea offers extensive integrations and tooling for dApps in the NFT space. They index and provide the largest dataset of NFTs (having been around since the first projects were listed), and act as a secondary market for popular collections and projects.
OpenSea supports a number of widely-used tokens and chains, and they are actively expanding that list. They support both ERC-721 non-fungibles and ERC-1155 semi-fungibles, and are a multi-chain platform, providing tooling for Polygon and Klaytn in addition to Ethereum.
Alongside their marketplace, OpenSea’s API platform powers third-party tooling, with their REST API serving as the backbone of a number of large projects in the Web3 community, such as MetaMask, Coinbase Wallet, and Rainbow, among others.
OpenSea’s developer tooling consists of a REST API that enables developers to access and display metadata about NFTs, and a Software Development Kit (SDK) that builds on top of the API to enable the development that directly interfaces with the blockchain, such as for the creation of NFT marketplaces via the buying & selling of digital assets. The OpenSea dev platform provides a number of key value-adds.
For the application development via the API:
And for smart contract interaction via the SDK:
The OpenSea API provides endpoints for the following indexed models on the OpenSea platform: assets (individual ERC-721/ERC-1155 tokens), NFT collections, events, orders, accounts, and asset contracts. As part of the SDK functionality, the orders API allows for retrieval (GET) and submission (POST) of NFT orders. OpenSea provides access to both Mainnet & Testnet (via the Ethereum Rinkeby network) APIs so developers can build and test without spending real money.
Some API endpoints (orders & events) are gated by OpenSea to prevent misuse. To build with these endpoints, you can request an API key here.
Now, we’ll explore OpenSea’s API models more closely, and discuss the scope and function of each. Popular endpoints & API calls are also provided below.
Some popular endpoints & API calls include:
You can find a complete list of the OpenSea API calls & endpoints here.
OpenSea’s SDK tooling is an npm package available for web developers looking to build ecommerce functionality into their applications. Through the SDK JavaScript library, you can build native marketplaces for the buying & selling of NFTs with no need to deploy smart contracts or backend orderbooks.
OpenSea’s SDK is backed by the REST API we explored above, and employs Web3.js (a popular package for EVM interactions) to power interactions with the blockchain for the creation and fulfillment of NFT orders.
The SDK supports functionality like fetching assets, making offers, making listings & selling items, running crowdsales, fetching orders, buying items, accepting offers, and transferring items or coins (gifting).
It also offers an advanced set of features that includes the ability to schedule future listings, purchase items for other users, make bulk transfers of NFTs, create bundles of NFTs, use ERC-20 tokens as payment instead of Ether, create private auctions, share sale fees with OpenSea, and listen to events.
It is easy to set up (via npm install) and is integrated natively with OpenSea’s exchange to directly create and fulfill buy/sell orders.
You can install and explore the functionality of OpenSea’s JavaScript SDK library here.
OpenSea’s development platform has seen widespread adoption throughout the Web3 community. It is integrated into products such as Coinbase Wallet, MetaMask, Rainbow, 3Box, Opera Wallet, Trust Wallet, Editorial, Balance, CryptoGoods, and most recently, Twitter, when it added support for NFT profile photos.
This nearly market-wide reliance on OpenSea’s centralized API index has proved to be problematic. In recent weeks, OpenSea has undergone a series of “database outages,” and as a result, several services which rely on OpenSea’s APIs have been unable to display NFTs. Although this does not affect the underlying tokens or blockchain, it results in sustained down time for all user-facing services that rely on NFT data for the duration of OpenSea’s outage.
These outages have resulted in further conversations about the lack of decentralization across the services in the NFT space, and across the wider Web3 ecosystem. To this point, there are a few projects in the works that aim for various levels of decentralization of the NFT index, but there are no fully decentralized players on the market yet.
Regardless, recent events indicate that developers should consider the all the major NFT API providers before making a decision on whether to use OpenSea.
Aside from OpenSea, a few of the most widely-used and full-featured NFT APIs are detailed below. It is important to note that there is currently no service that provides an equivalent to OpenSea’s SDK for the creation of NFT marketplaces & associated features.
Alchemy, a Web3 development infrastructure platform, recently announced the launch of their NFT API, which allows access to NFT metadata across both ERC-721 and ERC-1155, in much the same way that OpenSea does. It currently supports accessing metadata for NFTs on multiple blockchains, finding an NFT’s owner, and real-time information updates, among other features. Alchemy’s API is available on Mainnets for Ethereum, Polygon, and Flow, with planned support for others, starting with Solana and Avalanche, and Testnets for Ethereum and Polygon. It currently powers NFT platforms like Adobe Behance, Shopify, Dapper Labs, and SuperRare, among others.
You can read more about Alchemy’s NFT API here and find documentation here.
Another NFT API provider is NFTPort, an NFT infrastructure platform, that supports features such as:
• Minting NFTs on the Polygon chain.
• Deploying OpenSea-compatible contracts with support for dynamic NFTs, as well as planned support for programmatic royalty management.
• Live-indexing and caching of NFT data, with on-chain transaction/order data.
• More advanced APIs that include multi-chain NFT search, NFT recommendations, and counterfeit NFT detection.
You can read more about NFTPort here and find documentation here.
For developers that like the idea of a fully-decentralized index for NFT data, Uniswap’s Token Lists act as a middle ground between an OpenSea-level of centralization and personally-curated collections of NFTs input by individual users of the network into wallets. With Uniswap’s solution, the community can come together to list NFT collections, creating decentralization and adding trust to the indexing process.
You can read more about Uniswap’s attempt to further decentralize NFT interfaces here and make your own list of tokens here.
In response to the recent OpenSea outages, Dan Finlay, a founder of MetaMask, described some alternatives to centralized reliance on OpenSea here.
In his post, he argues that: “a better solution is to make asset detection a client centric act of consent.”
Via EIP-747, MetaMask already allows a site to suggest a custom asset to the user’s wallet, with the wallet becoming the index of assets, requiring no central server. MetaMask, it seems, intends to expand this functionality to include NFTs, creating a fully decentralized system that also improves performance.
As more and more such NFT APIs come to market, developers are afforded more and more choice, not only in the level of decentralization that works best for them and their projects, but also in selecting the provider of these services, resulting in fewer market-wide outages.
OpenSea’s Developer Platform for NFTs is robust, fully featured, and easy to deploy and use. It provides extensive data read-and-write features for developers looking to enter the NFT space, whether or not they hope to interface directly with smart contracts. It is the leading market provider of the NFT API service, and for good reason.
While OpenSea’s API itself is relatively reliable, the widespread dependence on the company's tooling means that if it fails, as in recent weeks, it will bring much of the NFT market down with it. To sufficiently de-risk the space, developers should continue to explore a variety of decentralized and centralized options to build their projects upon, and infrastructure providers should work to match and compete with OpenSea’s power ful set of features.
Regardless of what API developers choose, the NFT space is rapidly moving toward widespread adoption and sustained innovation as the ecosystem and tooling around this asset class continue to grow. There’s never been a better time to get started as a Web3 developer!