{"openapi":"3.1.0","info":{"title":"Book That API","version":"1.0.0","description":"Turns a travel TikTok, Reel, Short or X post into a day-by-day trip plan with places, weather and booking links. An MCP server with the same abilities is at /api/mcp (see /llms.txt)."},"servers":[{"url":"https://planthat.online"}],"paths":{"/api/plan":{"post":{"operationId":"createPlan","summary":"Make a plan from a travel video","description":"Send the post's link, its caption, a screenshot, or any mix. TikTok and Instagram links cannot be read on their own: send the caption or a screenshot with them. Open the finished plan for a person at /p/{id}.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"TikTok, Instagram, YouTube or X link."},"caption":{"type":"string","maxLength":3000,"description":"The post's caption and hashtags."},"image":{"type":"string","description":"A screenshot as a data URL (png, jpeg or webp, up to 5 MB)."},"lang":{"type":"string","enum":["en","de"],"default":"en"},"startDate":{"type":"string","format":"date","description":"First day of the trip, YYYY-MM-DD, today or later."},"days":{"type":"integer","minimum":1,"maximum":5}}}}}},"responses":{"200":{"description":"The plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"400":{"description":"The link is not from a supported platform, or the body is not JSON.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The post could not be read (needs_caption) or no trip was found in it (no_places).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Making the plan failed. Safe to try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/plan/{id}":{"get":{"operationId":"getPlan","summary":"Fetch a saved plan","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Plan id, the last part of a plan link."}],"responses":{"200":{"description":"The plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"404":{"description":"No plan with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"changePlanDates","summary":"Change a plan's dates or length","description":"Re-arranges the days around the forecast for the new dates.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Plan id, the last part of a plan link."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"startDate":{"type":"string","format":"date","description":"First day of the trip, YYYY-MM-DD, today or later."},"days":{"type":"integer","minimum":1,"maximum":5}}}}}},"responses":{"200":{"description":"The plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"404":{"description":"No plan with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Plan":{"type":"object","properties":{"id":{"type":"string"},"lang":{"type":"string","enum":["de","en"]},"destination":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"summary":{"type":"string"},"missing":{"type":"string","description":"What could not be told from the video, or empty."},"places":{"type":"array","items":{"$ref":"#/components/schemas/Place"}},"stays":{"type":"array","items":{"type":"integer"},"description":"Indexes into places of the hotels."},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":["string","null"],"format":"date"},"stops":{"type":"array","items":{"type":"integer"},"description":"Indexes into places, in visiting order."},"weather":{"type":["object","null"],"properties":{"date":{"type":"string","format":"date"},"kind":{"type":"string","enum":["clear","cloudy","fog","rain","snow","storm"]},"tMax":{"type":"number"},"tMin":{"type":"number"},"rain":{"type":"integer","description":"Chance of rain, 0-100."}}}}}},"startDate":{"type":["string","null"],"format":"date"},"weatherNote":{"type":"string","enum":["ok","too_far","unavailable","no_dates"]},"sourceUrl":{"type":"string"},"platform":{"type":"string"},"author":{"type":"string"},"testMode":{"type":"boolean","description":"True when the plan is a built-in sample, not made from the video."},"createdAt":{"type":"integer","description":"Unix time in milliseconds."}},"required":["id","destination","places","days"]},"Place":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["hotel","food","activity","sight","area"]},"city":{"type":"string"},"why":{"type":"string","description":"Why the video points to this place."},"outdoor":{"type":"boolean"},"rating":{"type":"number"},"ratingCount":{"type":"integer"},"mapsUrl":{"type":"string"},"photo":{"type":"object","properties":{"url":{"type":"string"},"pageUrl":{"type":"string"}}}},"required":["name","type","city","why","outdoor"]},"Error":{"type":"object","properties":{"error":{"type":"string","description":"Short code, e.g. needs_caption, no_places, unsupported, failed, not_found."},"message":{"type":"string"}},"required":["error"]}}}}