---
title: "Locate the closest Starbucks to a coordinate"
method: GET
path: "/starbucks/nearest-store"
tags: ["Starbucks"]
---

# Locate the closest Starbucks to a coordinate

`GET /starbucks/nearest-store`

## Request

- Base URL: `https://api.crawlora.net/api/v1`
- URL: `https://api.crawlora.net/api/v1/starbucks/nearest-store`
- Auth: API key in header `x-api-key`

Returns the coordinates and distance of the single closest Starbucks store to a point. Both lat and lng are required. This endpoint returns coordinates only, not store details: it is what Starbucks' own store locator uses to centre its map. Use /starbucks/stores for full store records. A point with no nearby store returns a well-formed result with found set to false rather than an error. market selects which Starbucks country site answers, one of us or ca, defaulting to us.

## Query parameters

- `lat` number, required
- `lng` number, required
- `market` 'us' | 'ca'

## Headers

- `x-api-key` string, required

## Response `200`

OK

- StarbucksNearestStoreResponseDoc
  - `code` integer
  - `data` StarbucksNearestStoreResponse
    - `distance_miles` number
    - `fetched_at` string
    - `found` boolean: Found is false when Starbucks reports no nearest store for the point at all.
    - `lat` number
    - `lng` number
    - `market` string
    - `nearest_latitude` number
    - `nearest_longitude` number
    - `source_url` string
  - `msg` string

## Other responses

- `400`: Bad Request
- `429`: Too Many Requests
- `503`: Service Unavailable

---

[API](https://skmtc.dev/crawlora/apis/crawlora-api.md) · [All operations](https://skmtc.dev/crawlora/apis/crawlora-api/llms.txt) · [OpenAPI document](https://skmtc.dev/crawlora/apis/crawlora-api/revisions/0497899e2016?raw)
