Determining the URL of CalDAV Calendars

Menu

Apple Calendars

  1. Go to your ~/Library/Calendars folder.
  2. You will find a bunch of ID.caldav directories: each of these folders correspond to a calendar (or a set of of calendars) and contains either another directory or an Info.plist file. The Info.plist file stores the URL of the calendar.
  3. Open the Info.plist file of the calendar you are interested in and look for:
    • Title, which is the name of the calendar (so that you know whether this is the calendar you are really interested in).
    • Principal URL, which is something in the form: https://pXX-caldav.icloud.com/USER_ID/principal/. (The principal URL is going to be the same for all your iCloud calendars.)
    • Calendar Path, which is something in the form: USER_ID/calendars/CALENDAR_ID

If you are interested in the iCal link (for read-only subscriptions): open the iCal application, go to the calendars list on the left, click on the share icon and you will get a public address to share the calendar. You need to replace the webcal protocol with https.

The URL of the calendar is then formed as follows:

Calendar-id CALENDAR_ID
Main url https://pxx-caldav.icloud.com/USER_ID/calendars
CalDAV url https://pxx-caldav.icloud.com/USER_ID/calendars/CALENDAR_ID
ICS https://pxx-calendars.icloud.com/published/2/A_VERY_LONG_STRING

(See: https://discussions.apple.com/thread/3414939?start=0&tstart=0 for a similar discussion.)

Google Calendar

Google makes it a bit easier to find the calendars’ URLs.

  1. Go the calendar settings page of the calendar you want to access
  2. Copy the Calendar ID, which, for the main calendar, is something like STRING@gmail.com or STRING@groups.google.com. (For the main calendar STRING is your username.)
  3. Copy also the iCal Private Address, which is something in the form: https://www.google.com/calendar/ical/USERNAME/private-SOMESTRING/basic.ics

The calendar URL is then formed as follows:

Calendar-id STRING@gmail.com
Main URL https://www.google.com/calendar/dav
CalDAV URL https://www.google.com/calendar/dav/CALENDARID/events
ICS https://www.google.com/calendar/ical/USERNAME/private-SOMESTRING/basic.ics

As pointed out by eloyesp for user and password are required, but:

(See also the discussion on superuser.com.)

OwnCloud and NextCloud

NextCloud and OwnCloud are two good choices if you want to host your own private cloud.

The calendars URLs are readily available from the web interface: you will find the calendar address by clicking on the gear at the bottom of the page when you visit a calendar. The ID of the calendar is the calendar name.

Calendar-id CALENDAR_NAME
Main URL https://nextcloud-server-url/remote.php/caldav/calendars/USERID
CalDAV URL https://nextcloud-server-url/remote.php/caldav/calendars/USERID/CALENDAR_NAME
ICS