I am using the plugin wordpress’ RESTful API plugin called JSON API and I would like to get posts from a given date. I tried many parameters but it didn’t work for me, can you help me please?
Here is what I have tested for instance :
http://www.example.com/?json=get_date_posts&date=20140806&posts_per_page=-1
or
http://www.example.com/?json=get_posts&after=20140806&posts_per_page=-1
This WP plugin has documentation JSON API Docs.
Please see this part Method:get_posts this call accepts the same parameters as WordPress’s WP_Query parameters, which can be found here WP_Query parameters.
The part you are looking for is Date parameters.
Example: http://www.example.com/?json=get_date_posts&year=2012&monthnum=12&day=12&posts_per_page=-1
don’t if it still helps but you should use something like this:
json=get_date_posts&date=after%2020150318
You can get all posts from a date using get_posts with params below
count = -1
date_query[0][after] = 20160101
http://www.example.com/api/get_posts/?count=-1&date_query%5B0%5D%5Bafter%5D=20160101
You can see all date params on https://codex.wordpress.org/Class_Reference/WP_Query#Date_Parameters