Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions opensea/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
---
name: opensea
description: Query NFT and token data, trade NFTs on Seaport, swap ERC20 tokens via DEX aggregator, configure wallet signing providers, and build/register/gate AI agent tools on Base. Covers the full OpenSea developer surface across CLI, MCP server, shell scripts, and SDK. Pick the right sub-skill using the routing table below, then read that sub-skill's SKILL.md for operational detail.
homepage: https://github.com/ProjectOpenSea/opensea-skill
repository: https://github.com/ProjectOpenSea/opensea-skill
license: MIT
compatibility: Requires network access and Node.js >= 18. Set $OPENSEA_API_KEY (free instant key at https://docs.opensea.io/reference/api-keys#instant-api-key-for-agents) for all read/write operations. Write operations (marketplace, swaps) additionally require a wallet provider — Bankr, Privy, Turnkey, Fireblocks, or a local PRIVATE_KEY — configured per opensea-wallet/SKILL.md. `curl` and `jq` recommended for shell-script flows.
metadata:
author: ProjectOpenSea
version: "1.0"
env:
OPENSEA_API_KEY:
description: API key for all OpenSea services
required: true
obtain: https://docs.opensea.io/reference/api-keys#instant-api-key-for-agents
dependencies:
- node >= 18.0.0
- curl
- jq (recommended)
---

# OpenSea (router)
Expand All @@ -29,7 +36,3 @@ Always read the sub-skill `SKILL.md` before executing. This router intentionally
- **Token swaps** (ERC20 to ERC20, cross-chain): `opensea-swaps`
- **Wallet setup** (before any write operation): `opensea-wallet`
- **Tool building** (register, gate, monetize AI tools): `opensea-tool-sdk`

## Source

Maintained at [github.com/ProjectOpenSea/opensea-skill](https://github.com/ProjectOpenSea/opensea-skill). File issues and contributions there.
280 changes: 231 additions & 49 deletions opensea/opensea-api/SKILL.md

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions opensea/opensea-api/references/rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ List endpoints support cursor-based pagination:
| `/api/v2/collections` | GET | List multiple collections |
| `/api/v2/collections/trending` | GET | Trending collections by sales activity |
| `/api/v2/collections/top` | GET | Top collections by volume/sales/floor |
| `/api/v2/collections/batch` | POST | Fetch multiple collections by slug in one request |
| `/api/v2/collections/{slug}/offer_aggregates` | GET | Top offers grouped by price level |
| `/api/v2/collections/{slug}/holders` | GET | Holders ranked by quantity owned |
| `/api/v2/collections/{slug}/floor_prices` | GET | Floor-price history |

### NFTs

Expand All @@ -50,6 +54,9 @@ List endpoints support cursor-based pagination:
| `/api/v2/chain/{chain}/account/{address}/nfts` | GET | NFTs by wallet |
| `/api/v2/chain/{chain}/contract/{contract}/nfts` | GET | NFTs by contract |
| `/api/v2/nft/{contract}/{token_id}/refresh` | POST | Refresh NFT metadata |
| `/api/v2/nfts/batch` | POST | Fetch multiple NFTs in one request |
| `/api/v2/chain/{chain}/contract/{contract}/nfts/{token_id}/owners` | GET | Owners of an NFT (paginated for ERC-1155s) |
| `/api/v2/chain/{chain}/contract/{contract}/nfts/{token_id}/analytics` | GET | Historical sale points for an NFT |

### Listings

Expand All @@ -60,6 +67,7 @@ List endpoints support cursor-based pagination:
| `/api/v2/orders/{chain}/seaport/listings` | POST | Create new listing |
| `/api/v2/listings/fulfillment_data` | POST | Get buy transaction data |
| `/api/v2/listings/sweep` | POST | Bulk-buy items from a collection |
| `/api/v2/listings/actions` | POST | Ordered approval + sign actions to create listings |

### Offers

Expand Down Expand Up @@ -93,13 +101,47 @@ List endpoints support cursor-based pagination:
| `/api/v2/drops` | GET | List drops (featured, upcoming, recently_minted) |
| `/api/v2/drops/{slug}` | GET | Detailed drop info with stages and supply |
| `/api/v2/drops/{slug}/mint` | POST | Build mint transaction data |
| `/api/v2/drops/deploy` | POST | Build deploy-contract transaction for a new drop |
| `/api/v2/drops/deploy/{chain}/{tx_hash}/receipt` | GET | Receipt for a previously submitted deploy transaction |

### Accounts

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/v2/accounts/{address}` | GET | Account profile |
| `/api/v2/accounts/resolve/{identifier}` | GET | Resolve ENS name, username, or address |
| `/api/v2/account/{address}/portfolio` | GET | Portfolio stats (net worth, P&L) |
| `/api/v2/account/{address}/portfolio/history` | GET | Portfolio net-worth history |
| `/api/v2/account/{address}/offers` | GET | Active offers made by an account |
| `/api/v2/account/{address}/offers_received` | GET | Offers received by an account |
| `/api/v2/account/{address}/listings` | GET | Active listings for an account |
| `/api/v2/account/{address}/favorites` | GET | Items favorited by an account |
| `/api/v2/account/{address}/collections` | GET | Collections owned by an account |

### Tokens

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/v2/tokens/batch` | POST | Fetch multiple tokens in one request |
| `/api/v2/chain/{chain}/token/{address}/price_history` | GET | Token price history |
| `/api/v2/chain/{chain}/token/{address}/ohlcv` | GET | OHLCV candles for a token |
| `/api/v2/chain/{chain}/token/{address}/activity` | GET | Recent swap activity for a token |
| `/api/v2/chain/{chain}/token/{address}/holders` | GET | Paginated holders + aggregate distribution health |
| `/api/v2/chain/{chain}/token/{address}/liquidity-pools` | GET | Liquidity pools for a token |

### Tools

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/v2/tools` | GET | List registered tools (sort by newest/oldest, filter by type) |
| `/api/v2/tools/search` | GET | Search tools by keyword, tags, creator, access type |
| `/api/v2/tools/{registry_chain}/{registry_addr}/{tool_id}` | GET | Get a specific registered tool |

### Assets

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/v2/assets/transfer` | POST | Build transactions to transfer NFTs or tokens between wallets |

### Swap & Transactions

Expand Down
2 changes: 1 addition & 1 deletion opensea/opensea-api/references/stream-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Send every ~30 seconds:

## Notes
- Stream is WebSocket-based, not HTTP. curl is not suitable.
- Use scripts/opensea-stream-collection.sh (websocat preferred).
- Use scripts/stream/opensea-stream-collection.sh (websocat preferred).
16 changes: 16 additions & 0 deletions opensea/opensea-api/scripts/_response-markers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Boundary markers wrapping API responses (DIS-83). Sourced by opensea-get.sh
# and opensea-post.sh. Markers always go to stderr so stdout stays valid JSON
# for `| jq` pipelines; the body is written to the function's stdout, which
# the caller redirects to stderr in error paths.
#
# Usage:
# emit_response "$tmp_body" # success path — body to stdout
# emit_response "$tmp_body" >&2 # error path — body to stderr

emit_response() {
echo "--- BEGIN OPENSEA API RESPONSE ---" >&2
cat "$1"
printf '\n'
echo "--- END OPENSEA API RESPONSE ---" >&2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
echo "Usage: opensea-account-collections.sh <address> [limit] [after] [chains]" >&2
echo "Get collections owned by an account" >&2
exit 1
fi

address="$1"
limit="${2:-20}"
after="${3:-}"
chains="${4:-}"

query="limit=$limit"
[ -n "$after" ] && query="$query&after=$after"
[ -n "$chains" ] && query="$query&chains=$chains"

"$(dirname "$0")/../opensea-get.sh" "/api/v2/account/${address}/collections" "$query"
23 changes: 23 additions & 0 deletions opensea/opensea-api/scripts/accounts/opensea-account-favorites.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
echo "Usage: opensea-account-favorites.sh <address> [limit] [after] [sort_by] [sort_direction] [chains]" >&2
echo "Get items favorited by an account" >&2
exit 1
fi

address="$1"
limit="${2:-20}"
after="${3:-}"
sort_by="${4:-}"
sort_direction="${5:-}"
chains="${6:-}"

query="limit=$limit"
[ -n "$after" ] && query="$query&after=$after"
[ -n "$sort_by" ] && query="$query&sort_by=$sort_by"
[ -n "$sort_direction" ] && query="$query&sort_direction=$sort_direction"
[ -n "$chains" ] && query="$query&chains=$chains"

"$(dirname "$0")/../opensea-get.sh" "/api/v2/account/${address}/favorites" "$query"
25 changes: 25 additions & 0 deletions opensea/opensea-api/scripts/accounts/opensea-account-listings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
echo "Usage: opensea-account-listings.sh <address> [limit] [after] [collection_slugs] [chains] [sort_by] [sort_direction]" >&2
echo "Get active listings for an account" >&2
exit 1
fi

address="$1"
limit="${2:-20}"
after="${3:-}"
collection_slugs="${4:-}"
chains="${5:-}"
sort_by="${6:-}"
sort_direction="${7:-}"

query="limit=$limit"
[ -n "$after" ] && query="$query&after=$after"
[ -n "$collection_slugs" ] && query="$query&collection_slugs=$collection_slugs"
[ -n "$chains" ] && query="$query&chains=$chains"
[ -n "$sort_by" ] && query="$query&sort_by=$sort_by"
[ -n "$sort_direction" ] && query="$query&sort_direction=$sort_direction"

"$(dirname "$0")/../opensea-get.sh" "/api/v2/account/${address}/listings" "$query"
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ if [ -n "$next" ]; then
fi
fi

"$(dirname "$0")/opensea-get.sh" "/api/v2/chain/${chain}/account/${address}/nfts" "$query"
"$(dirname "$0")/../opensea-get.sh" "/api/v2/chain/${chain}/account/${address}/nfts" "$query"
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
echo "Usage: opensea-account-offers-received.sh <address> [limit] [after] [collection_slugs] [chains] [sort_by] [sort_direction]" >&2
echo "Get offers received by an account" >&2
exit 1
fi

address="$1"
limit="${2:-20}"
after="${3:-}"
collection_slugs="${4:-}"
chains="${5:-}"
sort_by="${6:-}"
sort_direction="${7:-}"

query="limit=$limit"
[ -n "$after" ] && query="$query&after=$after"
[ -n "$collection_slugs" ] && query="$query&collection_slugs=$collection_slugs"
[ -n "$chains" ] && query="$query&chains=$chains"
[ -n "$sort_by" ] && query="$query&sort_by=$sort_by"
[ -n "$sort_direction" ] && query="$query&sort_direction=$sort_direction"

"$(dirname "$0")/../opensea-get.sh" "/api/v2/account/${address}/offers_received" "$query"
25 changes: 25 additions & 0 deletions opensea/opensea-api/scripts/accounts/opensea-account-offers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
echo "Usage: opensea-account-offers.sh <address> [limit] [after] [collection_slugs] [chains] [sort_by] [sort_direction]" >&2
echo "Get active offers made by an account" >&2
exit 1
fi

address="$1"
limit="${2:-20}"
after="${3:-}"
collection_slugs="${4:-}"
chains="${5:-}"
sort_by="${6:-}"
sort_direction="${7:-}"

query="limit=$limit"
[ -n "$after" ] && query="$query&after=$after"
[ -n "$collection_slugs" ] && query="$query&collection_slugs=$collection_slugs"
[ -n "$chains" ] && query="$query&chains=$chains"
[ -n "$sort_by" ] && query="$query&sort_by=$sort_by"
[ -n "$sort_direction" ] && query="$query&sort_direction=$sort_direction"

"$(dirname "$0")/../opensea-get.sh" "/api/v2/account/${address}/offers" "$query"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
echo "Usage: opensea-account-portfolio-history.sh <address> [timeframe]" >&2
echo "Get portfolio net-worth history. Timeframes: HOUR, DAY, WEEK, MONTH" >&2
exit 1
fi

address="$1"
timeframe="${2:-}"

query=""
if [ -n "$timeframe" ]; then
query="timeframe=$timeframe"
fi

"$(dirname "$0")/../opensea-get.sh" "/api/v2/account/${address}/portfolio/history" "$query"
18 changes: 18 additions & 0 deletions opensea/opensea-api/scripts/accounts/opensea-account-portfolio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
echo "Usage: opensea-account-portfolio.sh <address> [timeframe]" >&2
echo "Get portfolio stats (net worth, P&L). Timeframes: HOUR, DAY, WEEK, MONTH" >&2
exit 1
fi

address="$1"
timeframe="${2:-}"

query=""
if [ -n "$timeframe" ]; then
query="timeframe=$timeframe"
fi

"$(dirname "$0")/../opensea-get.sh" "/api/v2/account/${address}/portfolio" "$query"
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ fi

identifier="$1"

"$(dirname "$0")/opensea-get.sh" "/api/v2/accounts/resolve/${identifier}"
"$(dirname "$0")/../opensea-get.sh" "/api/v2/accounts/resolve/${identifier}"
13 changes: 13 additions & 0 deletions opensea/opensea-api/scripts/assets/opensea-assets-transfer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
echo "Usage: opensea-assets-transfer.sh <body_json>" >&2
echo "Returns ready-to-sign transactions for transferring NFTs or tokens between wallets." >&2
echo "Body shape: { \"from_address\": \"0x...\", \"to_address\": \"0x...\", \"assets\": [ { \"chain\": ..., \"contract\": ..., \"token_id\": ..., \"quantity\": ... } ] }" >&2
exit 1
fi

body="$1"

"$(dirname "$0")/../opensea-post.sh" "/api/v2/assets/transfer" "$body"
Loading