# Send OpenSea to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "opensea-skill",
    "name": "OpenSea",
    "source": "tencent",
    "type": "skill",
    "category": "数据分析",
    "sourceUrl": "https://clawhub.ai/dfinzer/opensea-skill",
    "canonicalUrl": "https://clawhub.ai/dfinzer/opensea-skill",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/opensea-skill",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=opensea-skill",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "scripts/opensea-account-nfts.sh",
      "scripts/opensea-order.sh",
      "scripts/opensea-listings-collection.sh",
      "scripts/opensea-get.sh"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "opensea-skill",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-29T21:25:53.960Z",
      "expiresAt": "2026-05-06T21:25:53.960Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=opensea-skill",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=opensea-skill",
        "contentDisposition": "attachment; filename=\"opensea-skill-2.2.3.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "opensea-skill"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/opensea-skill"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/opensea-skill",
    "downloadUrl": "https://openagent3.xyz/downloads/opensea-skill",
    "agentUrl": "https://openagent3.xyz/skills/opensea-skill/agent",
    "manifestUrl": "https://openagent3.xyz/skills/opensea-skill/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/opensea-skill/agent.md"
  }
}
```
## Documentation

### OpenSea API

Query NFT data, trade on the Seaport marketplace, and swap ERC20 tokens across Ethereum, Base, Arbitrum, Optimism, Polygon, and more.

### Quick start

Set OPENSEA_API_KEY in your environment
Preferred: Use the opensea CLI (@opensea/cli) for all queries and operations
Alternatively, use the shell scripts in scripts/ or the MCP server

export OPENSEA_API_KEY="your-api-key"

# Install the CLI globally (or use npx)
npm install -g @opensea/cli

# Get collection info
opensea collections get boredapeyachtclub

# Get floor price and volume stats
opensea collections stats boredapeyachtclub

# Get NFT details
opensea nfts get ethereum 0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d 1234

# Get best listings for a collection
opensea listings best boredapeyachtclub --limit 5

# Search across OpenSea
opensea search "cool cats"

# Get trending tokens
opensea tokens trending --limit 5

# Get a swap quote
opensea swaps quote \\
  --from-chain base --from-address 0x0000000000000000000000000000000000000000 \\
  --to-chain base --to-address 0xTokenAddress \\
  --quantity 0.02 --address 0xYourWallet

### Task guide

Recommended: Use the opensea CLI (@opensea/cli) as your primary tool. It covers all the operations below with a consistent interface, structured output, and built-in pagination. Install with npm install -g @opensea/cli or use npx @opensea/cli. The shell scripts in scripts/ remain available as alternatives.

### Token swaps

OpenSea's API includes a cross-chain DEX aggregator for swapping ERC20 tokens with optimal routing across all supported chains.

TaskCLI CommandAlternativeGet swap quote with calldataopensea swaps quote --from-chain <chain> --from-address <addr> --to-chain <chain> --to-address <addr> --quantity <qty> --address <wallet>get_token_swap_quote (MCP) or opensea-swap.shGet trending tokensopensea tokens trending [--chains <chains>] [--limit <n>]get_trending_tokens (MCP)Get top tokens by volumeopensea tokens top [--chains <chains>] [--limit <n>]get_top_tokens (MCP)Get token detailsopensea tokens get <chain> <address>get_tokens (MCP)Search tokensopensea search <query> --types tokensearch_tokens (MCP)Check token balancesget_token_balances (MCP)—

### Reading NFT data

TaskCLI CommandAlternativeGet collection detailsopensea collections get <slug>opensea-collection.sh <slug>Get collection statsopensea collections stats <slug>opensea-collection-stats.sh <slug>List NFTs in collectionopensea nfts list-by-collection <slug> [--limit <n>]opensea-collection-nfts.sh <slug> [limit] [next]Get single NFTopensea nfts get <chain> <contract> <token_id>opensea-nft.sh <chain> <contract> <token_id>List NFTs by walletopensea nfts list-by-account <chain> <address> [--limit <n>]opensea-account-nfts.sh <chain> <address> [limit]List NFTs by contractopensea nfts list-by-contract <chain> <contract> [--limit <n>]—Get collection traitsopensea collections traits <slug>—Get contract detailsopensea nfts contract <chain> <address>—Refresh NFT metadataopensea nfts refresh <chain> <contract> <token_id>—

### Marketplace queries

TaskCLI CommandAlternativeGet best listings for collectionopensea listings best <slug> [--limit <n>]opensea-best-listing.sh <slug> <token_id>Get best listing for specific NFTopensea listings best-for-nft <slug> <token_id>opensea-best-listing.sh <slug> <token_id>Get best offer for NFTopensea offers best-for-nft <slug> <token_id>opensea-best-offer.sh <slug> <token_id>List all collection listingsopensea listings all <slug> [--limit <n>]opensea-listings-collection.sh <slug> [limit]List all collection offersopensea offers all <slug> [--limit <n>]opensea-offers-collection.sh <slug> [limit]Get collection offersopensea offers collection <slug> [--limit <n>]opensea-offers-collection.sh <slug> [limit]Get trait offersopensea offers traits <slug> --type <type> --value <value>—Get order by hash—opensea-order.sh <chain> <order_hash>

### Marketplace actions (POST)

TaskScriptGet fulfillment data (buy NFT)opensea-fulfill-listing.sh <chain> <order_hash> <buyer>Get fulfillment data (accept offer)opensea-fulfill-offer.sh <chain> <order_hash> <seller> <contract> <token_id>Generic POST requestopensea-post.sh <path> <json_body>

### Search

TaskCLI CommandSearch collectionsopensea search <query> --types collectionSearch NFTsopensea search <query> --types nftSearch tokensopensea search <query> --types tokenSearch accountsopensea search <query> --types accountSearch multiple typesopensea search <query> --types collection,nft,tokenSearch on specific chainopensea search <query> --chains base,ethereum

### Events and monitoring

TaskCLI CommandAlternativeList recent eventsopensea events list [--event-type <type>] [--limit <n>]—Get collection eventsopensea events by-collection <slug> [--event-type <type>]opensea-events-collection.sh <slug> [event_type] [limit]Get events for specific NFTopensea events by-nft <chain> <contract> <token_id>—Get events for accountopensea events by-account <address>—Stream real-time events—opensea-stream-collection.sh <slug> (requires websocat)

Event types: sale, transfer, mint, listing, offer, trait_offer, collection_offer

### Accounts

TaskCLI CommandGet account detailsopensea accounts get <address>

### Generic requests

TaskScriptAny GET endpointopensea-get.sh <path> [query]Any POST endpointopensea-post.sh <path> <json_body>

### Buying an NFT

Find the NFT and check its listing:
./scripts/opensea-best-listing.sh cool-cats-nft 1234



Get the order hash from the response, then get fulfillment data:
./scripts/opensea-fulfill-listing.sh ethereum 0x_order_hash 0x_your_wallet



The response contains transaction data to execute on-chain

### Selling an NFT (accepting an offer)

Check offers on your NFT:
./scripts/opensea-best-offer.sh cool-cats-nft 1234



Get fulfillment data for the offer:
./scripts/opensea-fulfill-offer.sh ethereum 0x_offer_hash 0x_your_wallet 0x_nft_contract 1234



Execute the returned transaction data

### Creating listings/offers

Creating new listings and offers requires wallet signatures. Use opensea-post.sh with the Seaport order structure - see references/marketplace-api.md for full details.

### OpenSea CLI (@opensea/cli)

The OpenSea CLI is the recommended way for AI agents to interact with OpenSea. It provides a consistent command-line interface and a programmatic TypeScript/JavaScript SDK.

### Installation

# Install globally
npm install -g @opensea/cli

# Or use without installing
npx @opensea/cli collections get mfers

### Authentication

# Set via environment variable (recommended)
export OPENSEA_API_KEY="your-api-key"
opensea collections get mfers

# Or pass inline
opensea --api-key your-api-key collections get mfers

### CLI Commands

CommandDescriptioncollectionsGet, list, stats, and traits for NFT collectionsnftsGet, list, refresh metadata, and contract details for NFTslistingsGet all, best, or best-for-nft listingsoffersGet all, collection, best-for-nft, and trait offerseventsList marketplace events (sales, transfers, mints, etc.)searchSearch collections, NFTs, tokens, and accountstokensGet trending tokens, top tokens, and token detailsswapsGet swap quotes for token tradingaccountsGet account details

Global options: --api-key, --chain (default: ethereum), --format (json/table/toon), --base-url, --timeout, --verbose

### Output Formats

JSON (default): Structured output for agents and scripts
Table: Human-readable tabular output (--format table)
TOON: Token-Oriented Object Notation, uses ~40% fewer tokens than JSON — ideal for LLM/AI agent context windows (--format toon)

# JSON output (default)
opensea collections stats mfers

# Human-readable table
opensea --format table collections stats mfers

# Compact TOON format (best for AI agents)
opensea --format toon tokens trending --limit 5

### Pagination

All list commands support cursor-based pagination with --limit and --next:

# First page
opensea collections list --limit 5

# Pass the "next" cursor from the response to get the next page
opensea collections list --limit 5 --next "LXBrPTEwMDA..."

### Programmatic SDK

The CLI also exports a TypeScript/JavaScript SDK for use in scripts and applications:

import { OpenSeaCLI, OpenSeaAPIError } from "@opensea/cli"

const client = new OpenSeaCLI({ apiKey: process.env.OPENSEA_API_KEY })

const collection = await client.collections.get("mfers")
const { nfts } = await client.nfts.listByCollection("mfers", { limit: 5 })
const { listings } = await client.listings.best("mfers", { limit: 10 })
const { asset_events } = await client.events.byCollection("mfers", { eventType: "sale" })
const { tokens } = await client.tokens.trending({ chains: ["base"], limit: 5 })
const results = await client.search.query("mfers", { limit: 5 })

// Swap quote
const { quote, transactions } = await client.swaps.quote({
  fromChain: "base",
  fromAddress: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  toChain: "base",
  toAddress: "0x3ec2156d4c0a9cbdab4a016633b7bcf6a8d68ea2",
  quantity: "1000000",
  address: "0xYourWalletAddress",
})

// Error handling
try {
  await client.collections.get("nonexistent")
} catch (error) {
  if (error instanceof OpenSeaAPIError) {
    console.error(error.statusCode)   // e.g. 404
    console.error(error.responseBody) // raw API response
    console.error(error.path)         // request path
  }
}

### TOON Format for AI Agents

TOON (Token-Oriented Object Notation) is a compact serialization format that uses ~40% fewer tokens than JSON, making it ideal for piping CLI output into LLM context windows:

opensea --format toon tokens trending --limit 3

Example output:

tokens[3]{name,symbol,chain,market_cap,price_usd}:
  Ethereum,ETH,ethereum,250000000000,2100.50
  Bitcoin,BTC,bitcoin,900000000000,48000.00
  Solana,SOL,solana,30000000000,95.25
next: abc123

TOON is also available programmatically:

import { formatToon } from "@opensea/cli"

const data = await client.tokens.trending({ limit: 5 })
console.log(formatToon(data))

### CLI Exit Codes

0 - Success
1 - API error
2 - Authentication error

### Shell Scripts Reference

The scripts/ directory contains shell scripts that wrap the OpenSea REST API directly using curl. These are an alternative to the CLI above.

### NFT & Collection Scripts

ScriptPurposeopensea-get.shGeneric GET (path + optional query)opensea-post.shGeneric POST (path + JSON body)opensea-collection.shFetch collection by slugopensea-collection-stats.shFetch collection statisticsopensea-collection-nfts.shList NFTs in collectionopensea-nft.shFetch single NFT by chain/contract/tokenopensea-account-nfts.shList NFTs owned by wallet

### Marketplace Scripts

ScriptPurposeopensea-listings-collection.shAll listings for collectionopensea-listings-nft.shListings for specific NFTopensea-offers-collection.shAll offers for collectionopensea-offers-nft.shOffers for specific NFTopensea-best-listing.shLowest listing for NFTopensea-best-offer.shHighest offer for NFTopensea-order.shGet order by hashopensea-fulfill-listing.shGet buy transaction dataopensea-fulfill-offer.shGet sell transaction data

### Token Swap Scripts

ScriptPurposeopensea-swap.shSwap tokens via OpenSea MCP

### Monitoring Scripts

ScriptPurposeopensea-events-collection.shCollection event historyopensea-stream-collection.shReal-time WebSocket events

### Supported chains

ethereum, matic, arbitrum, optimism, base, avalanche, klaytn, zora, blast, sepolia

### References

OpenSea CLI GitHub - Full CLI and SDK documentation
CLI Reference - Complete command reference
SDK Reference - Programmatic SDK API
CLI Examples - Real-world usage examples
references/rest-api.md - REST endpoint families and pagination
references/marketplace-api.md - Buy/sell workflows and Seaport details
references/stream-api.md - WebSocket event streaming
references/seaport.md - Seaport protocol and NFT purchase execution
references/token-swaps.md - Token swap workflows via MCP

### OpenSea MCP Server

An official OpenSea MCP server provides direct LLM integration for token swaps and NFT operations. When enabled, Claude can execute swaps, query token data, and interact with NFT marketplaces directly.

Setup:

Go to the OpenSea Developer Portal and verify your email
Generate a new API key for REST API access
Generate a separate MCP token for the MCP server

Add to your MCP config:

{
  "mcpServers": {
    "opensea": {
      "url": "https://mcp.opensea.io/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_MCP_TOKEN"
      }
    }
  }
}

Or use the inline token format: https://mcp.opensea.io/YOUR_MCP_TOKEN/mcp

### Token Swap Tools

MCP ToolPurposeget_token_swap_quoteGet swap calldata for token tradesget_token_balancesCheck wallet token holdingssearch_tokensFind tokens by name/symbolget_trending_tokensHot tokens by momentumget_top_tokensTop tokens by 24h volumeget_tokensGet detailed token info

### NFT Tools

MCP ToolPurposesearch_collectionsSearch NFT collectionssearch_itemsSearch individual NFTsget_collectionsGet detailed collection infoget_itemsGet detailed NFT infoget_nft_balancesList NFTs owned by walletget_trending_collectionsTrending NFT collectionsget_top_collectionsTop collections by volumeget_activityTrading activity for collections/itemsget_upcoming_dropsUpcoming NFT mints

### Profile & Utility Tools

MCP ToolPurposeget_profileWallet profile with holdings/activityaccount_lookupResolve ENS/address/usernameget_chainsList supported chainssearchAI-powered natural language searchfetchGet full details by entity ID

### Token Swaps via MCP

OpenSea MCP supports ERC20 token swaps across supported DEXes - not just NFTs!

### Get Swap Quote

mcporter call opensea.get_token_swap_quote --args '{
  "fromContractAddress": "0x0000000000000000000000000000000000000000",
  "fromChain": "base",
  "toContractAddress": "0xb695559b26bb2c9703ef1935c37aeae9526bab07",
  "toChain": "base",
  "fromQuantity": "0.02",
  "address": "0xYourWalletAddress"
}'

Parameters:

fromContractAddress: Token to swap from (use 0x0000...0000 for native ETH)
toContractAddress: Token to swap to
fromChain / toChain: Chain identifiers
fromQuantity: Amount in human-readable units (e.g., "0.02" for 0.02 ETH)
address: Your wallet address

Response includes:

swapQuote: Price info, fees, slippage impact
swap.actions[0].transactionSubmissionData: Ready-to-use calldata

### Execute the Swap

import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { base } from 'viem/chains';

// Extract from swap quote response
const txData = response.swap.actions[0].transactionSubmissionData;

const wallet = createWalletClient({ 
  account: privateKeyToAccount(PRIVATE_KEY), 
  chain: base, 
  transport: http() 
});

const hash = await wallet.sendTransaction({
  to: txData.to,
  data: txData.data,
  value: BigInt(txData.value)
});

### Check Token Balances

mcporter call opensea.get_token_balances --args '{
  "address": "0xYourWallet",
  "chains": ["base", "ethereum"]
}'

### Generating a wallet

To execute swaps or buy NFTs, you need an Ethereum wallet (private key + address).

### Using Node.js

import crypto from 'crypto';
import { privateKeyToAccount } from 'viem/accounts';

const privateKey = '0x' + crypto.randomBytes(32).toString('hex');
const account = privateKeyToAccount(privateKey);

console.log('Private Key:', privateKey);
console.log('Address:', account.address);

### Using OpenSSL

# Generate private key
PRIVATE_KEY="0x$(openssl rand -hex 32)"
echo "Private Key: $PRIVATE_KEY"

# Derive address (requires node + viem)
node --input-type=module -e "
import { privateKeyToAccount } from 'viem/accounts';
console.log('Address:', privateKeyToAccount('$PRIVATE_KEY').address);
"

### Using cast (Foundry)

cast wallet new

Important: Store private keys securely. Never commit them to git or share publicly.

### Requirements

OPENSEA_API_KEY environment variable (for CLI, SDK, and REST API scripts)
OPENSEA_MCP_TOKEN environment variable (for MCP server, separate from API key)
Node.js >= 18.0.0 (for @opensea/cli)
curl for REST shell scripts
websocat (optional) for Stream API
jq (recommended) for parsing JSON responses from shell scripts

Get both credentials at opensea.io/settings/developer.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: dfinzer
- Version: 1.0.3
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-29T21:25:53.960Z
- Expires at: 2026-05-06T21:25:53.960Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/opensea-skill)
- [Send to Agent page](https://openagent3.xyz/skills/opensea-skill/agent)
- [JSON manifest](https://openagent3.xyz/skills/opensea-skill/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/opensea-skill/agent.md)
- [Download page](https://openagent3.xyz/downloads/opensea-skill)