<p>Within the criteria for the endpoint, set </p>

<pre><code>'postDate' =&gt; '&gt;=' . date('Y-m-d', strtotime("-90 days"))
</code></pre>

<p>Of course you can adjust the date to suit your needs.</p>

CC BY-SA 3.0
2017-01-26T17:10:48.977Z
2017-01-26T17:10:48.977Z
Steven Grant
<p>I'm looking to only return entries that were published in the last 90 days.</p>

<php><plugin-elementapi>
Limit the entries element API will return based on the post date
# Limit the entries element API will return based on the post date

(Asked by: username_0 on 2017-01-26)

I'm looking to only return entries that were published in the last 90 days.

**Tags:** php, plugin-elementapi


---

## 1 answers

### Answer by username_0 on 2017-01-26. Score: 2 | Accepted answer

Within the criteria for the endpoint, set 
'postDate' => '>=' . date('Y-m-d', strtotime("-90 days"))

Of course you can adjust the date to suit your needs.


---

