> For the complete documentation index, see [llms.txt](https://docs.junkipedia.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.junkipedia.org/reference-material/api/query-string-parameters/time-filters.md).

# Time Filters

The following API entry points provide the ability to search for records based on when they were created:

* GET /posts
* GET /posts/stats

With each of these endpoints, two parameters work together to specify a time range for records to be included in the results:

* **published\_at\_from** – beginning of the time range
* **published\_at\_to** – end of the time range

## Expressing A Time Value

The time values used with these parameters must be expressed with a Unix Epoch Timestamp.

### Unix Epoch Timestamp

The [Unix Epoch](https://en.wikipedia.org/wiki/Unix_time) timestamp must be expressed as an integer count of [seconds](https://en.wikipedia.org/wiki/Second) that have elapsed since 00:00:00 [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) on the first of January 1970. A tool such as [epochconverter.com](https://www.epochconverter.com/) may be useful for translating to and from other representations.

For example, noon UTC on the first of January, 2022, would be represented as 1641038400.

## Time Range Options

A time range may be specified in the following ways:

* Specify an explicit start and end time using both parameters.
* Specify an explicit start and leave the present time as an implied end of the range.
* Omit both of these parameters to accept a system default time range of recent posts. As of November 2022, the system default time range covers the last seven days of recent posts.

Note that the use of the **published\_at\_to** parameter without the **published\_at\_from** parameter is not supported and may yield unexpected results.

### Explicit Range

The following request will retrieve posts from the first of January, 2022, at noon UTC to noon UTC the following day:

GET /posts?published\_at\_from=1641038400\&published\_at\_to=1641124800

### Explicit Start Of Range With Implied End

Omitting the **published\_at\_to** parameter will cause the present time to be the implied end of the time range. The following request will retrieve posts from the first of January, 2022, at noon UTC to the present time:

GET /posts?published\_at\_from=1641038400

### Explicit End Of Range With Implied Start

Omitting both the **published\_at\_to** and the **published\_at\_from** parameters will imply a default time range of recent posts:

GET /posts
