HapPhi has built an easy to use bulk NFT upload integration to OpenSea. For those Developers used Google Cloud Storage to upload NFTs to OpenSea in this post. The first step in the process was to create an OpenSea API key, download the OpenSea Node Package, and import their NFT files. After importing their GCS files into MongoDB and exporting them as JSON files without the “nft” prefix, they imported them into MongoDB and exported them as JSON files. Finally, the JSON file was sent to OpenSea as part of the bulk upload process by using the “upload” command. https://www.happhi.com
June 15, 2022
Native token (NFT) adoption is growing exponentially, with over $200M of new NFTs minted in the first week of October alone. New users are joining the ecosystem every day, opening up new opportunities for both developers and investors alike. To facilitate this growth, many companies have launched services to make it easier for users to manage their digital assets across different platforms. OpenSea has emerged as one of the leading marketplaces for NFTs; in fact, they recently crossed 1 million total transactions and 200k registered users. Now that you’ve decided to add NFT support to your own project, how do you bulk upload your existing tokens so they’re ready to trade on OpenSea? In this article we’ll walk you through the process with step-by-step instructions on how to bulk upload NFTs to OpenSea.
HapPhi has built this out in the product so you don't have to build this yourself.
Create an OpenSea API Key
The first step in the process is to create an OpenSea API Key. This will allow you to authenticate with the OpenSea platform, allowing you to access and modify data. Once you’ve logged in to OpenSea, navigate to the “My Account” page to find the “API Key” area. You can then create a new key by clicking the “New API Key” button. Next, you’ll need to decide which type of key you’ll be using. There are two options: “Read-Only” or “Read/Write”, each with their own specific use cases. Read-Only keys are meant for machine-to-machine communication where the key is only reading data. If you’re using OpenSea as a third-party service to manage your NFT collection and you don’t want to modify or create data on the platform, then a Read-Only key is the best choice. Read/Write keys are meant for situations where the key will read and write data to the platform. This is the appropriate option for managing your own NFT collection.
Before You Start
Before you begin the import process, you’ll want to make sure you have the following information ready: - A project ID - A project description - An OpenSea API Key You’ll also want to review the OpenSea deposit and withdrawal fees to understand how they’ll apply to your NFTs when they’re ready to trade on the platform. Remember, you can always adjust your pricing after you’ve uploaded your assets.
Install the OpenSea Node Package
The next step is to install the OpenSea Node Package. This package makes it easy to create and manage assets in your own workflow, including the ability to bulk upload NFTs. Once you’ve added the package, you’ll have access to a couple of new functions. One, in particular, is what you’re looking for: “addAsset”. This function will help you bulk upload your NFTs. Before you can use this function, you’ll need to set up a few variables. First, you’ll want to set your OpenSea API key as a global variable. You can do this by adding a function at the top of your script: Next, you’ll want to set a “destination”. This is the address where OpenSea will send your data once you’ve made the upload request. You can do this using the “setDestination” function in the OpenSea Node Package.
Step 1: Import your NFT files into Google Cloud Storage (GCS)
The first step in the process is to upload your NFT asset files to a cloud storage service like Google Cloud Storage. There are a few good reasons why you might want to do this. For example, it might be difficult to download your NFT files from your application or database. Or, you might want to make a backup of your NFT data in case the original files are lost or corrupted. Whatever your reasoning, uploading your NFTs to a cloud storage service like GCS is a good first step in the bulk upload process. Once you’ve uploaded your NFT files to GCS, you’ll need to create a bucket and make a note of the “bucket name” and “bucket path”. You’ll use these two pieces of information to start the upload process. The bucket path will look something like: “nft://nft-files-bucket/file-name-1”
Step 2: Import your GCS file into MongoDB
Next, you’ll need to import your GCS files into MongoDB. This process can be a bit tricky and is different for each database. Luckily, there are tutorials for importing GCS to any database, including MongoDB. You’ll want to select the “GCS” option when importing your files. You’ll then need to select the bucket path and the file path you want to import. Once you’ve completed the import process, you’ll want to make a note of the “host”, “port”, “database”, and “collection” where you imported your data. You’ll use these values when creating the bulk upload request. Your database settings should look something like this:
Step 3: Export your data from MongoDB and import to OpenSea
Now that you’ve imported your NFT assets to MongoDB, it’s time to export them and create an upload request with OpenSea. You can use the “export” command to export your data from MongoDB to a JSON file. You’ll then need to edit the JSON file to remove the “nft” prefix from each data field, resulting in a file that looks like this: Once you’ve completed these steps, you’re ready to import your assets to OpenSea. You can do this by sending the data file to your OpenSea “destination” using the “upload” command. Once OpenSea has verified your assets, they’ll be ready to trade and be visible on their marketplace!
This article explored how to bulk upload NFTs to OpenSea. To start the process, developers needed to create an OpenSea API key, install the OpenSea Node Package, and import their NFT files to Google Cloud Storage. Next, they imported their GCS files into MongoDB and exported them to a JSON file without the “nft” prefix. Finally, they sent the JSON file to their OpenSea “destination” using the “upload” command to complete the bulk upload process.