-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Alejandro Castillo edited this page Mar 20, 2025
·
1 revision
# 📖 Wiki: iCal-Sync API
## 🌐 Overview
API que convierte calendarios de Airbnb (en formato `.ics`) a JSON estructurado. Ideal para integrar disponibilidad de alojamientos en apps web/móviles o sistemas de gestión.
---
## 🛠 Installation
### Prerequisites
- Node.js v18+
- npm v9+
### Steps
```bash
git clone https://github.com/alejandro-castillo-delgado/ical-sync.git
cd ical-sync
npm installnpm start
# Servidor iniciado en http://localhost:3000Crea un archivo .env:
PORT=4000
CORS_ORIGIN=*GET /calendar
Convierte un calendario Airbnb ICS a JSON.
| Parámetro | Tipo | Requerido | Ejemplo |
|---|---|---|---|
url |
string | Sí | https://airbnb.com/calendar/xxx.ics |
curl "http://localhost:3000/calendar?url=URL_DEL_CALENDARIO"{
"success": true,
"events": [
{
"start": "2024-07-01T12:00:00Z",
"end": "2024-07-05T12:00:00Z",
"status": "reserved",
"summary": "Reserva - Juan Pérez",
"uid": "airbnb@event123"
}
]
}{
"success": false,
"error": "Missing URL parameter"
}| Variable | Default | Descripción |
|---|---|---|
PORT |
3000 | Puerto del servidor |
CORS_ORIGIN |
* | Dominios permitidos (CORS) |
LOG_LEVEL |
info | Nivel de logs (error, warn, info, debug) |
Ejemplo para modo debug:
LOG_LEVEL=debug npm start- Crea un fork del proyecto
- Implementa cambios en una rama nueva:
git checkout -b feature/nueva-funcionalidad
- Ejecuta tests (próximamente)
- Envía un Pull Request
- 2 espacios de indentación
- Preferir async/await sobre callbacks
- Comentar endpoints complejos
| Error | Solución |
|---|---|
ECONNREFUSED |
Verifica que el servidor esté activo |
Invalid ICS format |
Valida la URL del calendario |
CORS blocked |
Configura CORS_ORIGIN correctamente |
MIT License - Ver LICENSE.
Solo con calendarios públicos. Airbnb requiere autenticación para calendarios privados.
Cada solicitud obtiene datos en tiempo real directamente de la URL proporcionada.
Actualmente solo procesa archivos ICS estándar.
Ver repositorio | Documentación iCal.js