public-roadmap icon indicating copy to clipboard operation
public-roadmap copied to clipboard

[Accounts] `end` date parameter in the `API Absolute Numbers` report not processed correctly when hour value is included

Open martin-serpapi opened this issue 1 year ago • 1 comments

A high-volume customer requested to be able to filter the API Absolute Numbers report to get the actual number of searches within a specific billing period. While investigating it, I noticed that the end date parameter is not processed correctly when an hour value is included in it, in addition to the actual date:

start=2024-09-10 12:00 & end=2024-09-10 13:00

image

API Absolute Numbers

start=2024-09-10 12:00 & end=2024-09-09 13:00

image

API Absolute Numbers

Results for 23 hours ahead of the end date are included. Also, results from the hour value in the end date parameter are excluded, although they are included for the start parameter.

When no HH:MM value is included in the start and end values, both the start and end dates are inclusive.

start=2024-09-09 & end=2024-09-10

image

API Absolute Numbers

Intercom

martin-serpapi avatar Sep 10 '24 19:09 martin-serpapi

Note that hours work when added correctly as YYYY-MM-DD-HH:MM. There's no space between DD and HH. Edit: Actually, it works with spaces as well 🤔

With HH-MM: image https://serpapi.com/searches/reports?start=2024-09-09-00:00&end=2024-09-10-10:30

No HH-MM: image https://serpapi.com/searches/reports?start=2024-09-09&end=2024-09-10

We're adding a day to the end parameter though. For example, to filter it down to the same day you'd have to set end to be in the past: image https://serpapi.com/searches/reports?start=2024-09-09-01:00:00&end=2024-09-08-11:00:00

Filtering by minutes however doesn't seem to work. That is, you can't filter down 5 searches done within the same hour to 3 searches by using minutes. It seems we don't plan to support this feature though. Ref.: https://github.com/serpapi/public-roadmap/issues/1929#issuecomment-2344141123

ishiharaf avatar Sep 19 '24 16:09 ishiharaf