The OpenSea API uses cursor-based pagination. Paginated responses include a next field containing an opaque cursor string. Pass this cursor back to fetch the next page.
All paginated commands use --next <cursor>:
# First page
opensea collections list --limit 5
# The response includes a "next" cursor — pass it to get the next page
opensea collections list --limit 5 --next "LXBrPTEwMDA..."
# Tokens also use --next
opensea tokens trending --limit 5
opensea tokens trending --limit 5 --next "abc123..."collections listnfts list-by-collectionnfts list-by-contractnfts list-by-accountlistings alllistings bestoffers alloffers collectionoffers traitsevents listevents by-accountevents by-collectionevents by-nfttokens trendingtokens top
Note: The
searchcommand does not support cursor-based pagination. The search API returns a flat list with nonextcursor; use--limitto control result count (max 50).
SDK methods return a next cursor in the response object:
const client = new OpenSeaCLI({ apiKey: process.env.OPENSEA_API_KEY })
// First page
const page1 = await client.collections.list({ limit: 5 })
console.log(page1.collections)
// Next page
if (page1.next) {
const page2 = await client.collections.list({ limit: 5, next: page1.next })
}let cursor: string | undefined
do {
const result = await client.nfts.listByCollection("mfers", {
limit: 50,
next: cursor,
})
for (const nft of result.nfts) {
// process each NFT
}
cursor = result.next
} while (cursor)