Use API to get topics for a period using js

I think your best bet is the data explorer plugin and Run Data Explorer queries with the Discourse API