API Connector Documentation
Import Pipedrive Data to Google Sheets
In this guide, we’ll walk through how to pull data from the Pipedrive API directly into Google Sheets, using the API Connector add-on for Sheets.
There are 2 ways to connect to the Pipedrive API:
- Preset "Connect" button (OAuth)
- Personal API token. Please check the appendix for detailed instructions to retrieve your token.
Contents
- Before You Begin
- Part 1: Connect to the Pipedrive API
- Part 2: Pull Data from Pipedrive to Sheets
- Part 3: Create a Custom API Request
- Part 4: Handle Pagination
- Part 5: API Documentation
- Appendix: Connect with a Pipedrive API Token
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Connect to the Pipedrive API
The easiest way to get started with the Pipedrive API is through API Connector’s built-in integration.
- Select Pipedrive from the drop-down list of applications
- Under Authorization, click Connect to Pipedrive
- You will see a screen asking you to log in and approve the connection. Click Allow and Install.
- You'll then be returned to your Google Sheet, and can verify that your Pipedrive connection is active.
Part 2: Pull Data from Pipedrive to Sheets
Now that we’re connected, let’s pull some data into Sheets.
- Under Endpoint, choose an endpoint. Let’s start by getting deals.
- Fill in the
fields
anddomain
parameters. Thefields
parameter is optional, but we're including it because Pipedrive sends back a massive data set otherwise. If you'd like to leave it out, I suggest setting thelimit
parameter to 2 for your first request, so you can add filters before retrieving data for your full set of records. - Select a destination sheet, name your request, and click Run.
Part 3: Create a Custom API Request
Alternatively, you can create a custom request instead of using API Connector’s built-in integration, using any of the endpoints and parameters shown in the API documentation.
To create a custom request, add the complete URL into the request URL field, and select Pipedrive from the OAuth menu (or connect with an API token). Here's an example setup:
- Application:
Custom
- Method:
GET
- Request URL:
https://site.pipedrive.com/api/v1/deals:(id,title,active,add_time,update_time,stage_id,currency,value,status,pipeline_id)
- OAuth:
Pipedrive
- Headers
Accept
:application/json
Part 4: Handle Pagination
Many Pipedrive endpoints will return a limited set of data per page. To retrieve additional data, you'll need to follow the pagination links in the response, as described here. With API Connector, you can run these request URLs manually, or loop through them automatically using pagination handling. Pipedrive uses 'start' and 'limit' parameters, so they would get entered like this:
- Pagination type:
offset-limit
- Offset parameter:
start
- Limit parameter:
limit
- Limit value:
500
- Run until: choose when to stop fetching data
Part 5: API Documentation
Official API documentation: https://developers.pipedrive.com/docs/api/v1/
Field selector documentation: https://pipedrive.readme.io/docs/core-api-concepts-requests#field-selector
Appendix: Connect with a Pipedrive API Token
Pipedrive requires that all API requests are authenticated. This is the process to authenticate with a Pipedrive API token:
- While logged into your Pipedrive account, navigate to Settings > (Personal) > Personal Preferences > API, or just click here.
- You'll now see a page containing your Access Token. Copy this to your clipboard.
- That's it, you now have access to the Pipedrive API! You can use this token by appending
api_token=YOUR_TOKEN
to your URLs, e.g.https://company.pipedrive.com/api/v1/deals:(id,title,active,add_time,update_time,stage_id,currency,value,status,pipeline_id)?api_token=1234567&status=open
. Since you're manually including an API token, leave OAuth2 authentication set to None.
Excellent, 5 starts!
FIVE STARS 🙂
Thank you!
Very helpful. Thanks!
Any quick ways to export only filtered results?
You can filter results with the
fields
parameter but it seems you might be referring to something else. What do you mean by exporting only filtered results?How do you pull up goals?
I think this is the right place: https://developers.pipedrive.com/docs/api/v1/Goals#getGoals
Based on that you'd make a request URL like
https://YOUR_DOMAIN.pipedrive.com/v1/goals/find
(you can add the various parameters listed in that article, too).Hi Ana thanks for the reply. I think my issue is that Im not sure how the URL looks like.
Having the details below, what will be the url format.Given that I only have one goal set up.
Assignee: Everyone
Goal Type: Deals Won
Goal Interval: Quarterly
Goal Duration: 098/01/2021 - 08/31/2021
Expected Outcome:80,0000
https://YOUR_DOMAIN.pipedrive.com/v1/goals/find
(whats next?)Oh, I didn't think you needed to add anything after that since they didn't mention any parameters were required. But if you do, you would add parameters like this:
https://YOUR_DOMAIN.pipedrive.com/v1/goals/find?type.name=deals_won
Another example would be
https://YOUR_DOMAIN.pipedrive.com/v1/goals/find?is_active=true
Hi Ana,
Thanks for this. Apologies I should have clarified that the first time, nonetheless I tried the below and its not working, I am getting errors.
https://YOUR_DOMAIN.pipedrive.com/v1/goals/find?type.name=deals_won/api_token=xxxxxxx
https://YOUR_DOMAIN.pipedrive.com/v1/goals/find?type.name=deals_won
https://YOUR_DOMAIN.pipedrive.com/v1/goals/find?type.name=deals_won?api_token=xxxxxxx
Multiple parameters get separated with an
&
, can you please try this instead?https://YOUR_DOMAIN.pipedrive.com/v1/goals/find?type.name=deals_won&api_token=xxxxxxx
Hi Ana,
First of all, thank you so much for this.
I'm trying to use these steps to get All Deals from Pipedrive. And it's working to an extent.
My issue is:
The first time I called the API, it returned some nicely formatted columns for Stage, Labels. In other words, I had text values in there with the Stage Name, Label name.
But now I'm trying to call the API again and it's returning the ID (numerical values) for the Stage Name and Label Name.
Do you have any idea why this is happening?
Thank you so much!
It sounds like something has changed in your request but I can't really say without seeing it. Have you modified field names in the field editor, or maybe added/removed a JMESPath expression? If you'd like me to take a look please feel free to send a message through support.
Hi Ana!
Can i export an certain range of data? like i want the from january first to today?
Someone asked this in their forum here. Based on the response, via the API it's possible but takes two steps. You need to first create a date filter, and then can apply that filter to your request like this:
https://company.pipedrive.com/api/v1/deals?api_token=1234567&filter_id=ABCDE
That seems a bit complicated, so I'd suggest using a JMESPath filter instead. To filter with JMESPath, enter an expression like this:
data[?add_time>'2021-11-29'&&add_time<'2021-12-01']
. Just substitute in the dates you're interested in, and copy/paste that snippet into the JMESPath field.Hi Ana,
I'm trying to call this endpoint
--> https://developers.pipedrive.com/docs/api/v1/DealFields#getDealFields
but it's returning an "Unknown Method" error.
Any idea what's happening?
Thanks!
sorry, this endpoint
--> https://developers.pipedrive.com/docs/api/v1/DealFields#getDealField
I just tested 2 request URLs and they both completed without error:
https://site.pipedrive.com/api/v1/dealFields?api_token=aa111111111111&related_objects=0
https://site.pipedrive.com/api/v1/dealFields/12531?api_token=aa111111111111&related_objects=0
So I'm not sure why it didn't work for you. Can you share some info on your request? "Unknown method" sounds like it's related to whether you've chosen GET / POST/ PUT etc, can you please make sure it's entered as a GET request?
With the native Pipedrive sync option, is it possible to only bring in deals from a specific pipeline?
It is possible if you create a filter and filter by filter_id as described here: https://devcommunity.pipedrive.com/t/cant-filter-by-pipeline-id/6921