API Connector Documentation
Import Pinterest Ads Data to Google Sheets
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
- Part 1: Connect to the Pinterest Ads API
- Part 2: Get your Pinterest Ads Account ID
- Part 3: Fetch Data from Pinterest Ads into Sheets
- Part 4: Create a Custom Request
- Part 5: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Connect to the Pinterest Ads API
The easiest way to get started with the Pinterest Ads API is through API Connector’s built-in integration.
- Select Pinterest Ads from the drop-down listof applications
- Under Authorization, click Connect to Pinterest Ads
- You'll be sent to Pinterest and prompted to authorize the connection.
- You’ll then be returned to your Google Sheet, and can verify that your Pinterest Ads connection is now active.
Part 2: Get your Pinterest Ads Account ID
We’ll need your Pinterest account ID for subsequent requests, so let’s get it now. To get your account ID, login to your Pinterest Ads account and grab it from the main menu.
Alternatively, you can get your account ID via the API, using the /ad_accounts
endpoint.
Part 3: Fetch Data from Pinterest Ads into Sheets
Now that we’re connected, let’s pull some data into Sheets.
- Select the
/ad_accounts/{ad_account_id}/analytics
endpoint to retrieve account-level ad analytics - Fill in all required parameters:
ad_account_id
,start_date
,end_date
,columns
, andgranularity
. - Choose a destination sheet, name your request, and hit Run. A moment later you’ll see the response data in your sheet.
- In some cases, Pinterest changes the order in which they send back fields, which results in columns switching around. To address this, open API Connector's visual field editor by clicking Edit Fields.
- Here you can map fields to specific columns so that they stay "locked" in place even when Pinterest sends back the data in a different order.
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:
- Application:
Custom
- Method:
GET
- Request URL:
https://api.pinterest.com/v5/ad_accounts/your_account_id/analytics?start_date=2021-09-15&end_date=2021-09-30&columns=AD_ACCOUNT_ID,CLICKTHROUGH_1,CPC_IN_MICRO_DOLLAR,CTR,SPEND_IN_DOLLAR&granularity=DAY
- OAuth:
Pinterest Ads
Part 5: API Documentation
Official API documentation: https://developers.pinterest.com/docs/api/v5/#tag/ad_accounts