'How to get the listed NFT of a collection on OPENSEA

Hey Im trying to get the listed nfts of a collection on opensea but its not working im using the API but for some reason all im getting a cloudflare block is there a way to bypass this is or be able to get the collection stats of a nft collection of every listed nft in python. I have tried a cloudflare bypass module but that sometimes is iffy.

import requests

url = "https://opensea.io/collection/clonex?tab=activity&search[isSingleCollection]=true&search[eventTypes][0]=AUCTION_CREATED"

headers = {
    "Accept": "application/json",
    "X-API-KEY": ""
}

response = requests.request("GET", url, headers=headers)

print(response.text)


Solution 1:[1]

https://docs.opensea.io/reference/getting-assets

Firstly, it should be "api.opensea.io" rather than "opensea.io".

Secondly, the name of the collection should be added as a parameter rather than being used directly.

You can try on the link above with your desired parameters.

In your case, for example, it should probably be something like this:

https://api.opensea.io/api/v1/assets?collection_slug=clonex&order_direction=desc&limit=20&include_orders=false

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Terry Windwalker