API Search contact lastmodifieddate

Hi!
I’m using search api to get all contacts and updates incrementally.

so, my request have this is my data requests:

data_contacts = f’‘’{{
“filterGroups”:[{{
“filters”:[
{{
“propertyName”:“lastmodifieddate”,
“operator”:“GTE”,
“value”:“{last_timestamp_uploated}”
}}]
}}],
“properties”: “{my_properties_contacts_list}”,
“sorts”: [
{{
“propertyName”: “lastmodifieddate”,
“direction”: “ASCENDING”
}}],
“limit”: “100”
}}‘’’
I was tring using the after parameter to get pages, but I modify to check if the result its diferent, but its not. Each Request I change the last_timestamp_uploated the be the value of the lastmodifieddate on the last contacts on the last request.
So far so good, I made 100 requests, so a god 10.000 contacts. When I look the lastmodifieddate of the last contacts on the last request, the date was 2022-12-19, but if I go to hubspot GUI and filter contacts that have the last modified date before 2022-12-18 (one day less), I got 83.000 contacs! where is the other 73.000 on API response?!

Hi, @Geovanif :waving_hand: This is the expected behaviour for queries that have > 10,000 results. Here’s the documentation — “The search endpoints are limited to 10,000 total results for any given query. Attempting to page beyond 10,000 will result in a 400 error.” — Limitations.

Best,

Jaycee

nop, that is not the problem. As I said, I request 10.000, and that’s ok.
When I look the last contact request, the lastmodifieddate was 2022-12-19, but on the hubspost GUI filter contacts that has the lastmodifieddate lower than 2022-12-18, I got 83.000!
How I my 10.000th contact has this date, if I have at leaast 73.000 before that date?

dates can be funky when you’re dealing with HubSpot. The GUI is going to tell you the date based on your timezone, but the API is going to present it back to you in UTC. this means that if I in EST (utc -4) go to HubSpot and make a view of all contacts created on 2/1/2023, it’s going to show me contacts created between 00:00 and 23:59 for UTC-4
If I ask HubSpot via API “give me all contacts created on 2/1/2023” it’s going to give me everyone created between 00:00 and 23:59 in UTC

Yes, I notice that too. My time zone is GTM-3, so all datetime time the GUI shows me, on the API its 3 hours more, however, on the GUI I’m looking 1 day less, just to be sure this problema is not real issue. Even if I look 1 week less, its still coming more then 10.000 :joy::tired_face:

Also, the problem with 10.000 happend only if you use pages (after + limit). I change my script to do not use this, he change de filter insted (this way, I never get a 400 for the pagination issue, because I aways got only the first page). I made this just to see If this fix the problem, but its works exacly the same.