polygon-io / issues

Quickly track and report problems with polygon.io
29 stars 0 forks source link

Stocks Grouped Daily (Bars) API returns invalid timestamps #250

Open sergproua opened 1 year ago

sergproua commented 1 year ago

URL The RESTful API call you are making (please be sure to omit your API key) https://api.polygon.io/v2/aggs/grouped/locale/us/market/stocks/2023-01-09?adjusted=true

Result What result are getting?

{
    "queryCount": 10953,
    "resultsCount": 10953,
    "adjusted": true,
    "results": [
        {
            "T": "TTMI",
            "v": 394280,
            "vw": 16.1078,
            "o": 15.96,
            "c": 16.08,
            "h": 16.335,
            "l": 15.96,
            "t": 1673298000000,
            "n": 5416
        },
...

167329800 converts to Monday January 09, 2023 16:00:00 (pm) in time zone America/New York (EST)

Expected Result

Stocks Grouped Daily (Bars) API documentation says t - The Unix Msec timestamp for the start of the aggregate window. which should be 00:00:00 (am) but it returns timestamps with 16:00:00 (pm) instead.

Aggregate Bars API returns timestamps as expected, example for the same ticker and date

https://api.polygon.io/v2/aggs/ticker/TTMI/range/1/day/2023-01-09/2023-01-09?adjusted=true&sort=asc&limit=120

{
    "ticker": "TTMI",
    "queryCount": 1,
    "resultsCount": 1,
    "adjusted": true,
    "results": [
        {
            "v": 394280,
            "vw": 16.1078,
            "o": 15.96,
            "c": 16.08,
            "h": 16.335,
            "l": 15.96,
            "t": 1673240400000,
            "n": 5416
        }
    ],
    "status": "OK",
    "request_id": "e2e0c5c9276e65fe7ae7ce49afda7967",
    "count": 1
}

1673240400 converts to Monday January 09, 2023 00:00:00 (am) in time zone America/New York (EST)