Query NFT data, trade on the Seaport marketplace, and swap ERC20 tokens across Ethereum, Base, Arbitrum, Optimism, Polygon, and more.
This is an Agent Skill for AI coding assistants. Once installed, your agent can interact with the OpenSea API to query NFT data, execute marketplace operations, and swap ERC20 tokens.
OPENSEA_API_KEYenvironment variable — for REST API scriptsOPENSEA_MCP_TOKENenvironment variable — for the MCP server (separate from API key)curlfor REST callsjq(recommended) for parsing JSON responses
Get both credentials at opensea.io/settings/developer.
npx skills add ProjectOpenSea/opensea-skill/skill install ProjectOpenSea/opensea-skillClone this repository to your skills directory:
git clone https://github.com/ProjectOpenSea/opensea-skill.git ~/.skills/openseaRefer to your AI tool's documentation for skills directory configuration.
SKILL.md — the main skill file that teaches your agent how to use the OpenSea API, including task guides, script references, MCP tool documentation, and end-to-end workflows for buying, selling, and swapping tokens.
Ready-to-use scripts in scripts/ for common operations:
| Script | Purpose |
|---|---|
opensea-collection.sh |
Fetch collection by slug |
opensea-nft.sh |
Fetch single NFT by chain/contract/token |
opensea-best-listing.sh |
Get lowest listing for an NFT |
opensea-best-offer.sh |
Get highest offer for an NFT |
opensea-swap.sh |
Swap tokens via OpenSea DEX aggregator |
opensea-fulfill-listing.sh |
Get buy transaction data |
opensea-fulfill-offer.sh |
Get sell transaction data |
See SKILL.md for the full scripts reference and usage examples.
Detailed API documentation in references/:
rest-api.md— REST endpoint families and paginationmarketplace-api.md— Buy/sell workflows and Seaport detailsstream-api.md— WebSocket event streamingseaport.md— Seaport protocol and NFT purchase executiontoken-swaps.md— Token swap workflows via MCP
An official MCP server provides direct LLM integration for token swaps and NFT operations. Add to your MCP config:
{
"mcpServers": {
"opensea": {
"url": "https://mcp.opensea.io/mcp",
"headers": {
"Authorization": "Bearer YOUR_MCP_TOKEN"
}
}
}
}See SKILL.md for the full list of available MCP tools.
Once installed, prompt your AI assistant:
Get me the floor price for the Pudgy Penguins collection on OpenSea
Swap 0.02 ETH to USDC on Base using OpenSea
Show me the best offer on BAYC #1234
This skill supports all chains available on OpenSea, including ethereum, solana, abstract, ape_chain, arbitrum, avalanche, b3, base, bera_chain, blast, flow, gunzilla, hyperevm, hyperliquid, ink, megaeth, monad, optimism, polygon, ronin, sei, shape, somnia, soneium, unichain, and zora.