pushshift / api

Pushshift API
1.29k stars 109 forks source link

Before and After UTC Usage #18

Open joepope44 opened 6 years ago

joepope44 commented 6 years ago

From the read.me file, on using before and after parameters:

Search all subreddits for the term "Trump" and return comments made between 2 and 4 days ago

https://api.pushshift.io/reddit/search/comment/?q=trump&after=4d&before=2d&sort=asc

I feel like to collect data between 2 and 4 days ago should be "before 4 days ago" AND "after 2 days ago". Am I thinking about this wrong? Or is it mislabeled here?

pushshift commented 6 years ago

before and after parameters originally were designed to accept epoch timestamps. The ability to use "2d" or "5m" was a convenience function added. after=5d technically reads as "include things that happened after 5 days ago."

It's a bit confusing. I'll try to find a way to make it clearer in the next API version.