Search API Connector Documentation
Import Shopify Data to Google Sheets
In this guide, we’ll walk through how to pull data from the Shopify API directly into Google Sheets, using the API Connector add-on for Sheets.
The nice thing about this method is that you can access the entire set of functionality available via Shopify's API, from pulling in transactions to updating product specs.
- Before You Begin
- Part 1: Get your Shopify Admin API Access Token
- Part 2: Pull Data from Shopify to Sheets
- Part 3: Get New Data Only
- Part 4: Create a Custom Request
- Part 5: Handle Pagination
- Part 6: Sales Template
- Part 7: API Documentation
Before You Begin
Click here to install the API Connector extension from the Google Marketplace.
Part 1: Get Your Shopify Admin Access Token
- Log into your Shopify store and click Apps
- From here, click Develop apps
- From here, click the Create an app button
- You'll see a modal prompting you to name your app and assign an app developer. Give it a name and click Create app.
- You'll now be on your app overview screen. Click Configure Admin API scopes.
- The next section is where you search for and select which data points you'd like to have access to via the API. Most likely, you will want access to at least one or more of the following: read_orders, read_products, read_inventory, and read_customers.
- Once you've selected all the scopes you want to access, click Save. (You can add more scopes later if you need to)
- Head over to the API credentials tab and click Install app.
- Confirm the installation and you should now see a screen containing your Admin API access token. Click Reveal token once, and store it safely as we'll need it soon. Congrats, you’re done! You now have access to the Shopify API.
Part 2: Pull Data from Shopify to Sheets
The easiest way to get started with the Shopify API is through API Connector’s built-in integration.
- In Sheets, open API Connector and create a new request (Extensions > API Connector > Open > Create request)
- Select Shopify from the drop-down list of applications
- Under Authorization, enter your API token
- Select an endpoint. We’ll start by pulling in a simple orders report
- Under the shop parameter, enter your shop name. For example, if your admin URL is
https://oj-stand.myshopify.com/admin, your shop name is
oj-stand. You can also find your shop name by navigating to your store page, right-clicking View Page Source and searching for "Shopify.shop" in the HTML source code.
- Set a destination sheet, name your request, and click Run to see response data in your sheet.
Part 3: Get New Data Only
Rather than retrieving the entire data set each time you run your request, you can set your request to fetch new data only. There are a few approaches you could take; here’s one:
- Run a request to the
/ordersendpoint that includes the field
- Use the field editor to select just the fields you want and assign them to specific columns in your report.
- In a second sheet, get the maximum (i.e. most recent) id from that response with a formula like
- Now reference that max ID in the
since_idparameter of your request
- This will ensure that each request starts from the end of the prior data pull. Select Append mode to add each new data pull to the end of your existing dataset.
- Set your request to run on a schedule. You won’t need to update your request again.
Part 4: Create a Custom 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, just substitute in your own shop name and token.
- Request URL:
- OAuth: None
Part 4: Handle Pagination
- By default, Shopify limits the number of responses returned at once, usually to 50 records at a time.
To get more, set the
limitparameter to 250.
- To automatically loop through and grab multiple pages of 250 records, use pagination handling (paid feature), like this:
- Pagination type:
next page URL
- Next page path:
- Run until: choose when to stop fetching data
- Pagination type:
Part 6: Sales Template
Here's a template you can use to fetch a sales summary that looks like this:
Report template link: Click here
Part 7: API Documentation
Official documentation: https://shopify.dev/api/admin-rest