Developer Documentation

Hotel booking infrastructure for AI agents. REST API + MCP server with real-time pricing for 3M+ hotels.

Get Your API Key

Free tier: 100 requests/hour. No credit card required.

Register for API Access FREE

Save this key — it won't be shown again. Pass it as X-API-Key header or ?key= query parameter.

Quick Start

cURL

curl -X POST https://tripapi.dev/api/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{
    "destination": "Da Nang",
    "check_in": "2026-05-01",
    "check_out": "2026-05-03",
    "guests": 2
  }'

Python

import httpx

resp = httpx.post("https://tripapi.dev/api/search", json={
    "destination": "Da Nang",
    "check_in": "2026-05-01",
    "check_out": "2026-05-03",
    "guests": 2,
}, headers={"X-API-Key": "YOUR_KEY"})

hotels = resp.json()["hotels"]
for h in hotels:
    print(f'{h["name"]} — ${h["nightly_price_usd"]}/night')

JavaScript

const res = await fetch("https://tripapi.dev/api/search", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": "YOUR_KEY",
  },
  body: JSON.stringify({
    destination: "Da Nang",
    check_in: "2026-05-01",
    check_out: "2026-05-03",
    guests: 2,
  }),
});
const { hotels } = await res.json();
hotels.forEach(h => console.log(`${h.name} — $${h.nightly_price_usd}/night`));

Authentication

Pass your API key in one of two ways:

MethodExample
Header (recommended)X-API-Key: tk_abc123...
Query parameter?key=tk_abc123...

Rate limits are returned in response headers: X-RateLimit-Limit.

Plans

PlanRate LimitPrice
Free100 req/hour$0
Pro (coming soon)1,000 req/hour$49/mo
EnterpriseUnlimitedContact us

API Endpoints

Base URL: https://tripapi.dev

POST /api/search
Search hotels with structured parameters. Returns real-time rates when dates are provided.
{
  "destination": "Da Nang",     // required — city name
  "check_in": "2026-05-01",    // YYYY-MM-DD (required for live rates)
  "check_out": "2026-05-03",   // YYYY-MM-DD
  "guests": 2,                 // default: 2
  "max_price_usd": 100,        // max per night
  "min_stars": 4,              // 1-5
  "sort_by": "recommended"     // recommended | price_low | price_high | rating
}
POST /api/search/natural
Search using natural language. AI parses the query into structured parameters.
{ "query": "beachfront hotel in Da Nang under $100 for next weekend" }
GET /api/search/quick?q=Da+Nang&check_in=2026-05-01&check_out=2026-05-03
Quick search with query parameters. Handy for simple integrations.
GET /api/hotels/{hotel_id}
Get detailed information for a specific partner hotel (by numeric ID).

Booking Endpoints

Hotels with bookable: true in search results can be booked directly.

POST /api/book/prebook
Initiate a booking session. Pass the offer_id from search results.
{ "offer_id": "3gAVonJzkY6k..." }

Returns: prebook_id, transaction_id, rate details, cancellation policy.

POST /api/book/confirm
Complete the booking with guest details.
{
  "prebook_id": "...",
  "transaction_id": "...",
  "first_name": "John",
  "last_name": "Doe",
  "email": "john@example.com",
  "phone": "+84901234567"
}

Returns: booking_id, hotel_confirmation_code, check-in/out dates.

GET /api/book/status/{booking_id}
Check booking status, details, and cancellation policy.
PUT /api/book/cancel/{booking_id}
Cancel a booking. Check cancellation policy first via the status endpoint.

Response Format

Search Response

{
  "query_summary": "Da Nang, 2026-05-01 to 2026-05-03, 2 guests",
  "total_results": 10,
  "source": "liteapi",
  "hotels": [
    {
      "name": "Meliá Vinpearl Danang Riverfront",
      "city": "Da Nang",
      "stars": 5,
      "nightly_price_usd": 83.67,
      "total_price_usd": 167.33,
      "room_name": "Deluxe Room",
      "description": "Breakfast Included · Free cancellation",
      "rating": 4.2,
      "source": "liteapi",
      "bookable": true,
      "offer_id": "3gAVon...",
      "booking_url": "https://...",
      "agoda_url": "https://...",
      "image_url": "https://..."
    }
  ],
  "ai_recommendation": "For beachfront in Da Nang...",
  "booking_search_url": "https://...",
  "agoda_search_url": "https://..."
}

Hotel Sources

SourceDescriptionBookable?
liteapiReal-time rates from 3M+ hotelsYes — via offer_id
directDirect partner hotelsVia booking links
ai_suggestedAI-recommended for cities with limited dataVia booking links

MCP Server (Claude, Cursor, etc.)

TripAPI is available as an MCP server for Claude Desktop, Cursor, and any MCP-compatible AI platform.

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "tripapi": {
      "command": "uvx",
      "args": ["--from", "fastmcp", "fastmcp", "run",
               "https://github.com/your-org/tripapi/mcp_server.py"],
      "env": { "LITEAPI_KEY": "your-key" }
    }
  }
}

MCP Tools

ToolDescription
search_hotelsSearch by city, dates, guests, price, stars
get_hotel_detailsFull hotel info (amenities, photos, contact)
book_hotelComplete a reservation
get_booking_statusCheck booking status
cancel_bookingCancel a booking

ChatGPT / OpenAI Actions

TripAPI works as an OpenAI Action for ChatGPT. The OpenAPI spec is at:

https://tripapi.dev/openapi_gpt.yaml

You can import this directly when creating a GPT in the GPT Editor.

Coverage

Vietnam (deep coverage)

Da Nang, Ho Chi Minh City, Hanoi, Hoi An, Phu Quoc, Nha Trang, Da Lat, Hue, Sa Pa, Ninh Binh, Quy Nhon, Vung Tau, Can Tho, Ha Long, Con Dao, Mui Ne, Cat Ba, Phong Nha, and more.

Southeast Asia

Bangkok, Phuket, Chiang Mai, Bali, Singapore, Kuala Lumpur, Penang, Phnom Penh, Siem Reap, Manila, Cebu, Luang Prabang, and more.

Worldwide

3M+ hotels globally via real-time aggregation — Tokyo, Seoul, London, Paris, New York, Dubai, Sydney, and everywhere in between.