TickerTick-API icon indicating copy to clipboard operation
TickerTick-API copied to clipboard

UTC Timestamp in Query

Open weilinear opened this issue 4 years ago • 3 comments

Would be great to query by timestamp. For example, those cases in README could have a (and () before_utc: 1636624740000) and (and () after_utc: 1636624740000)

weilinear avatar Jan 10 '22 00:01 weilinear

Thanks for the suggestion. @weilinear

after_utc is not necessary, since the stories of a feed are already sorted in reverse chronological order. One can fetch the continuous feed page by page until the oldest story crosses the utc timestamp in after_utc.

There is already a parameter hours_ago to do the same as before _utc though it uses hours instead of seconds. Not sure if that hours_ago would work for your use case.

I can definitely add a term before_utc later.

hczhu avatar Jan 10 '22 02:01 hczhu

Hours before is a bit of an approximation. I wanna to have all news within a time range if possible to back test. One use case, suppose I wanna see what happened exactly before a quote changes w.r.t. prices, then the timing is really important to ensure causality.

weilinear avatar Jan 11 '22 17:01 weilinear

Sounds reasonable. I'll add before_utc later.

hczhu avatar Jan 13 '22 05:01 hczhu