How to connect the Squarespace API to Google Sheets

Squarespace is one of the most popular website builders in the world.

In this tutorial, I’ll show you how to connect the Squarespace API to Google Sheets in 5 steps:

  1. Install the Apipheny Add-on
  2. Generate a Squarespace API key
  3. Choose a Squarespace API Endpoint URL
  4. Enter your Squarespace API Request into the Apipheny add-on
  5. Run the Squarespace API Request in your Google Sheets

Step 1.) Install and open the Apipheny Add-on in Google Sheets

To pull data from the Squarespace API into Google Sheets without writing any code, 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 API data sources, save your API requests, schedule API requests, and more. Click here for more info about Apipheny. There’s a free trial included.

1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the next page: https://gsuite.google.com/marketplace/app/apipheny/966163326746

Apipheny is available to install in the G-Suite Marketplace
Apipheny is available to install in the G-Suite Marketplace

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons 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.

Apipheny add-on opened in Google Sheets
Apipheny add-on opened in Google Sheets

Step 2.) Generate a Squarespace API key

Next, log in to your Squarespace account and in the left navigation menu, click Settings:

Click "settings" in your Squarespace account
Click “settings” in your Squarespace account

Then scroll down and click Advanced:

In the Settings menu, click “Advanced”

Then click Developer API Keys:

Click "Developer API Keys" in your Squarespace advanced settings
Click “Developer API Keys” in your Squarespace advanced settings

Click the GENERATE KEY button:

Click "Generate Key"
Click “Generate Key”

In the popup window, fill in the “KEY NAME” field and select one or more Commerce APIs under “PERMISSIONS”, along with their permission level, then click GENERATE KEY:

Enter your API name, choose your permissions, then click "Generate Key"
Enter your API name, choose your permissions, then click “Generate Key”

After your key is generated, click the Copy Key button and then paste your key to a safe location, because you will need it in the next steps:

Copy and paste your Squarespace API key to a safe location
Copy and paste your Squarespace API key to a safe location

Step 3.) Choose a Squarespace API Endpoint URL

In this section, I’ll show you how to browse the Squarespace API documentation to find an API endpoint URL that retrieves the specific information you need from your Squarespace account.

If you already know your API URL endpoint, or you want to use the same example URL as us, just skip to Step 4.

First, open the Squarespace API documentation page: https://developers.squarespace.com/commerce-apis/overview

The menu on the left contains a guide on how to use the Squarespace API and a list of all the available APIs (Inventory API, Orders API, Products API and Transactions API):

Squarespace API documentation
Squarespace API documentation

Each API has a list of specific endpoints. Clicking one of the available Squarespace API’s endpoints.

An example endpoint is the Retrieve all inventory endpoint from the Inventory API. Clicking on this endpoint will open its documentation page, which contains the endpoint’s HTTP method and URL, a short description of its purpose, a list of the accepted parameters, as well as a sample request and its associated sample response.

Here’s the API URL for this example endpoint:

https://api.squarespace.com/{api-version}/commerce/inventory?cursor={c}
"Retrieve all inventory" endpoint documentation - Squarespace API
“Retrieve all inventory” endpoint documentation – Squarespace API

All API calls to the Squarespace API should be made to the base/root URL:

https://api.squarespace.com/{api-version}/commerce/

All endpoints should be appended to this root domain.

Step 4.) Enter your Squarespace API Request into the Apipheny add-on

Okay, now we’re in the home stretch. 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:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) as required by your Squarespace API endpoint. For this example, we are using the GET method.

API URL: In Step 3, I explained how you can find the Squarespace API endpoint that you need. Now copy the complete API URL into the Apipheny add-on, where it says API URL Path (JSON / CSV), followed by any GET parameters required for your query.

For this example, we are using the “Retrieve all orders” endpoint, that retrieves all order information; orders can be filtered within a date range. The response contains order information in an Order, up to 50 Orders ordered by their modification date (modifiedOn). The corresponding URL for this endpoint is:

https://api.squarespace.com/{api-version}/commerce/orders

Headers: In the Headers section of the Apipheny add-on, add one row, with the following key and value:

Header
Key:
Authorization
Value:
Bearer <your_key>

Replace “<your_key>” with the value of the API key you obtained previously, in Step 2. There should be a literal space between Bearer and <your_key>. Do not include the brackets “<>” around your key.

Here’s what your Squarespace API request should look like when entered into the Apipheny add-on:

Squarespace API request entered into the Apipheny add-on
Squarespace API request entered into the Apipheny add-on

Step 5.) Run the Squarespace API Request in your Google Sheets

Once you have your Squarespace API details entered into Apipheny, the last step is to click the Run button at the bottom of the Apipheny add-on, and then your Squarespace API data will be imported into your Google Sheet.

Squarespace API data imported into Google Sheets using the Apipheny add-on
Squarespace API data imported into Google Sheets using the Apipheny add-on

That’s it! That’s how you can connect the Squarespace API to Google Sheets and pull your Squarespace account data into Google Sheets using Apipheny.

After making a successful request to the Squarespace API, try querying a different Squarespace API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:

  • Save and schedule your Squarespace API request
  • Make a POST request to the Squarespace API (if available)
  • Use the custom =APIPHENY() function to call the Squarespace API request inside a cell of your spreadsheet
  • Create an API request by referencing the value of a cell in your Squarespace API URL with three curly braces eg. {{{Sheet1!A1}}}

If you want to visualize your Squarespace data in Google Data Studio, just follow the same steps above, then connect your Google Sheet to Google Data Studio.

Import API into Google Sheets – Apipheny demo

Related articles:

Related Posts