Hi, i need help with the hacker news algolia api that i my using for my frontend project

Hi, i am using hacker hacker news api for my frontend project . For some reason when i fetch numericFilters created_at_i it doesnt work properly, it givs back results but there are no hits.

const url = `http://hn.algolia.com/api/v1/search?tags=story&numericFilters=created_at_i>${2 * 60 * 60},created_at_i<${60 * 60}`;

fetch(url)
.then(response => response.json())
.then(data => console.log(data));

The example in the API docs that show searching between 2 timestamps has

http://hn.algolia.com/api/v1/search_by_date?tags=story&numericFilters=created_at_i>X,created_at_i<Y

try changing your URL from ...com/api/v1/search to
...com/api/v1/search_by_date

I tried it your way doesn’t seem to work i still get no hits. The fault might be in the server

So I tested this with Postman. You are searching for stories greater than 7200 seconds AND less than 3600 seconds. You switched up the greater than and less than signs. I also had to change from 7200 to 10000000000 to get any hits. So it may be that you are searching in too small of a time frame.

Thanks for the help, i have figured it out now, the api uses unix timestaps whic i did not know.