Pinterest is a social network that allows users to visually share and discover new interests. We can use the Pinterest API to import data from Pinterest into Google Sheets. In this tutorial, we’ll show you how to connect the Pinterest REST API to Google Sheets in 6 steps:
Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.
1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install
2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.
In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.
Tip: you can open a new Google Sheet by entering this URL in your browser:
After logging into your Pinterest Business account, go to https://developers.pinterest.com/apps/ and connect an application by clicking the Connect app button:
Complete all the fields that appear on the screen:
Mark the I’m not a robot checkbox, then click the Submit button:
After creating the app, your trial access will be in the Pending status. To become Active (as shown in the picture below) you may need to wait a couple of days. After the status is Active you can proceed with the next steps.
After your app has been approved, in the Configure tab you will find your App id and App secret key:
Copy these values to a safe location because you will need them later.
In your browser’s URL bar, paste the following link and then press Enter:
When you visit the URL, an Authorization page will then be displayed. Click the Give access button to continue:
The browser will then navigate to the redirect URL that you provided when you registered your client. One additional query parameter (a code) will be added to your browser’s address bar, at the end of the redirect URL. The code parameter is a single use login code that we will now use to acquire an access token:
Open up a command prompt window (for Windows OS) or a terminal (for Mac OS) and compose the following curl command:
curl -X POST https://api.pinterest.com/v5/oauth/token --header "Authorization: Basic ENCODED_STRING" --header "Content-Type: application/x-www-form-urlencoded" --data-urlencode "grant_type=authorization_code" --data-urlencode "code=YOUR_CODE" --data-urlencode "redirect_uri=REDIRECT_URI"
You’ll need to replace a few values:
client_id:client_secret. client_id is your app_id and client_secret is the app secret key. You can use a site you trust such as https://www.base64encode.org/ to encode them.
Note: For Mac OS, you may need to use single quotes ( ‘ ) instead of double quotes ( ” )
Our request entered in the command prompt window:
In the response that you get back, your access token will be displayed.
Note: If the token/key that you generate has an expiration time, you will need to complete this same process again, to get a new token when the old one expires.
In this section, we’ll show you how to browse the Pinterest API documentation to find the endpoint that retrieves the data you need from Pinterest. If you already know your API URL, or you want to use the same example URL as us, just skip to Step 5.
First, open the Pinterest API documentation page: https://developers.pinterest.com/docs/api/v5/
The menu on the left contains general information about the Pinterest API and a list of categorized endpoints.
If we click the Pins category, a list of its endpoints will be displayed:
An example endpoint is Get Pin, which returns a pin owned by the operation user_account, or present on a group board that has been shared with this account:
If you use this URL don’t forget to replace pin_id with your own value!
The endpoint’s documentation contains a short description of the endpoint’s purpose, its HTTP method (GET), the URI, the path parameters, the query parameters, the cURL command and example responses:
All API calls to Pinterest should be made to this base URL:
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:
API URL: In Step 4, we explained how you can find the Pinterest REST API endpoint that you need. Now copy and paste your complete Pinterest API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).
For this example, we are using the List boards endpoint, which get a list of the boards owned by the operation user_account + the group boards where this account is a collaborator. This is what the whole URL looks like:
Headers: In the Headers section of Apipheny, add two rows with the following keys and values:
Header 1 Key: Content-Type Value: application/json Header 2 Key: Authorization Value: Bearer your_token
In header 2’s value, make sure to replace your_token with the value of the API key you obtained previously, in Step 3. There should be a literal space between Bearer and your_token.
Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Pinterest API data to be imported into your Google Sheet. Here’s what our request looked like when completed:
Make a GET request
Make a POST request
PUT, PATCH, & DELETE Requests
Save requests for later
Schedule requests for automatic updates
Reference cell values in requests
=APIPHENY custom function
Stack multiple URLs in a single request
Run all saved requests at once
Modify your request settings
Import & export saved API settings
Crypto API tutorials and more:
Alpha Vantage API
Constant Contact API
Facebook Graph API
Facebook Ads API
Google SERP API
Linkedin Ads API
Product Hunt API
Reddit Ads API
Riot Games API