Search code examples
wordpresswordpress-rest-api

How do I get WordPress posts from a specific date?


I am unable to figure out how to retrieve WordPress posts from a specific date to the present date.

The following is the URL for getting all posts:

[<Literal>]
let private APIBaseAddress =   "https://public-api.wordpress.com/"

[<Literal>]
let private ArticlesUrl =      "rest/v1/sites/{0}/posts?number=100&page={1}"

Solution

  • A list of all of the parameters can be found here.

    Add the after parameter.

    let private ArticlesUrl = "rest/v1/sites/{0}/posts?number=100&page={1}&after=yyyymmdd"