# TripAngel — Full API Documentation > Book local activities, fishing charters, pontoon rentals, and guided tours. > See /llms.txt for the summary version. ## Authentication TripAngel uses JWT (JSON Web Tokens) with two delivery methods: 1. **httpOnly Cookies** (preferred for browser clients) - Cookie name: `ta_auth` (users), `ta_supplier_auth` (suppliers), `ta_affiliate_auth` (affiliates) - Set automatically on login/register - 7-day expiration 2. **Bearer Token** (for API clients) - Header: `Authorization: Bearer ` - Tokens returned in login/register responses ### Register ``` POST /api/auth/register Content-Type: application/json { "name": "string (required)", "email": "string (required)", "password": "string (required)" } Response: { "success": true, "data": { "user": { "_id": "string", "name": "string", "email": "string" }, "token": "string (JWT)" } } ``` ### Login ``` POST /api/auth/login Content-Type: application/json { "email": "string (required)", "password": "string (required)" } Response: { "success": true, "data": { "user": { "_id": "string", "name": "string", "email": "string" }, "token": "string (JWT)" } } ``` ### OAuth - `GET /api/auth/google` — Google OAuth redirect - `GET /api/auth/facebook` — Facebook OAuth redirect ## Rate Limits | Endpoint Type | Limit | Window | |---|---|---| | General API | 100 requests | 15 minutes | | Authentication | 5 requests | 15 minutes | | Widget/Public Booking | 200 requests | 15 minutes | | AI Assistant | 30 requests | 1 minute | | Booking Creation | 10 requests | 1 hour | Rate limit headers are included in responses: - `X-RateLimit-Limit` - `X-RateLimit-Remaining` - `X-RateLimit-Reset` ## Response Format ### Success ```json { "success": true, "data": { ... }, "meta": { "page": 1, "limit": 20, "total": 100 } } ``` ### Error ```json { "success": false, "error": { "code": "ERROR_CODE", "message": "Human-readable description" } } ``` ### Error Codes - 400 — Validation error or bad request - 401 — Missing or invalid authentication - 403 — Insufficient permissions - 404 — Resource not found - 409 — Conflict (duplicate resource) - 429 — Rate limit exceeded - 500 — Internal server error --- ## Public Endpoints (No Authentication Required) ### Destinations #### List Featured Destinations ``` GET /api/locations/featured?limit=8 Response: { "success": true, "data": [ { "_id": "string", "name": "string", "slug": "string", "city": "string", "state": "string", "country": "string", "description": "string", "shortDescription": "string", "heroImage": "string (URL)", "thumbnailImage": "string (URL)", "coordinates": { "lat": number, "lng": number }, "highlights": ["string"], "stats": { "totalVendors": number, "totalActivities": number, "averageRating": number } } ] } ``` #### Get Top Destinations ``` GET /api/locations/top?limit=10 Response: { "success": true, "data": [ { "_id": "string", "name": "string", "slug": "string", "city": "string", "state": "string" } ] } ``` #### Get Destination Details ``` GET /api/locations/{slug} Response: { "success": true, "data": { "_id": "string", "name": "string", "slug": "string", "city": "string", "state": "string", "country": "string", "description": "string", "shortDescription": "string", "heroImage": "string (URL)", "coordinates": { "lat": number, "lng": number }, "highlights": ["string"], "popularAttractions": [ { "name": "string", "description": "string", "image": "string (URL)", "order": number } ], "availableCategories": [ { "type": "string", "count": number } ] } } ``` #### Get Related Destinations ``` GET /api/locations/{slug}/related?limit=6 Response: { "success": true, "data": [ { "_id": "string", "name": "string", "slug": "string", "city": "string", "state": "string", "heroImage": "string" } ] } ``` #### Get Destination Attractions ``` GET /api/locations/{slug}/attractions.json Response: { "success": true, "data": [ { "name": "string", "description": "string", "image": "string (URL)", "websiteUrl": "string" } ] } ``` ### Activities #### Search Activities ``` GET /api/trips/available?location=Miami&category=fishing&limit=50 Query Parameters: - location (string) — City or destination name - category (string) — Activity category filter - limit (number, default 50, max 100) Response: { "success": true, "data": [ { "_id": "string", "name": "string", "description": "string", "category": "string", "price": number, "priceType": "per_person | per_group", "duration": "string (display)", "durationMinutes": number, "images": ["string (URL)"], "heroImage": "string (URL)", "location": { "type": "Point", "coordinates": [longitude, latitude] }, "supplierId": { "businessName": "string", "businessType": "string" }, "averageRating": number, "reviewCount": number } ] } ``` #### Get Activity Details ``` GET /api/trips/{id} Response: { "success": true, "data": { "_id": "string", "name": "string", "description": "string", "category": "string", "price": number, "priceType": "per_person | per_group", "duration": "string", "durationMinutes": number, "images": ["string (URL)"], "heroImage": "string (URL)", "maxParticipants": number, "meetingInstructions": "string", "parkingInstructions": "string", "location": { "type": "Point", "coordinates": [longitude, latitude] }, "supplier": { "businessName": "string", "membershipTier": "string" }, "averageRating": number, "reviewCount": number, "seasonalPricing": [ { "name": "string", "startDate": "MM-DD", "endDate": "MM-DD", "multiplier": number } ], "depositPercent": number } } ``` #### Get Top-Rated Activities ``` GET /api/activities/top-rated?limit=8 Returns activities with 4+ star rating, sorted by rating then review count. Response: { "success": true, "data": [ { "_id": "string", "name": "string", "description": "string (truncated to 120 chars)", "category": "string", "price": number, "priceType": "string", "duration": "string", "heroImage": "string (URL)", "supplierId": { "businessName": "string" }, "averageRating": number, "reviewCount": number } ] } ``` #### Get Activities by Category ``` GET /api/activities/by-category/{category}?page=1&limit=24 Categories: fishing, adventure, attractions, dining, wellness, cultural, nightlife, nature, transport, shopping Response: { "success": true, "data": { "activities": [ ... ], "pagination": { "page": number, "limit": number, "total": number, "totalPages": number } } } ``` #### Get Similar Activities ``` GET /api/activities/{activityId}/similar?limit=6 Returns activities in the same category or from the same supplier. Response: { "success": true, "data": [ ... ] } ``` #### Check Availability ``` GET /api/activities/{activityId}/availability?date=2025-06-15&durationMinutes=120&guestCount=4 Response: { "success": true, "data": { "slots": [ { "time": "9:00 AM", "available": true }, { "time": "1:00 PM", "available": false, "reason": "booked" } ] } } ``` ### Reviews #### Get Trip Reviews ``` GET /api/reviews/trip/{tripId} Response: { "success": true, "data": [ { "rating": number, "comment": "string", "createdAt": "ISO 8601 datetime", "user": { "name": "string" } } ] } ``` ### Public Configuration ``` GET /api/config/public Response: { "success": true, "data": { "googleMapsApiKey": "string", "stripePublishableKey": "string" } } ``` --- ## Authenticated Endpoints ### Trip Planning #### Create Trip ``` POST /api/trips Authorization: Bearer Content-Type: application/json { "destination": "string (city name or description)", "startDate": "YYYY-MM-DD", "endDate": "YYYY-MM-DD", "destinationCoordinates": { "lat": number, "lng": number } } Response: { "success": true, "data": { "_id": "string", "destination": "string", "startDate": "ISO datetime", "endDate": "ISO datetime" } } ``` #### List User's Trips ``` GET /api/trips Authorization: Bearer Response: { "success": true, "data": [ ... ] } ``` #### Get Trip Bookings ``` GET /api/trips/{tripId}/bookings Authorization: Bearer Response: { "success": true, "data": [ { "_id": "string", "status": "pending | confirmed | completed | cancelled", "paymentStatus": "pending | paid | refunded", "bookingDate": "ISO datetime", "startTime": "string", "guestCount": number, "totalAmount": number, "trip": { "name": "string" }, "supplier": { "businessName": "string" } } ] } ``` ### User Profile #### Get Current User ``` GET /api/user Authorization: Bearer Response: { "success": true, "data": { "_id": "string", "name": "string", "email": "string", "role": "user | admin" } } ``` --- ## Widget API (For Embedded Booking) Widget endpoints support CORS from any origin and use a widget key for identification. ``` GET /api/widget/config Header: x-widget-key: GET /api/widget/trips Header: x-widget-key: POST /api/widget/trips/{tripId}/book Header: x-widget-key: ``` --- ## Activity Categories | Key | Label | Emoji | |---|---|---| | fishing | Fishing Charters | 🎣 | | adventure | Adventure & Outdoors | 🎯 | | attractions | Attractions & Tours | 👀 | | dining | Dining & Restaurants | 🍽️ | | wellness | Wellness & Spa | 🧘 | | cultural | Cultural Experiences | 🎭 | | nightlife | Nightlife & Entertainment | 🌙 | | nature | Nature & Outdoors | 🌲 | | transport | Transportation | 🚗 | | shopping | Shopping | 🛍️ | --- ## Structured Data (Schema.org) All pages include JSON-LD structured data: - **Homepage**: TravelAgency + WebSite with SearchAction - **Destination pages**: TouristDestination + FAQPage + BreadcrumbList - **Activity pages**: TouristTrip + Offer + AggregateRating + BreadcrumbList - **Category pages**: CollectionPage + BreadcrumbList --- ## Sitemap - `https://tripangel.com/sitemap.xml` — Dynamic sitemap with all destinations, activities, and category pages --- ## MCP Server - URL: https://tripangel.com/mcp - Protocol: Streamable HTTP (POST for messages, GET for SSE stream, DELETE to end session) - Session management: Include `mcp-session-id` header after initialization ### Available Tools **search_activities** — Search activities by location, date, category, party size, price range ```json { "location": "Destin", "date": "2025-07-15", "category": "fishing", "partySize": 4, "priceRange": { "min": 50, "max": 300 } } ``` **get_activity_details** — Get full activity details (photos, pricing, operator info, cancellation policy) ```json { "activityId": "abc123" } ``` **check_availability** — Real-time availability for a specific date and party size ```json { "activityId": "abc123", "date": "2025-07-15", "partySize": 4 } ``` **create_booking** — Create a booking (returns payment URL for completion) ```json { "activityId": "abc123", "date": "2025-07-15", "startTime": "9:00 AM", "partySize": 4, "customerName": "Jane Doe", "customerEmail": "jane@example.com" } ``` **get_booking_status** — Check booking status and payment details ```json { "bookingId": "order123" } ``` **get_reviews** — Get guest reviews for an activity with ratings, text, and operator responses ```json { "activityId": "abc123", "sort": "recent", "limit": 10 } ``` --- ## Contact - Website: https://tripangel.com - Operated by: Lexcom Systems Group Inc.