How to Sync Your Booking Calendar with Airbnb and Booking.com Using iCal
The Double-Booking Problem
If you list your accommodation on multiple platforms, you have likely experienced the nightmare of double bookings. A guest books on Airbnb while another books the same dates on Booking.com. The solution? iCal synchronization.
iCal (iCalendar) is a universal calendar format (.ics files) that platforms like Airbnb and Booking.com use to share availability data. By creating and importing these calendar feeds, you keep all platforms in sync — bidirectionally.
How We Built It
Our system serves an .ics endpoint for each accommodation. It generates a standard VCALENDAR with VEVENT entries for every confirmed booking — using DTSTART and DTEND as VALUE=DATE with a SUMMARY of "Booked." Airbnb and Booking.com subscribe to this URL and periodically fetch your availability.
Both platforms provide iCal export URLs in their property settings. We built a custom iCal parser — no external library needed — that handles line unfolding, both DATE and DATE-TIME formats, and extracts VEVENT data reliably.
Our syncCalendar() function fetches each feed and upserts bookings: it creates new ones, updates changed dates, re-confirms cancelled reservations that reappear, and marks removed events as cancelled. This ensures your local availability always reflects reality.
We run a Vercel Cron job every 15 minutes that hits our /api/cron/sync-calendars endpoint (protected by a CRON_SECRET bearer token). It processes all enabled calendars with a concurrency limit of 5 to avoid overwhelming external APIs. The dashboard also exposes a manual "Sync Now" button for on-demand refreshes.
Each external calendar is stored in an ical_calendars table that tracks the platform (Airbnb, Booking.com, or other), the feed URL, last sync timestamp, sync status, and any errors. This makes debugging sync issues straightforward from the admin dashboard.
Key Considerations
- Overlap handling: When parsing external feeds, check for partial overlaps — not just exact date matches
- Timezone awareness: Normalize dates to UTC before comparing availability
- Upsert logic: Do not just create bookings — handle updates and cancellations gracefully
- Error resilience: Log sync errors per calendar and retry on the next interval rather than failing silently
Info
The Result
With bidirectional iCal sync running every 15 minutes, our clients see accurate availability across their own website, Airbnb, and Booking.com — and double bookings are a thing of the past.
On This Page