# Pull Sales Performance widget data via API in HubSpot

**URL:** <https://community.hubspot.com/t/pull-sales-performance-widget-data-via-api-in-hubspot/15210>\
**Category:** APIs & Integrations\
**Tags:** developer-tools, object, contacts\
**Created:** [July 9, 2019, 7:45pm UTC](https://community.hubspot.com/t/pull-sales-performance-widget-data-via-api-in-hubspot/15210 "2019-07-09T19:45:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cfrye\_1st\_page](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cfrye_1st_page/32/27794_2.png) [@cfrye\_1st\_page](https://community.hubspot.com/u/cfrye_1st_page)\
**Post date:** [July 9, 2019, 7:45pm UTC](https://community.hubspot.com/t/pull-sales-performance-widget-data-via-api-in-hubspot/15210/1 "2019-07-09T19:45:03Z")

</div>

Hello. I’m trying to use HubSpot API’s to duplicate the data shown in the Sales Performance widget from the Sales Performance Standard Dashboard. The Report Settings for the Sales Performance data are:

Date Range = this entire month

HubSpot Owner = Person A OR Person B

The metrics are:  
Contacts assigned (both this month and last month)

Contacts worked (both this month and last month)

Can this info be pulled via API? If so, what would a sample API call look like to pull this info?

I tried solving for this by clicking “Sales Performance” header link and viewing the resulting report and filters, however the Deals list which shows up has zero records. When I strip away the filters in the Deals list, it appears that the Deal Owner for all deals are set as Unassigned so that was a dead end.

FWIW I’m pulling this info into Klipfolio.

Any guidance is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [July 10, 2019, 7:40am UTC](https://community.hubspot.com/t/pull-sales-performance-widget-data-via-api-in-hubspot/15210/2 "2019-07-10T07:40:31Z")

</div>

Hi [@cfrye\_1st\_page](https://community.hubspot.com/t5/user/viewprofilepage/user-id/90077),

I hope all is well with you  
 ![16x16_smiley-happy.png.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/2/22d5e40d253def47f5f4ea7f0e3e70be19010689.png)

We currently do not have an API to pull custom report data, that said if you’re looking to pull data based on these two metrics:

- Contacts assigned (both this month and last month)
- Contacts worked (both this month and last month)

I’d suggest looking into our [Contact Lists API](https://developers.hubspot.com/docs/methods/lists/contact-lists-overview) where we can set filters to pull contacts into list. For this, we can approach in two ways:

#1 You can create a contact list directly via the API [here (Create a new contact list)](https://developers.hubspot.com/docs/methods/lists/create_list)

or

#2 You can [create the contact list](https://knowledge.hubspot.com/articles/kcs_article/lists/create-active-or-static-lists) directly in your HubSpot portal

We can use the following filter criteria to pull contacts based on the above metrics:

- **Contacts assigned** : _owner assigned date is between (under the filter type → 'contact_ _properties’)_ e.g. 06/01/2019 and 07/10/2019
- **Contacts worked** : _last activity date is between (under the filter type → 'Contact_ _properties’)_ e.g. 06/01/2019 and 07/10/2019

Once the list has been created, we can use this endpoint [here (Get contacts in a list)](https://developers.hubspot.com/docs/methods/lists/get_list_contacts) to return contact(s) that are in that list

**Additional Resources:**

[Learn more about the sales performance widget metrics](https://knowledge.hubspot.com/articles/kcs_article/dashboard/understand-your-sales-dashboard#performance)

[Learn more about HubSpot’s default contact properties](https://knowledge.hubspot.com/articles/kcs_article/contacts/hubspots-default-contact-properties)

Also, if you’re looking to import data from HubSpot into a user’s Klipfolio dashboard, we do have an integration with Klipfolio and you can explore more here: [[HubSpot Connect] - Klipfolio Integration](https://www.hubspot.com/product-updates/klipfolio)

Hope this helps to clarify!

---

<div class="post-metadata">

**Author:** ![cfrye\_1st\_page](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cfrye_1st_page/32/27794_2.png) [@cfrye\_1st\_page](https://community.hubspot.com/u/cfrye_1st_page)\
**Post date:** [July 11, 2019, 10:19pm UTC](https://community.hubspot.com/t/pull-sales-performance-widget-data-via-api-in-hubspot/15210/3 "2019-07-11T22:19:23Z")

</div>

Thanks @WendyGoh !

That was very helpful 🙂 I’ve setup Contacts Lists and will work with those Contact List data through the Contact List API.

Now a followup question - I am looking for the number of contacts in the lists as opposed to the actual data about those contacts. Here’s an example of the API call I’m using.

[https://api.hubapi.com/contacts/v1/lists/###/contacts/all?count=250](https://api.hubapi.com/contacts/v1/lists/###/contacts/all?count=250)

I’m running into a problem now because the size of my contact list (4500+) exceeds the amount of records which can be returned in a single API call.

Is there an method to just return the number of records in the contact list as opposed to returning the entire contact list dataset? I am hoping to avoid using the vidOffset since I expect that will change day-to-day and I don’t know of a great way to deal with that within Klipfolio.

Thanks again!

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [July 12, 2019, 1:27am UTC](https://community.hubspot.com/t/pull-sales-performance-widget-data-via-api-in-hubspot/15210/4 "2019-07-12T01:27:17Z")

</div>

Hey [@cfrye\_1st\_page](https://community.hubspot.com/t5/user/viewprofilepage/user-id/90077) ,

Glad that that’s helpful!

When looking to get the number of contacts in a list, we can use this endpoint here: [Get a group of contact lists | Contact Lists API](https://developers.hubspot.com/docs/methods/lists/get_batch_lists)

- First, you can get the ID of any list in HubSpot by looking at the URL. It will have this format:

`https://app.hubspot.com/contacts/{{portalId}}/lists/{{listId}}`

- You can then use the listId in the request URL parameter e.g.

`https://api.hubapi.com/contacts/v1/lists/batch?listId={{listId}}&portalId={{portlId}}`

- The “_size_” key will contain the number of contacts in the list

---

<div class="post-metadata">

**Author:** ![PowerMyAnalytic](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/powermyanalytic/32/78471_2.png) [@PowerMyAnalytic](https://community.hubspot.com/u/PowerMyAnalytic)\
**Post date:** [May 11, 2020, 10:20am UTC](https://community.hubspot.com/t/pull-sales-performance-widget-data-via-api-in-hubspot/15210/5 "2020-05-11T10:20:06Z")

</div>

Hi @WendyGoh,

Thanks for answer.

I have some difficulties.

The solution is good when the field value can’t be changed, like contact “create date” or "_owner assigned date" and/or the date range is “until today”._

But using "_last activity date"_ is kind of tricky, because its value change over time.

For example, if contact had one activity in this week and one activity last week, if I set the report date range to be “Last Week” the report will return 0 instead of 1 because only the last activity time is recorded and it not in the settings date range.

Possible solution is to populate the "_last activity date"_ property **history** , but it is too hard to manage.

After almost a year from the last answer, I want to re-check,

Is there an intention to make a simple andpoint (input: date range, output: results)

for

_“Contacts created and worked totals with deals created and won totals”_

report?

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [May 12, 2020, 1:16am UTC](https://community.hubspot.com/t/pull-sales-performance-widget-data-via-api-in-hubspot/15210/6 "2020-05-12T01:16:59Z")

</div>

Hey @PowerMyAnalytic,

We recently released the CRM search endpoint - [CRM API | Search](https://developers.hubspot.com/docs/api/crm/search) which allows you to search through CRM objects.

In this case, you can search through the property ‘last activity date’.
