You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于通过GET /deals/v1/deal/paged获取指定日期范围成交及排序支持的咨询

Hey there! Let me walk you through how to handle both of your requests with the HubSpot Deals API:

1. Filtering Deals to a Specific Closed Date Range

To pull only deals where the closedate falls between 2018-01-01 and 2018-01-31, you'll use filter parameters in your GET request. The API lets you chain multiple filters using property, operator, and value query params.

Here's how to structure it:

  • Use two separate filter sets for the start and end of your date range:
    • For the start date (2018-01-01), use operator=GTE (greater than or equal to) with the ISO 8601 formatted date (include the time and UTC timezone to avoid ambiguity)
    • For the end date (2018-01-31), use operator=LTE (less than or equal to) with the end-of-day timestamp

A full example request would look like this:

GET /deals/v1/deal/paged?property=closedate&value=2018-01-01T00:00:00Z&operator=GTE&property=closedate&value=2018-01-31T23:59:59Z&operator=LTE

If you only want to return specific fields (instead of all deal properties), add additional property params for the fields you need. For example, to get just the deal ID and closedate:

GET /deals/v1/deal/paged?property=dealId&property=closedate&value=2018-01-01T00:00:00Z&operator=GTE&property=closedate&value=2018-01-31T23:59:59Z&operator=LTE
2. Does the API Support Field Sorting?

Absolutely! You can sort the results using two query parameters:

  • sortBy: Specify the property you want to sort by (e.g., closedate, dealname)
  • sortDir: Define the sort direction—use ASC for ascending order (oldest to newest dates) or DESC for descending order (newest to oldest)

To combine filtering and sorting, just append these params to your request. For example, to get the filtered deals sorted by closedate in descending order:

GET /deals/v1/deal/paged?property=closedate&value=2018-01-01T00:00:00Z&operator=GTE&property=closedate&value=2018-01-31T23:59:59Z&operator=LTE&sortBy=closedate&sortDir=DESC

内容的提问来源于stack exchange,提问作者JeeShen Lee

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 03:49:39