Parse ICS calendar feeds and retrieve meeting details within a date range
The Calendar API allows you to fetch and parse ICS (iCalendar) files from URLs and retrieve meeting details for a specified date range. The API automatically handles recurring events and converts times to your specified timezone.
Automatically calculates and includes recurring meetings based on RRULE specifications
Converts all times to your specified timezone for consistent results
Extracts and lists all meeting participants from attendee information
Returns meeting names, times, descriptions, locations, and more
| Parameter | Type | Required | Description |
|---|---|---|---|
ics_url |
string (URL) | Required | The URL of the ICS calendar file to parse. Must be publicly accessible. |
start_date |
string (date) | Required | The start date for the event range. Format: YYYY-MM-DD or any format accepted by PHP's DateTime. |
end_date |
string (date) | Required | The end date for the event range. Format: YYYY-MM-DD or any format accepted by PHP's DateTime. |
timezone |
string | Optional | The timezone for date/time output. Defaults to UTC. Must be a valid PHP timezone identifier (e.g., America/New_York, Europe/London). |
When the request is successful, the API returns a JSON object with the following structure:
{
"success": true,
"data": [
{
"name": "Team Standup",
"start_time": "2025-10-08 09:00:00",
"end_time": "2025-10-08 09:30:00",
"participants": [
"John Doe",
"Jane Smith",
"bob@example.com"
],
"details": "Daily team sync meeting to discuss progress and blockers.",
"location": "Conference Room A",
"timezone": "America/New_York"
},
...
],
"count": 15
}
| Field | Type | Description |
|---|---|---|
success |
boolean | Indicates whether the request was successful |
data |
array | Array of meeting objects, sorted by start time |
count |
integer | Total number of meetings returned |
| Field | Type | Description |
|---|---|---|
name |
string | The title/summary of the meeting |
start_time |
string | Meeting start time in format YYYY-MM-DD HH:MM:SS |
end_time |
string|null | Meeting end time in format YYYY-MM-DD HH:MM:SS, or null if not specified |
participants |
array | Array of participant names or email addresses |
details |
string | Meeting description or additional details |
location |
string | Meeting location (physical or virtual) |
timezone |
string | The timezone used for the start_time and end_time |
When an error occurs, the API returns:
{
"success": false,
"error": "Error message describing what went wrong"
}
GET /calendar.php?ics_url=https://example.com/calendar.ics&start_date=2025-10-01&end_date=2025-10-31&timezone=America/New_York
{
"success": true,
"data": [
{
"name": "Weekly Team Meeting",
"start_time": "2025-10-01 10:00:00",
"end_time": "2025-10-01 11:00:00",
"participants": [
"Alice Johnson",
"Bob Smith",
"carol@company.com"
],
"details": "Weekly sync to discuss project progress",
"location": "Room 301",
"timezone": "America/New_York"
},
{
"name": "Client Presentation",
"start_time": "2025-10-03 14:00:00",
"end_time": "2025-10-03 15:30:00",
"participants": [
"John Doe",
"client@external.com"
],
"details": "Q3 results presentation for major client",
"location": "Zoom: https://zoom.us/j/123456",
"timezone": "America/New_York"
}
],
"count": 2
}
GET /calendar.php?ics_url=https://example.com/calendar.ics&start_date=2025-10-08&end_date=2025-10-08&timezone=Europe/London
{
"success": true,
"data": [
{
"name": "Morning Standup",
"start_time": "2025-10-08 09:00:00",
"end_time": "2025-10-08 09:15:00",
"participants": ["Team"],
"details": "",
"location": "",
"timezone": "Europe/London"
}
],
"count": 1
}
const params = new URLSearchParams({
ics_url: 'https://example.com/calendar.ics',
start_date: '2025-10-01',
end_date: '2025-10-31',
timezone: 'America/Los_Angeles'
});
fetch(`/calendar.php?${params}`)
.then(response => response.json())
.then(data => {
if (data.success) {
console.log(`Found ${data.count} meetings:`);
data.data.forEach(meeting => {
console.log(`${meeting.name} at ${meeting.start_time}`);
});
} else {
console.error('Error:', data.error);
}
})
.catch(error => console.error('Request failed:', error));
// Include the calendar.php file
require_once 'calendar.php';
// Call the function directly
$result = get_calendar_events([
'ics_url' => 'https://example.com/calendar.ics',
'start_date' => '2025-10-01',
'end_date' => '2025-10-31',
'timezone' => 'America/Chicago'
]);
if ($result['success']) {
echo "Found " . $result['count'] . " meetings:\n";
foreach ($result['data'] as $meeting) {
echo $meeting['name'] . " - " . $meeting['start_time'] . "\n";
}
} else {
echo "Error: " . $result['error'];
}
The API automatically handles recurring events based on RRULE specifications in the ICS file. Supported recurrence patterns include:
If your ICS file contains a weekly recurring meeting every Monday at 10:00 AM, and you query for October 2025, the API will return all Monday occurrences in that month:
{
"success": true,
"data": [
{
"name": "Weekly Sync",
"start_time": "2025-10-06 10:00:00",
...
},
{
"name": "Weekly Sync",
"start_time": "2025-10-13 10:00:00",
...
},
{
"name": "Weekly Sync",
"start_time": "2025-10-20 10:00:00",
...
},
{
"name": "Weekly Sync",
"start_time": "2025-10-27 10:00:00",
...
}
],
"count": 4
}
The API supports all standard PHP timezone identifiers. Some common examples:
America/New_YorkAmerica/ChicagoAmerica/DenverAmerica/Los_Angeles
Europe/LondonEurope/ParisEurope/BerlinEurope/Moscow
Asia/TokyoAsia/ShanghaiAsia/SingaporeAsia/Dubai
Australia/SydneyPacific/AucklandAfrica/CairoUTC
success field in the response before processing dataYou can test the API using various methods:
curl "https://yourdomain.com/calendar.php?ics_url=https://example.com/calendar.ics&start_date=2025-10-01&end_date=2025-10-31&timezone=UTC"
Simply paste the URL with parameters into your browser's address bar:
https://yourdomain.com/calendar.php?ics_url=https://example.com/calendar.ics&start_date=2025-10-01&end_date=2025-10-31&timezone=America/New_York
https://yourdomain.com/calendar.php