Actor picture

Opensea Collection Scraper

dhrumil/opensea-collection-scraper

Opensea NFT collection scraper for Apify which helps you extract complete list of all assets from given collection.

Free trial for 3 days

Then $30/month

No credit card required now

Author's avatarDhrumil Bhankhar
  • Modified
  • Users111
  • Runs714
Actor picture
Opensea Collection Scraper

Free trial for 3 days

Then $30/month

Features

This OpenSea collection Scraper will enable you scrape any collection from OpenSea.io.

OpenSea is also providing APIs but they come with unexplained throttling & community is screaming about it! More about it on this github issue

So, OpenSea API doesn't help here reliably if you want to get complete list of all tokens in particular collection. Moreover, if you visit any collection on website, you will find same token listed more than once on listing page.

So, even with website users there is no official way to get complete detail of collection tokens. Whether you are doing this for your next analysis project, investment analysis or even if you are owner of the collection, this scraper will help you to get complete list of all the tokens in particular collection.

Input

Input example

For simple usecase, you just need to provide browser url of opensea collection & that's all. You can leave other fields as they are to be sensible defaults.

{
  "startUrls": [
    {
      "url": "https://opensea.io/collection/parallelalpha"
    }
  ],
  "scrapeProperties": false,
  "generateAssetFile": false,
  "downloadImages": false,
  "extendOutputFunction": "(asset) => {
        const result = {};
        // Uncomment to add a asset id to the output
        // result.id = asset.id;
        return result;
    }",
}

If you want some more customization :

  • scrapeProperties : This option will enable scraper to go deeper into scraping to retrive more information about each asset. Please consider that turning this on will take more scraping time

  • generateAssetFile : This option will generate separate JSON file for each asset. You can find zipped file under Apify 'assets' key value store output once process is complete. This zip will contain all json files under single folder.

  • downloadImages : This option will download image for each asset and generate zip folder of the same. You can find zipped file under Apify 'images' key value store output once process is complete. This zip will contain all image files under single folder. This option will take considerable amount of memory. Please provide enough memory to the actor if you are enabling it. (4GB memory required)

Output

The scraped data is stored in the dataset of each run. The data can be viewed or downloaded in many popular formats, such as JSON, CSV, Excel, XML, RSS, and HTML.

Output example

The result for scraping a single token like this:

{
  "tokenId": "6",
  "name": null,
  "collection": "Bored Ape Yacht Club",
  "collectionSlug": "boredapeyachtclub",
  "imageUrl": "https://img.seadn.io/files/8d34186c8c41631bff187d1b8810bc36.png?fit=max&h=1200&w=1200&auto=format",
  "contractAddress": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
  "chain": "ETHEREUM",
  "favoritesCount": 114,
  "bestAsk": 199.69,
  "bestAskUsd": 257560.16,
  "url": "https://opensea.io/assets/ethereum/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/6",
  "imageName": "boredapeyachtclub-6.avif",
  "owner": "820425",
  "ownerLink": "https://opensea.io/0x820425d330F777370aCF68E45F884547e98dB2C0",
  "views": "9.0K",
  "attributes": [
    {
      "trait_type": "Background",
      "value": "Yellow",
      "rarity": "13%"
    },
    {
      "trait_type": "Clothes",
      "value": "Tweed Suit",
      "rarity": "1%"
    },
    {
      "trait_type": "Eyes",
      "value": "Crazy",
      "rarity": "4%"
    },
    {
      "trait_type": "Fur",
      "value": "Cream",
      "rarity": "6%"
    },
    {
      "trait_type": "Hat",
      "value": "S&m Hat",
      "rarity": "2%"
    },
    {
      "trait_type": "Mouth",
      "value": "Bored",
      "rarity": "23%"
    }
  ]
}

Modify the output

There is an additional input extendOutputFunction provided using which you can customize the output JSON. If you are good with Javascript, you can simply edit this default function to your use-case and override the output.

Limitations

Since opensea supports browsing only upto 10K items in collection, it's advisible to use this actor for collection upto the size of 10K & max upto 20K.

For custom solutions

In case you need some custom solution, you can contact me : dhrumil@techvasu.com

Or learn more about me on github : https://github.com/dhrumil4u360

Industries

See how Opensea Collection Scraper is used in industries around the world