Skip to content

Latest commit

 

History

History
123 lines (92 loc) · 4.3 KB

File metadata and controls

123 lines (92 loc) · 4.3 KB

CLI Reference

Full command reference for all opensea CLI commands.

Global Options

--api-key <key>     OpenSea API key (or set OPENSEA_API_KEY env var)
--chain <chain>     Default chain (default: ethereum)
--format <format>   Output format: json, table, or toon (default: json)
--base-url <url>    API base URL override (for testing against staging or proxies)
--timeout           Request timeout in milliseconds (default: 30000)
--verbose           Log request and response info to stderr

Authentication

opensea whoami

whoami reads the current local auth token and shows the wallet address, requested and granted scopes, any broader-scope warning, the scope source, and expiry. Use opensea whoami --diagnostic to inspect decoded JWT claims and scope differences. Those claims are unverified, provider-specific diagnostics only and never authorization data.

Login

opensea login [--scopes <scopes>] [--client-id <id>] [--device] [--no-browser]
opensea login --private-key --scopes <scopes>
opensea login --private-key <key> --scopes <scopes>

login obtains a scoped access token and stores it in ~/.opensea/auth.json. By default it runs the OAuth 2.1 authorization-code flow in a browser. Use --device for headless environments or --no-browser to print the authorization URL. Pass --private-key to authenticate with SIWE instead of OAuth, which is useful for server-side agents. Set OPENSEA_PRIVATE_KEY and use --private-key without a value to keep the key out of shell history; a raw key can be passed as an option value when necessary. Private-key login requires --scopes so the agent's capabilities are always explicit.

Collections

opensea collections get <slug>
opensea collections list [--chain <chain>] [--order-by <field>] [--creator <username>] [--include-hidden] [--limit <n>] [--next <cursor>]
opensea collections stats <slug>
opensea collections traits <slug>

--order-by values: created_date, one_day_change, seven_day_volume, seven_day_change, num_owners, market_cap

NFTs

opensea nfts get <chain> <contract> <token-id>
opensea nfts list-by-collection <slug> [--limit <n>] [--next <cursor>]
opensea nfts list-by-contract <chain> <contract> [--limit <n>] [--next <cursor>]
opensea nfts list-by-account <chain> <address> [--limit <n>] [--next <cursor>]
opensea nfts refresh <chain> <contract> <token-id>
opensea nfts contract <chain> <address>

Listings

opensea listings all <collection> [--limit <n>] [--next <cursor>]
opensea listings best <collection> [--limit <n>] [--next <cursor>]
opensea listings best-for-nft <collection> <token-id>

Offers

opensea offers all <collection> [--limit <n>] [--next <cursor>]
opensea offers collection <collection> [--limit <n>] [--next <cursor>]
opensea offers best-for-nft <collection> <token-id>
opensea offers traits <collection> --type <type> --value <value> [--limit <n>] [--next <cursor>]

Events

opensea events list [--event-type <type>] [--after <timestamp>] [--before <timestamp>] [--chain <chain>] [--limit <n>] [--next <cursor>]
opensea events by-account <address> [--event-type <type>] [--chain <chain>] [--limit <n>] [--next <cursor>]
opensea events by-collection <slug> [--event-type <type>] [--limit <n>] [--next <cursor>]
opensea events by-nft <chain> <contract> <token-id> [--event-type <type>] [--limit <n>] [--next <cursor>]

Event types: sale, transfer, mint, listing, offer, trait_offer, collection_offer (details)

Search

opensea search <query> [--types <types>] [--chains <chains>] [--limit <n>]

--types values (comma-separated): collection, nft, token, account

Tokens

opensea tokens trending [--chains <chains>] [--limit <n>] [--next <cursor>]
opensea tokens top [--chains <chains>] [--limit <n>] [--next <cursor>]
opensea tokens get <chain> <address>

Swaps

opensea swaps quote --from-chain <chain> --from-address <address> --to-chain <chain> --to-address <address> --quantity <quantity> --address <address> [--slippage <slippage>] [--recipient <recipient>]

Accounts

opensea accounts get <address>

REST list commands support cursor-based pagination. The search command returns a flat list with no cursor. See pagination.md for details.