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. PresetPeriod API field

PresetPeriod API field

PresetPeriod

The PresetPeriod field lets you filter API responses by selecting from a list of predefined time periods. Use this field when you need common time ranges like the last 7 days or the current month. For custom date ranges, use the Start and End parameters instead.

Note: You cannot combine PresetPeriod with Start and End parameters in the same API call. If you don’t set a preset period, this defaults to Last24Hours.

Available options

The following period options are available, categorized by type:

Current periods

  • CurrentDay
  • CurrentWeek
  • CurrentMonth
  • CurrentQuarter
  • CurrentYear

Previous periods

  • PreviousDay
  • PreviousWeek
  • PreviousMonth
  • PreviousQuarter
  • PreviousYear

Last X periods

By hours:

  • Last2Hours
  • Last6Hours
  • Last12Hours
  • Last24Hours
  • Last48Hours

By days:

  • Last7Days
  • Last30Days
  • Last60Days
  • Last90Days
  • Last365Days

By months:

  • Last3Months
  • Last6Months
  • Last12Months
  • Last24Months

Using PresetPeriod

To use PresetPeriod in an API request, add it as a query parameter:

GET https://api.uptrends.com/v4/Statistics/Monitor/ef42495b-26cb-4a2f-8cfc-c933f9716d22?PresetPeriod=PreviousYear

Previous and Last periods only include complete time ranges. Incomplete periods are excluded.

Examples

If you set PresetPeriod=Last7Days and request data on Monday, January 20, 2025 at 8:00 AM, you’ll receive data from Monday, January 13 through Sunday, January 19 (seven completed days). Monday, January 20 is not included because it’s an incomplete day.

Similarly, if you set PresetPeriod=Last12Months and request data on 25 January 2025, you’ll get results from 31 December 2024 going back 11 months. Both January 2024 and January 2025 are excluded because neither month has been completed yet.

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