Microsoft Graph: Fetch Events Between Dates

Victoria Jul 07, 2026

Microsoft Graph, a RESTful web API that enables you to access Microsoft Cloud service resources, offers a robust way to manage and retrieve data across various Microsoft 365 services. One of its powerful features is the ability to fetch events between specific dates, which is particularly useful for event management, scheduling, and analytics. Let's delve into how you can achieve this using Microsoft Graph.

the excel time and date sheet
the excel time and date sheet

Before we proceed, ensure you have the necessary permissions to access the Calendar events. You can grant these permissions through the Azure portal or by using the Microsoft Identity platform. For this guide, we'll focus on the 'Calendar.Read' permission, which allows reading calendar view and basic information.

work work work
work work work

Understanding the Microsoft Graph API Endpoint for Events

The Microsoft Graph API provides a dedicated endpoint for managing events: /me/events or /users/{id | userPrincipalName}/events. To retrieve events between dates, you can use the $filter query parameter with the start and end properties.

an image of a calendar with different times and dates for each month, including the date
an image of a calendar with different times and dates for each month, including the date

Here's a basic example of the query syntax: https://graph.microsoft.com/v1.0/me/events?$filter=start/dateTime ge 2022-01-01T00:00:00Z and end/dateTime le 2022-12-31T23:59:59Z. This query retrieves all events starting from January 1, 2022, to December 31, 2022, for the signed-in user.

Formatting Date and Time

How to Create Year and School Calendar with Dynamic Date Markers » The Spreadsheet Page
How to Create Year and School Calendar with Dynamic Date Markers » The Spreadsheet Page

Microsoft Graph uses the ISO 8601 format for date and time values. The format is YYYY-MM-DDTHH:MM:SSZ, where Z indicates UTC time. For example, 2022-01-01T00:00:00Z represents January 1, 2022, at midnight in UTC.

When constructing your filter queries, ensure you use the correct format and time zone to avoid any discrepancies in event retrieval.

Working with Time Zones

Microsoft Graph Data Connect overview - Microsoft Graph
Microsoft Graph Data Connect overview - Microsoft Graph

Microsoft Graph supports various time zones, allowing you to retrieve events based on the user's local time. To specify a time zone, append a timeZone parameter to your query, like so: https://graph.microsoft.com/v1.0/me/events?$filter=start/dateTime ge 2022-01-01T00:00:00Z and end/dateTime le 2022-12-31T23:59:59Z&$select=subject,start,end&$expand=organizer&$orderby=start/dateTime asc&timeZone="Pacific Standard Time".

In this example, the events are returned in the "Pacific Standard Time" time zone. You can replace this value with any valid time zone to suit your needs.

Retrieving Events for a Specific User or Group

Excel DATEDIF function to get difference between two dates
Excel DATEDIF function to get difference between two dates

In addition to fetching events for the signed-in user, you can also retrieve events for a specific user or group by replacing me with the appropriate user ID or group ID in the API endpoint. For instance, to get events for a user with ID 12345678-90ab-cdef-1234-567890abcdef, use:

https://graph.microsoft.com/v1.0/users/12345678-90ab-cdef-1234-567890abcdef/events?$filter=start/dateTime ge 2022-01-01T00:00:00Z and end/dateTime le 2022-12-31T23:59:59Z

Interactive calendar with visualization data periods in Excel
Interactive calendar with visualization data periods in Excel
Master DATE, DAY, and MONTH Functions in Google Sheets – Simple Guide with Examples!
Master DATE, DAY, and MONTH Functions in Google Sheets – Simple Guide with Examples!
Microsoft Date and Time Picker Control - How To Enable and Use It
Microsoft Date and Time Picker Control - How To Enable and Use It
Monthly Profit Margin Bar Chart | After Effects & Premiere Pro Template
Monthly Profit Margin Bar Chart | After Effects & Premiere Pro Template
Create a date sequence in Excel and auto fill date series
Create a date sequence in Excel and auto fill date series
How to Use the NETWORKDAYS Function in Excel
How to Use the NETWORKDAYS Function in Excel
Microsoft Project Status Date
Microsoft Project Status Date
MS Excel 2016: How to Create a Line Chart
MS Excel 2016: How to Create a Line Chart
a calendar with different times on it and numbers for each month, including the date
a calendar with different times on it and numbers for each month, including the date
a computer monitor with several rows of data on it
a computer monitor with several rows of data on it
Side by Side Calendar with events
Side by Side Calendar with events
Online Design & Workflow Templates
Online Design & Workflow Templates
an image of a dashboard with data displayed on the screen and in front of it is a world map
an image of a dashboard with data displayed on the screen and in front of it is a world map
Student Assignment Tracker
Student Assignment Tracker
a spreadsheet showing the time and attendances for each event
a spreadsheet showing the time and attendances for each event
EVERYTHING about working with Dates & Time in Excel
EVERYTHING about working with Dates & Time in Excel
Calendar of events
Calendar of events
Heardle Archive: How to Play Old Heardle Games
Heardle Archive: How to Play Old Heardle Games
How to make a graph or chart in Google Sheets
How to make a graph or chart in Google Sheets
a table that has different types of items on it, including the names and numbers
a table that has different types of items on it, including the names and numbers

Using Expansion to Retrieve Additional Event Details

By default, the Microsoft Graph API returns only a subset of event properties. To retrieve additional details, you can use the $expand query parameter to include related resources in the response. For example, to include the organizer's details in the event response, use:

https://graph.microsoft.com/v1.0/me/events?$filter=start/dateTime ge 2022-01-01T00:00:00Z and end/dateTime le 2022-12-31T23:59:59Z&$expand=organizer

This query returns events along with the organizer's details, allowing you to display more comprehensive event information in your application.

Ordering Events

To retrieve events in a specific order, you can use the $orderby query parameter. For instance, to order events by their start time in ascending order, use:

https://graph.microsoft.com/v1.0/me/events?$filter=start/dateTime ge 2022-01-01T00:00:00Z and end/dateTime le 2022-12-31T23:59:59Z&$orderby=start/dateTime asc

You can also order events by other properties, such as the event's subject or the organizer's display name, by replacing start/dateTime with the desired property.

Incorporating Microsoft Graph's event retrieval capabilities into your applications can significantly enhance their functionality, making it easier to manage, display, and analyze events across various Microsoft 365 services. By mastering the techniques outlined in this guide, you'll be well on your way to unlocking the full potential of Microsoft Graph for your event management needs.