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.
Available options
The following period options are available, categorized by type:
Current periods
CurrentDayCurrentWeekCurrentMonthCurrentQuarterCurrentYear
Previous periods
PreviousDayPreviousWeekPreviousMonthPreviousQuarterPreviousYear
Last X periods
By hours:
Last2HoursLast6HoursLast12HoursLast24HoursLast48Hours
By days:
Last7DaysLast30DaysLast60DaysLast90DaysLast365Days
By months:
Last3MonthsLast6MonthsLast12MonthsLast24Months
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 December 2023 through December 2024, since the month of January has not been completed yet.