Introducing the Images API
Layout now finds the photo a restaurant published of any item on its menu and serves it from its own CDN. It is never a stock or generated image.
What changed
- POST /v1/images/items takes an
itemin the person's words and a restaurant byplaceIdorquery. A photo Layout already holds answers at once. Otherwise Layout reads the restaurant's own site and answers200when it finds one within about 12 seconds, or202with animageIdto poll for free. - Layout stops looking 35 seconds after your request. A poll after that answers
no_photowith reasonnot_found_in_time, so a person is never left waiting on a picture. - Every
/v1/menusitem Layout already holds a photo for carries animage, with no extra request and no extra allowance. - An OAuth connection over MCP has the same lookup as the
item_phototool.
Why it matters
A person deciding what to eat wants to see it. A chain needs no branch and no open store, because its photos are the same everywhere, and the item's spelling and phrasing need not match the menu.
What to do
Call it with a person credential, the same as places and menus.
curl https://api.layout.link/v1/images/items \
-H "Authorization: Bearer $LAYOUT_PERSON_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "item": "iced latte", "query": "Layout test kitchen" }'
Show the cdn.layout.link URL rather than copying the file: when a restaurant asks Layout to take its photos down, the URLs stop serving everywhere at once. A search that opens the restaurant's site counts toward a new daily allowance of image searches, 300 in sandbox and 2,000 for an approved production application; a photo Layout already holds never counts. See limits.
Breaking changes
None. image is a new optional field on menu items, and the routes are new.