ITRS named a Visionary in the 2025 Gartner® Magic Quadrant™ for Digital Experience Monitoring.

  1. Support
  2. Knowledge base
  3. Uptrends' API
  4. API fields
  5. SelectedPeriod API field

SelectedPeriod API field

SelectedPeriod

The SelectedPeriod field lets you select a time range to filter API data. Instead of manually entering start and end dates, you can select options like Last7Days, CurrentMonth, PreviousQuarter, and others to easily determine what time period your data or report should cover.

Use cases

Use the SelectedPeriod field to:

  • Filter monitoring data without calculating exact dates.
  • Create scheduled reports that automatically cover relative time periods. For example, last month always shows the previous month’s data.
  • Retrieve data for common time periods like the current quarter or last 24 hours.

Available options

The following period options are available:

Current periods

These options cover the current, incomplete time period from the start of the period until now:

  • CurrentDay
  • CurrentWeek
  • CurrentMonth
  • CurrentQuarter
  • CurrentYear

For example, if the current time is 26 November 2025 at 14:30, the CurrentDay covers 26 November 2025 00:00 to 26 November 2025 14:30 (from midnight until the present moment).

Previous periods

These options cover the most recently completed full time period:

  • PreviousDay
  • PreviousWeek
  • PreviousMonth
  • PreviousQuarter
  • PreviousYear

For example, if the current time is 26 November 2025 at 14:30, the PreviousDay covers 25 November 2025 00:00 to 25 November 2025 23:59 (the full preceding calendar day).

Last X periods

These options cover a specific number of complete time periods, counting backwards from now. The current incomplete period is not included by default.

By hours:

  • Last2Hours
  • Last6Hours
  • Last12Hours
  • Last24Hours
  • Last48Hours

By days:

  • Last7Days
  • Last30Days
  • Last60Days
  • Last90Days
  • Last365Days

By months:

  • Last3Months
  • Last6Months
  • Last12Months
  • Last24Months

When you select time ranges such as last hours, days, or months, you can include the current period so the report reflects the most up-to-date data. For example, if you select Last24Hours, enabling Include current hour ensures that the data from the ongoing hour is also included.

For example, if the current time is 26 November 2025 at 14:30 and the selected period is Last24Hours. Without Include current hour, the range covers 25 November 2025 14:00 to 26 November 2025 14:00 (24 complete hours). With Include current hour, the range covers 25 November 2025 14:00 to 26 November 2025 14:30 (24 complete hours plus the current incomplete hour from 14:00 to 14:30)

When you need precise control over the exact time range, you can use the Start and End date fields instead of SelectedPeriod. These fields accept exact date and time values in YYYY-MM-DDTHH:MM:SS format (for example, 2025-01-20T08:00:00).

By using the Uptrends website, you consent to the use of cookies in accordance with our Cookie Policy.