Hello, guys! How are you doing?
I’m executing the query https://api.polygon.io/v2/aggs/ticker/{options_ticker}/range/1/minute/{timestamp_ms}/{timestamp_ms+600000}?adjusted=true&sort=asc&apiKey={api_key}
using python, where:
options_ticker = O:SPY251219C00650000
timestamp_ms = 1704250800000
and I get the response:
{'ticker': 'O:SPY251219C00650000', 'queryCount': 0, 'resultsCount': 0, 'adjusted': True, 'status': 'OK', 'request_id': 'd07f0fb1f5edb56a68174d6a56825784'}
Why am I getting no results? Apparently, using a date YYYY-MM-DD works, but using a milisecond timestamp doesn’t. In this case, 1704250800000 is equivalent to
Date: January 3, 2024
Time: 12:00:00 PM (Noon) UTC
Timezone: Coordinated Universal Time (UTC)
If I use the date above I obtain the query (https://api.polygon.io/v2/aggs/ticker/O:SPY251219C00650000/range/1/minute/2024-01-03/2024-01-03?adjusted=true&sort=asc&apiKey={API_KEY)
which gives me, for example, the followng result:
{
"ticker": "O:SPY251219C00650000",
"queryCount": 5,
"resultsCount": 5,
"adjusted": true,
"results": [
{
"v": 1,
"vw": 2.37,
"o": 2.37,
"c": 2.37,
"h": 2.37,
"l": 2.37,
"t": 1704294960000,
"n": 1
},
}
which is something I am looking for. How can I get these results for specific times of the day with minute precision?
Thanks in advance.