Crypto API tutorials and more:
OpenSea is the first and largest peer-to-peer marketplace for cryptogoods (like an eBay for crypto assets), which include collectibles, gaming items, and other virtual goods backed by a blockchain.
We can use the OpenSea API to import data from OpenSea into Google Sheets. In this tutorial, I’ll show you how to connect the OpenSea API to Google Sheets in 5 steps:
To pull data from the OpenSea API to Google Sheets, first install and open the Apipheny Google Sheets add-on.
Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs, save API requests, schedule API requests, and more.
1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the page: https://apipheny.io/install
2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons or Extensions option in the top menu. In the add-ons menu, you should see Apipheny.
Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.
To be able to use the OpenSea API without restrictions, you need to request an API key. Start by going to: https://docs.opensea.io/reference/request-an-api-key
The request form was created using Google Forms and you’ll first need to select a Gmail account to use for receiving your API key:
Next, complete the other required fields and click the Submit button:
After submitting the form, you should see an acknowledgement message:
Wait a couple of days for the API key to arrive in your email inbox.
In this section, we’ll show you how to browse the OpenSea API documentation to find the API endpoint that retrieves the information you need from your account. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 4.
First, open the OpenSea API documentation page: https://docs.opensea.io/reference/api-overview
The menu on the left contains links to overview pages for the OpenSea APIs, their objects and endpoints:
An example endpoint is Retrieving assets, which returns a list of digital items managed on the platform. The URL for this endpoint is:
The endpoint’s documentation contains the endpoint’s HTTP method (GET) and its URI, a list of the API calls you’ve made to it in the past, a description of the endpoint’s functionality and parameter usage, a table with the accepted parameters and their descriptions, as well as sample requests in Curl and in various programming languages:
The query parameters can be assigned values and you can press the Try It! button under the currently-selected sample request, to perform the call and see the response:
After you receive your API key, you can use the key for making API calls, by pasting it in the dedicated field from the HEADERS table, under the parameters:
Base domains for API calls depend on the particular API you’re using:
OpenSea API base domains: https://api.opensea.io/api/v1/ for the main OpenSea API https://api.opensea.io/wyvern/v1/ for the OpenSea Orderbook API https://rinkeby-api.opensea.io/api/v1/ for the OpenSea Rinkeby Test Network API
The Retrieve assets endpoint, which returns a set of NFTs based on the specified filter parameters.
Method: GET API URL Path: https://api.opensea.io/api/v1/assets Headers: Header 1 Key: X-API-KEY Header 1 Value: your API key, which you obtained via email in Step 2
The Retrieve listings endpoint, which fetches the set of active listings on a given NFT for the Seaport contract.
Method: GET API URL Path: https://api.opensea.io/v2/orders/ethereum/seaport/listings Headers: Header 1 Key: X-API-KEY Header 1 Value: your API key, which you obtained via email in Step 2
The Retrieve offers endpoint, which fetches the set of active offers on a given NFT for the Seaport contract.
Method: GET API URL Path: https://api.opensea.io/v2/orders/ethereum/seaport/offers Headers: Header 1 Key: X-API-KEY Header 1 Value: your API key, which you obtained via email in Step 2
The Retrieve collection offers (Beta) endpoint, which gets collection offers.
Method: GET API URL Path: https://api.opensea.io/v2/offers/collection Headers: Header 1 Key: X-API-KEY Header 1 Value: your API key, which you obtained via email in Step 2
Pagination is a process that is used to divide a large dataset into smaller chunks (pages). Usually the endpoints that return a list of resources support pagination.
Some of the OpenSea API endpoints use the pagination option. This means you need to add pagination some of these parameters at the end of the URL:
next– a cursor to be supplied as a query param to retrieve the next page;
previous– a cursor to be supplied as a query param to retrieve the previous page;
limit– the maximum number of records that will be returned for each page.
Each endpoint that needs pagination will have in its documentation relevant information on which of these parameters you can use and how to do it.
If you use the URL above, you will receive a response containing a page of offers orders by created_date with a limit of 40 orders per page, and a value for the next parameter. That’s what you get when you first run the request.
To get the next page of orders (the next 40 records) you will add in your link the next parameter like this:
Don’t forget to replace next_value with the value for the next parameter that you obtained in the response from the first call.
For this second call, you will also get a previous parameter, because now the previous page is the first page, the current page is the second page and the next page is the third one.
Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the Import tab. With the Import tab open, enter these details into the add-on:
API URL: In Step 3, we explained how you can find the OpenSea REST API endpoint that you need. Now copy and paste your complete OpenSea API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).
For this example, we are using the Retrieving a single contract endpoint, which returns details about a single contract managed on the platform. This is what the whole URL looks like:
If you use this URL, you should replace asset_contract_address with the actual address of the contract for an NFT.
Headers: In the Headers section of Apipheny, add one row with the following key and value:
Header Key: X-API-KEY Value: your API key, which you obtained via email in Step 2
Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the OpenSea API data to be imported into your Google Sheet. Here’s what our request looked like when completed:
After making a successful request to the OpenSea API, try querying a different OpenSea API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:
Alpha Vantage API
Constant Contact API
Facebook Graph API
Facebook Ads API
Google SERP API
Linkedin Ads API
Product Hunt API
Reddit Ads API
Riot Games API