APIs & Integrations

SVyas7
Member

Get total closed won amount from report via API

SOLVE

Hi,

 

I have a report on a dashboard that shows the total closed won amount for deals with certain filters applied. How can I extract this value using API?

0 Upvotes
1 Accepted solution
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Get total closed won amount from report via API

SOLVE

Hi @SVyas7,

 

At the moment there does not appear to be a direct way to extract the value you see in a dashboard via the API. 

 

You could use the Deals API search endpoint and try to apply similar filters in your search query. 

 

Below is an example filter query for a deal that is "closed won", between "2025-04-15 and 2025-05-15".

 

{
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "dealstage",
          "operator": "EQ",
          "value": "closedwon"
        },
        {
          "propertyName": "closedate",
          "operator": "BETWEEN",
          "value": "2025-04-15T00:00:00Z", "highValue": "2025-05-15T23:59:59Z"
        }
      ]
    }
  ],
  "properties": ["amount"],
  "limit": 100
}

 

Obviously if you have more than 100 deals, you will need to use the pagination to retrieve all of them due to the limit of 100 per call.

 

Then you can create a simple function that would loop through the results and add the amount from each deal to get the total.

 

Hope this helps!

 

✔️ Did this post help answer your query? Help the community by marking it as a solution.

View solution in original post

0 Upvotes
4 Replies 4
victoriahcw
Participant

Get total closed won amount from report via API

SOLVE

The HubSpot API doesn’t provide direct access to dashboard reports, but you can replicate this by exporting your data directly into a spreadsheet by connecting to an external tool like Coefficient which can connect your HubSpot data directly to Google Sheets or Excel. You can apply filters similar to your report and automatically pull in the Closed Won total—no API scripting required. It’s a fast way to operationalize reporting and keep key metrics updated in real time.

0 Upvotes
evaldas
Solution
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Get total closed won amount from report via API

SOLVE

Hi @SVyas7,

 

At the moment there does not appear to be a direct way to extract the value you see in a dashboard via the API. 

 

You could use the Deals API search endpoint and try to apply similar filters in your search query. 

 

Below is an example filter query for a deal that is "closed won", between "2025-04-15 and 2025-05-15".

 

{
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "dealstage",
          "operator": "EQ",
          "value": "closedwon"
        },
        {
          "propertyName": "closedate",
          "operator": "BETWEEN",
          "value": "2025-04-15T00:00:00Z", "highValue": "2025-05-15T23:59:59Z"
        }
      ]
    }
  ],
  "properties": ["amount"],
  "limit": 100
}

 

Obviously if you have more than 100 deals, you will need to use the pagination to retrieve all of them due to the limit of 100 per call.

 

Then you can create a simple function that would loop through the results and add the amount from each deal to get the total.

 

Hope this helps!

 

✔️ Did this post help answer your query? Help the community by marking it as a solution.

0 Upvotes
SVyas7
Member

Get total closed won amount from report via API

SOLVE

Hi @evaldas 

 

Thanks for your help here! I was able to use the search endpoint to get the list of deals and calculate the total amount for all filtered deals. However, each deal has a different currency type and the final amount value in the dashboard report is in Euros. Any idea how I can get the exact value as shown in the report? 

 

Also, I had another question and would greatlly appreciate your help. I have a report in a dashboard that shows lead conversion rate % value and another report that shows count of 'new' leads in the last 30 days. Can you help me know how I can get these values via the API?

0 Upvotes
evaldas
Key Advisor | Platinum Partner
Key Advisor | Platinum Partner

Get total closed won amount from report via API

SOLVE

@SVyas7 glad to hear the search worked for you. If you would like to standardize the amount to one currency, you could try using "amount_in_home_currency" instead of the "amount" property in the API call.

 

If that does not give you what you need, then you might need to also retrieve the "deal_currency_code" in addition to the amount and utilize another 3rd party API for currency conversion.

 

Regarding the additional questions, to get the count of 'new' leads, you can do an API call to search contacts that match the lifecycle stage of lead and set the create date to 30 days ago.

 

/crm/v3/objects/contacts/search

 

{
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "lifecyclestage",
          "operator": "EQ",
          "value": "lead"
        },
        {
          "propertyName": "createdate",
          "operator": "GTE",
          "value": "2025-04-19T00:00:00Z"
        }
      ]
    }
  ],
  "properties": ["firstname", "email", "createdate", "lifecyclestage"],
  "limit": 100
}

 

Regarding the conversion % value - I am not sure. I woud suggest posting another question in the forum with that specific question to see if anyone else has ideas.

 

✔️ Did this post help answer your query? Help the community by marking it as a solution.

0 Upvotes