Search API Connector Documentation

Print

Import Pinterest Ads Data to Google Sheets

premium

In this guide, we’ll walk through how to pull advertising data from the Pinterest API directly into Google Sheets, using the API Connector add-on for Sheets.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Connect to the API

To get started, let’s connect to the API and make a simple request.

  1. Open up Google Sheets and click Add-ons > API Connector > Open > Add New. You should now be in API Connector’s main Create screen.
  2. Enter https://api.pinterest.com/v5/ad_accounts into the URL field
  3. Choose Pinterest Ads from the dropdown menu. If you haven’t connected before you’ll also need to click the connect button to authenticate yourself.
    pinterest-ads-img1
  4. You’ll be sent to Pinterest and prompted to authorize the connection.
    pinterest-ads-img2
  5. Once you’re connected, you’ll see a Connected badge verifying that you’ve successfully authenticated yourself.
    pinterest-ads-img3
  6. We don’t need any headers here so just leave that section blank.
  7. Enter a name for your destination sheet, name and save the request, and click Run. You should now see a list of your ad account(s). Pay special attention to the ad ID, as you’ll need that for subsequent requests.
    pinterest-ads-img4

Part 2: Example API URLs

You can substitute in your own account / campaign IDs to run the request URLs below. These are just examples so you can see how it works; to see the full list of available parameters, please check their ad accounts documentation.

  • Ad account analytics
    https://api.pinterest.com/v5/ad_accounts/549763116512/analytics?start_date=2021-09-01&end_date=2021-09-15&columns=CTR,SPEND_IN_DOLLAR,TOTAL_CLICKTHROUGH&granularity=DAY
  • List campaigns
    https://api.pinterest.com/v5/ad_accounts/549763116512/campaigns
  • Campaign analytics
    https://api.pinterest.com/v5/ad_accounts/549763116512/campaigns/analytics?start_date=2021-09-01&end_date=2021-09-15&columns=CTR,SPEND_IN_DOLLAR,TOTAL_CLICKTHROUGH&granularity=DAY&campaign_ids=12345
  • List ad groups
    https://api.pinterest.com/v5/ad_accounts/549763116512/ad_groups

Part 3: Set Column Order

By default, API Connector prints fields in the order they come back from the API. In some cases, Pinterest may change the order in which they send back fields, which results in columns switching around.

To address this, you can fix your columns in place with a JMESPath expression. An example JMESPath for Pinterest would be like this:

[].{ad_account_id:AD_ACCOUNT_ID,spend_in_dollar:SPEND_IN_DOLLAR,date:DATE}

Just list out your fields in the order you’d like to appear and they will remain in that order.

Previous Import PayPal Data to Google Sheets
Next Import Pipedrive Data to Google Sheets

Leave a Comment

Table of Contents