Search API Connector Documentation
Import OpenSea Data to Google Sheets
In this guide, we’ll walk through how to pull data from the OpenSea API directly into Google Sheets, using the API Connector add-on for Sheets.
Contents
- Before You Begin
- Part 1: Get OpenSea API Key
- Part 2: Create your API Request URL
- Part 3: Pull OpenSea API Data into Sheets
- Part 4: More Example API Requests
- Part 5: Handle Pagination
- Part 6: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get Your OpenSea API Key
The OpenSea API is open and public for limited use, so you don’t need a key if you’re just testing it out.
However, if you plan to use the API in any substantial capacity, I recommend getting your own API key so you don’t get rate-limited.
To get an OpenSea API key, fill out the request form here: https://docs.opensea.io/reference/request-an-api-key. You’ll need to have some ETH in your wallet.
Part 2: Create Your API Request
For our first request, we’ll retrieve a list of collections.
- Base URL: https://api.opensea.io/api/v1
- Endpoint: /collections
- Query parameter: ?limit=300
The query parameter is optional, but we’ll include it to get more records. Putting it all together, we get our request URL:
https://api.opensea.io/api/v1/collections?limit=300
Part 3: Pull OpenSea API Data into Sheets
We can now enter this into API Connector.
- Open up Google Sheets and click Extensions > API Connector > Open.
- Copy the request URL we created into the URL field.
- We don’t need extra authentication so just leave OAuth as None.
- Under Headers, enter Key = Accept, Value = application/json. If you have an API key, enter a second header where Key = X-API-KEY, and Value = your_api_key.
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see a list of collections populate your Google Sheet.
Part 4: More Example API Requests
You can view the full set of endpoints in the API documentation, but if you just want to get started, try out the following example requests.
- Get the floor price and other stats for a specific collection. Substitute in your own collection slug where you see doodles-official.
https://api.opensea.io/api/v1/collection/doodles-official/stats
- Get assets
https://api.opensea.io/api/v1/assets
- Get events
https://api.opensea.io/api/v1/events
Part 5: Handle Pagination
OpenSea will generally limit the number of records returned at once, unless you loop through using the parameters shown in their documentation. The specific parameters depend on the endpoint:
Assets and events endpoints
Assets and event endpoints return just 20 records unless you use the “limit” and “cursor” parameters.
In API Connector, you can loop through these automatically using pagination handling, like this:
- URL: enter your request URL, including limit=50
- Next token parameter:
cursor
- Next token path:
next
- Run until: choose when to stop fetching data
Collections & bundles endpoints
Collections and bundles endpoints use offset-limit parameters.
This would be automated like this:
- URL: enter your request URL (you don’t need a limit parameter in the URL as you’ll enter it below)
- Pagination type:
offset-limit
- Offset parameter:
offset
- Limit parameter:
limit
- Limit value:
300
- Run until: choose when to stop fetching data
Part 6: API Documentation
Official API documentation: https://docs.opensea.io/reference/api-overview