# Starbucks Search ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/starbucks/search` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 3 credits per call | | **Documentation** | https://www.piloterr.com/library/starbucks-search | ## Description Nearest Starbucks cafés from coordinates or a store-locator URL. Returns address, hours, amenities, and the store number used by Menu and Product. ## Authentication - **Key Name:** `x-api-key` - **Location:** HTTP Header - **Get an API key:** https://app.piloterr.com/register ## Example Request ```bash curl --location --request GET 'https://api.piloterr.com/v2/starbucks/search' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### Nearest café to downtown Los Angeles ```json { "results": [ { "name": "DTLA Grand Park", "open": false, "phone": "+1 213-625-2205", "address": { "city": "Los Angeles", "line1": "217 N. Hill Street", "region": "CA", "country": "US", "formatted": "217 N. Hill Street, Los Angeles", "postal_code": "90012" }, "distance": 0.262, "schedule": [ { "day": "thursday", "open": true, "hours": "4:30 AM to 9:00 PM" }, { "day": "friday", "open": true, "hours": "4:30 AM to 9:00 PM" }, { "day": "saturday", "open": true, "hours": "5:00 AM to 5:00 PM" }, { "day": "sunday", "open": true, "hours": "5:00 AM to 5:00 PM" }, { "day": "monday", "open": true, "hours": "4:30 AM to 9:00 PM" }, { "day": "tuesday", "open": true, "hours": "4:30 AM to 9:00 PM" }, { "day": "wednesday", "open": true, "hours": "4:30 AM to 9:00 PM" } ], "store_id": "69543", "amenities": [ "In café", "Mobile Order and Pay", "MOP ASAP + Scheduled Ordering", "Nitro Cold Brew", "Oven-warmed Food", "Redeem Rewards", "Starbucks Wi-Fi" ], "time_zone": "GMT-07:00 America/Los_Angeles", "coordinates": { "latitude": 34.05612, "longitude": -118.24698 }, "open_status": "Opens Thursday at 4:30 AM", "hours_status": "Open 4:30 AM-9:00 PM", "store_number": "9230-154245", "ownership_type_code": "co", "recommendation_reason": "nearby" } ], "pagination": { "next": null, "page": 1, "per_page": 50, "total_pages": null, "total_results": null } } ``` ## Documentation ## Overview Starbucks Search returns the cafés closest to a point. Send `lat` and `lng`, or a store-locator URL that already contains them, such as `map=40.71391,-74.01121,12z`. This endpoint does not return drink prices. Copy `store_number`, then call [Starbucks Product](https://www.piloterr.com/library/starbucks-product) for a price on every size, or [Starbucks Menu](https://www.piloterr.com/library/starbucks-menu) for the default size of each item. The list has up to 50 cafés, nearest first. Each café includes its address, hours, amenities, and `store_number`. That number is what you pass to [Starbucks Menu](https://www.piloterr.com/library/starbucks-menu) and [Starbucks Product](https://www.piloterr.com/library/starbucks-product). There is no second page. `pagination.next` is `null`. ## Quickstart ``` GET https://api.piloterr.com/v2/starbucks/search?lat=34.054908&lng=-118.242643 GET https://api.piloterr.com/v2/starbucks/search?query=https://www.starbucks.com/store-locator?map=40.71391,-74.01121,12z GET https://api.piloterr.com/v2/starbucks/search?lat=40.712775&lng=-74.005973&place=New%20York,%20NY&features=ON ``` The Los Angeles coordinates above resolve to DTLA Grand Park (`9230-154245`) as the nearest café. The New York URL resolves to cafés around lower Manhattan. Adding `features=ON` keeps cafés that offer mobile order, and the nearest result is Park Row at Beekman St (`849-2059`). ## Where this fits 1. **Search** (this endpoint): pick a café and copy `store_number`. 2. **Menu**: the full order menu for that café, priced at the default size. 3. **Product**: one item, with a price for every size. A short number (`9230`) and the full number (`9230-154245`) both work on Menu and Product. ## Parameters | Parameter | Type | Required | Description | |---|---|---|---| | `lat` | number | no | Latitude. Send it with `lng` | | `lng` | number | no | Longitude. Send it with `lat` | | `query` | string | no | Store-locator URL or `lat,lng`. Required when `lat` and `lng` are empty | | `place` | string | no | Place label sent with the coordinates, such as `New York, NY` | | `features` | string | no | Amenity filter. `ON` keeps mobile-order cafés. Separate several codes with commas | Send coordinates. A city name in `place` does not replace them. If `lat` and `lng` are both set, they win over any coordinates inside `query`. ## Each café | Field | Type | Description | |---|---|---| | `store_number` | string | Full café number, for example `9230-154245` | | `store_id` | string | Starbucks id for the café | | `name` | string | Café name | | `distance` | number \| null | Distance from the point you sent | | `recommendation_reason` | string or null | Why Starbucks included this café, such as `nearby` | | `phone` | string \| null | Phone number | | `open` | boolean \| null | Whether the café is open now | | `hours_status` | string \| null | Hours summary, such as `Open 5:00 AM-8:00 PM` | | `open_status` | string \| null | Next opening or closing line | | `ownership_type_code` | string \| null | Ownership code, such as `co` | | `address` | object | `line1`, `city`, `region`, `postal_code`, `country`, `formatted` | | `coordinates` | object | `latitude`, `longitude` | | `time_zone` | string \| null | Time zone of the café | | `amenities` | string[] | Services offered at the café | | `schedule` | object[] | One row per day: `day`, `hours`, `open` | ## Pagination | Field | Description | |---|---| | `page` | Always `1` | | `per_page` | Number of cafés in this response | | `total_results` | `null`. Starbucks does not return a total | | `total_pages` | `null` | | `next` | `null` | ## Errors | Code | Meaning | |---|---| | `400` | No coordinates, or the URL is not on starbucks.com | | `404` | The locator response could not be read as a list of cafés | | `500` | The request failed |