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 an OpenSea API Key
- Part 2: Pull Data from OpenSea to Sheets
- Part 3: Create a Custom API Request
- Part 4: Handle Pagination
- Part 5: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get an 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: Pull Data from OpenSea to Sheets
The easiest way to get started with the OpenSea API is through API Connector’s built-in integration.
- Select OpenSea from the drop-down list of applications
- If you have an API key, enter it into the Authorization section
- Choose an endpoint. We’ll start with the
/collections
endpoint, which produces a list of recent collections. - Select a destination sheet, name your request, and click Run.
Part 3: Create a Custom API Request
Alternatively, you can run your own custom requests instead of using API Connector’s pre-built integration, using any of the endpoints and parameters shown in the API documentation. Here's an example request setup. If you have one, enter your API key where it says your_API_key
.
- Application:
Custom
- Method:
GET
- Request URL:
https://api.opensea.io/api/v1/collections?limit=300
- Headers:
X-API-Key
:your_API_key
Accept
:application/json
Part 4: 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:
- 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:
- Pagination type:
offset-limit
- Offset parameter:
offset
- Limit parameter:
limit
- Limit value:
300
- Run until: choose when to stop fetching data
Part 5: API Documentation
Official API documentation: https://docs.opensea.io/reference/api-overview