{"openapi":"3.0.0","info":{"title":"Trip.com Hotels Trains and Attractions Data","version":"1.0.0","description":"Trip.com hotel listings, prices, ratings, train routes and attraction offers across regional storefronts, one row per entity."},"servers":[{"url":"https://ah-trip-com.opendata.best/s/trip-com"}],"paths":{"/v1/search":{"post":{"operationId":"search","summary":"Search Trip.com hotels, trains and attractions","description":"Query Trip.com hotel rates, train itineraries and attractions across global Trip.com country sites.","tags":["search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"destination":{"type":"string","description":"Destination. City or region to search, for example Bangkok or Tokyo. Leave it empty if you fill in City ID.","example":"Bangkok"},"regionId":{"type":"string","description":"City ID. Optional Trip.com city id (for example Bangkok = 359). Use it instead of Destination, or together with it for more precise hotel results."},"service":{"type":"string","enum":["hotels","trains","attractions"],"description":"Travel service. Choose hotels, trains or attractions. Flights, cars and packages are not available.","default":"hotels","example":"hotels"},"maxResults":{"type":"integer","minimum":1,"maximum":20,"description":"Max rows per input (each listed URL, ID or keyword; a single target counts as one input). All row types share this allowance. Each plan caps the rows of one request (BASIC 10, PRO 70, ULTRA 200, MEGA 500); larger values are lowered to your plan's cap. You pay per delivered row (Rows).","default":10,"example":3},"checkin":{"type":"string","description":"Check-in date. Hotels: check-in date (year-month-day). Leave empty to search 21 days from today."},"checkout":{"type":"string","description":"Check-out date. Hotels: check-out date (year-month-day). Leave empty for a two-night stay."},"adults":{"type":"integer","minimum":1,"maximum":10,"description":"Adults. Number of adult travelers","default":2},"children":{"type":"integer","minimum":0,"maximum":10,"description":"Children. Number of children","default":0},"rooms":{"type":"integer","minimum":1,"maximum":10,"description":"Rooms. Number of hotel rooms","default":1},"departureDate":{"type":"string","description":"Train departure date. Optional train search date in YYYY-MM-DD format. Published route offers are not guaranteed to match this date."},"domain":{"type":"string","description":"Trip.com Domain. Regional Trip.com host (e.g. www.trip.com, ph.trip.com, uk.trip.com, jp.trip.com).","default":"www.trip.com","example":"www.trip.com"},"currency":{"type":"string","description":"Currency. Requested currency code, such as USD or GBP. Set it explicitly when changing regional domains.","default":"USD"},"locale":{"type":"string","description":"Locale. Language setting, such as en_US or en_GB. Set it explicitly when changing regional domains.","default":"en_US"},"sort":{"type":"string","description":"Hotel sorting. Hotel result ordering preference, such as RECOMMENDED. Available ordering depends on the selected search.","default":"RECOMMENDED"},"includeSponsored":{"type":"boolean","description":"Include Sponsored Ads. Include sponsored ad cards in results","default":false},"enrichDetails":{"type":"boolean","description":"Include listing details. Add available public hotel contacts and address details, or attach available attraction offers to the listing row. Off by default; additional details are not guaranteed.","default":false,"example":false},"origin":{"type":"string","description":"Train origin. Departure city for a train route, such as Tokyo. Use with destination and service set to trains."},"returnDate":{"type":"string","description":"Return date (reserved). Reserved setting. Leave empty for the supported travel services."},"tripType":{"type":"string","enum":["oneway","roundtrip"],"description":"Trip type (reserved). Reserved setting. Keep the default for the supported travel services.","default":"oneway"},"requestId":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,80}$","description":"Optional. Your id for this request: repeating it while the job runs returns the same job."}}},"example":{"service":"hotels","destination":"Bangkok","enrichDetails":false,"maxResults":3}}}},"responses":{"200":{"description":"Done within the request: the rows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RowsPage"}}}},"404":{"description":"No results matched the query (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid or missing parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"At capacity, too many running jobs, or rolling 24-hour row limit reached; retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The source could not be collected this time (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Synchronous timeout reached before completion; task cancelled (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/health":{"get":{"operationId":"health","summary":"API health check","description":"Lightweight readiness check for this API. Never starts a collection and always bills 0 rows.","tags":["health"],"responses":{"200":{"description":"API is operational (0 rows).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}},"503":{"description":"API is temporarily unavailable (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}}}}}},"components":{"schemas":{"Row":{"type":"object","properties":{"source":{"type":"string","title":"Source","description":"Always 'trip.com'."},"service":{"type":"string","title":"Service","description":"Travel service: hotels, trains or attractions."},"listingId":{"type":"string","title":"Listing ID","description":"Stable id (hotel id / offer id when available)."},"name":{"type":"string","title":"Name","description":"Listing or offer name."},"domain":{"type":"string","title":"Domain","description":"Trip.com regional host used for the search."},"destination":{"type":"string","title":"Destination","description":"Search destination echoed from input."},"origin":{"type":"string","title":"Origin","description":"Departure city supplied for a train search, when applicable."},"url":{"type":"string","title":"URL","description":"Listing or search-result URL."},"price":{"nullable":true,"type":"number","title":"Price","description":"Parsed primary price amount when available."},"priceDisplay":{"type":"string","title":"Price display","description":"Raw price text from the card."},"currency":{"nullable":true,"type":"string","title":"Currency","description":"ISO currency code as reported by the source; null when the source carries none."},"rating":{"nullable":true,"type":"number","title":"Rating","description":"Guest rating when present."},"reviewCount":{"type":"integer","title":"Review count","minimum":0,"description":"Number of reviews when present."},"country":{"type":"string","title":"Country","description":"Country of the listing when Trip.com supplies it. This may differ from the country selected for the search."},"proxyCountry":{"type":"string","title":"Search country","description":"Two-letter country code used for the search, not necessarily the country of the listing."},"listingType":{"type":"string","title":"Listing type","description":"Row subtype within the service (e.g. attractions vs attractions_offer)."},"priceKind":{"nullable":true,"type":"string","title":"Price kind","description":"Meaning of the primary price: nightly for hotels, ticket for attractions or oneWay for trains."},"carrier":{"type":"string","title":"Carrier","description":"Train operator name for trains rows."},"departStation":{"type":"string","title":"Departure station","description":"Train departure station name."},"arriveStation":{"type":"string","title":"Arrival station","description":"Train arrival station name."},"sourceLayer":{"type":"string","title":"Source reference","description":"Source reference included with the row. Include it when reporting a data problem."},"sponsored":{"type":"boolean","title":"Sponsored","description":"True when the card is a sponsored ad."},"scrapedAt":{"type":"string","title":"Scraped at","description":"ISO timestamp when the row was collected."},"phones":{"type":"array","title":"Phones","description":"Public hotel phone numbers when available. May remain empty when listing details are not requested or not shown.","items":{"type":"object","properties":{"value":{"nullable":true,"type":"string"},"type":{"nullable":true,"type":"string"},"e164":{"nullable":true,"type":"string"}},"additionalProperties":true}},"emails":{"type":"array","title":"Emails","description":"Public hotel email addresses when available. May remain empty when listing details are not requested or not shown.","items":{"type":"object","properties":{"value":{"nullable":true,"type":"string"},"type":{"nullable":true,"type":"string"}},"additionalProperties":true}},"address":{"nullable":true,"type":"object","title":"Address","description":"Structured listing address when available. The unit field holds a street or door number when identified.","properties":{"street":{"nullable":true,"type":"string"},"unit":{"nullable":true,"type":"string"},"locality":{"nullable":true,"type":"string"},"region":{"nullable":true,"type":"string"},"postalCode":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"full":{"nullable":true,"type":"string"}},"additionalProperties":true},"geo":{"nullable":true,"type":"object","title":"Coordinates","properties":{"lat":{"nullable":true,"type":"number"},"lng":{"nullable":true,"type":"number"}},"additionalProperties":true},"person":{"nullable":true,"type":"object","title":"Person","description":"Named contact fields when available. Empty values do not imply that a contact exists.","properties":{"name":{"nullable":true,"type":"string"},"role":{"nullable":true,"type":"string"}},"additionalProperties":true},"org":{"nullable":true,"type":"object","title":"Organization","description":"Hotel organization name and identifier when available.","properties":{"name":{"nullable":true,"type":"string"},"id":{"nullable":true,"type":"string"}},"additionalProperties":true},"web":{"nullable":true,"type":"object","title":"Web","description":"Hotel-owned website and social profiles. Trip.com platform links are excluded.","properties":{"website":{"nullable":true,"type":"string"},"socials":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},"leadSource":{"nullable":true,"type":"string","title":"Lead source","enum":["search","detail","detail-rsc","entity","contact","reveal-xhr"]},"leadReveal":{"nullable":true,"type":"string","title":"Lead reveal","enum":["visible","click","xhr","gated","image","absent"]},"leadAbsences":{"type":"object","title":"Lead absences","description":"Reasons for missing contact fields, such as not shown on the site, access restricted, or not verified.","additionalProperties":{"type":"string"}}},"additionalProperties":true,"description":"One collected entity. Field availability depends on rowType and the source. Fields always present (a|b = at least one of them): every row: listingId, name, listingUrl, price."},"Error":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","required":["code","message","retryable"],"properties":{"code":{"type":"string","example":"invalid_input"},"message":{"type":"string"},"retryable":{"type":"boolean"}}},"JobStatus":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","partial","failed","cancelled"]},"done":{"type":"boolean"},"rowsAvailable":{"type":"integer"},"rowsDelivered":{"type":"integer","description":"Rows already delivered (and billed) to you for this job."},"rowsLimit":{"type":"integer","description":"Most rows this job can deliver."},"estimatedFinishSec":{"type":"integer","description":"While running: estimated seconds until done."},"statusUrl":{"type":"string"},"resultsUrl":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"retentionHours":{"type":"integer"},"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"RowsPage":{"allOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"object","properties":{"offset":{"type":"integer"},"nextOffset":{"type":"integer"},"hasMore":{"type":"boolean"},"rowCount":{"type":"integer"},"rowsBilled":{"type":"integer","description":"Rows delivered by this response."},"rows":{"type":"array","items":{"$ref":"#/components/schemas/Row"}},"meta":{"type":"object","additionalProperties":true}}}]},"HealthStatus":{"type":"object","required":["ok","site","status","endpoints","rowsBilled"],"properties":{"ok":{"type":"boolean"},"site":{"type":"string"},"status":{"type":"string","enum":["operational","unavailable"]},"endpoints":{"type":"array","items":{"type":"string"}},"rowsBilled":{"type":"integer"}}}}}}