Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get all the NFTs of particular smart contract

I tried https://docs.opensea.io/reference opensea.io docs to fetch data. However, I think there are 2 APIs.

curl --request GET \
     --url https://api.opensea.io/api/v1/asset/0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb/1/

This is for a single asset and it requires a token id as well. But I want data of all the NFTs of a particular smart contract address just by giving the smart contract address.

And this is for a single contract.

curl --request GET \
     --url https://api.opensea.io/api/v1/asset_contract/0x06012c8cf97bead5deae237070f9587f8e7a266d
like image 447
Haider Yaqoob Avatar asked Oct 27 '25 11:10

Haider Yaqoob


1 Answers

The assets endpoint (docs) has the asset_contract_address filter that allows you to filter by a contract address. Which will effectively allow you to paginate through all NFTs of the contract (that Opensea knows of).

Example:

curl 'https://api.opensea.io/api/v1/assets?offset=0&limit=20&asset_contract_address=0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb'
like image 74
Petr Hejda Avatar answered Oct 29 '25 02:10

Petr Hejda