Skip to Content
Locations API

Locations API

GET https://api.brandmappr.com/api/v1/locations 

Returns JSON or GeoJSON location records for a brand, with optional geographic filters.

Quick check

curl --fail-with-body --silent --show-error --get \ "https://api.brandmappr.com/api/v1/locations" \ -H "x-api-key: $BRANDMAPPR_KEY" \ --data-urlencode "brand=Dutch Bros" --data-urlencode "country=US"

Query parameters

All parameters are query-string — there is no request body.

ParamTypeRequiredDefaultDescription
brandstringyes—Brand name, stock ticker (SBUX), or a known variant (McDonalds). Resolved to a canonical brand, including its aliases
countrystringno—ISO 3166-1 alpha-2 only — US, GB, DE, JP. Anything else returns 400 INVALID_COUNTRY
statestringno—State or province code — CA, TX, ON
citystringno—City name, case-insensitive
postcodestringno—Postal or ZIP code
radius_kmnumberno—Radius in km from the city centre. Requires city. Maximum 100 — see below
storefront_typestringno—One of full_retail, small_format, pickup, studio, other
snapshotstringnoomitted1 selects the versioned retained snapshot representation; any other supplied value returns 400 INVALID_REQUEST
formatstringnojsonjson or geojson. No image formats, and no CSV — file delivery belongs to the ad-hoc purchase flow

radius_km is capped at 100 km

radius_km selects locations near a city. The documented use cases are 5–50 km; at 500 km a circle from Bicester covers most of England, and the query becomes expensive enough to hit the database’s statement timeout intermittently.

A value above 100 returns 400 with max_radius_km in the body. It is never silently clamped — a narrowed radius would hand you a truncated set that looks complete, which is the failure this API works hardest to avoid.

For a wider area, filter by country or state instead of widening the circle.

Response — format=json

{ "brand": "Starbucks", "count": 1604, "attribution": { "text": "© All The Places, © Foursquare, © Overture Maps Foundation", "scope": "catalogue", "note": "Names every source contributing to the BrandMappr catalogue, not only those behind the rows in this response." }, "locations": [ { "brand": "Starbucks", "name": "Starbucks", "address": "Aberdeen University, Crombie Annexe, Meston Walk", "lat": 57.163755, "lng": -2.103234, "city": "Aberdeen", "state": "Aberdeen City", "country": "GB", "postcode": "AB24 3FX", "phone": null, "last_updated": "2026-07-25T00:00:00Z" } ] }

Location fields

These 11 fields are the default public location contract. The snapshot opt-in below adds scoped identity and edition evidence. Audit metadata remains separately scope-gated.

FieldTypeDescription
brandstringCanonical brand name as stored in our index
namestring | nullDisplay name of the specific location (often the same as the brand)
addressstring | nullFull street address
latnumberLatitude
lngnumberLongitude
citystring | nullCity name
statestring | nullState or province code
countrystring | nullISO 3166-1 alpha-2 country code
postcodestring | nullZIP or postal code
phonestring | nullContact phone — often blank, treat as best-effort
last_updatedstring | nullSee the warning below: this is a load time, not a data date

Do not depend on anything else appearing inside a location object. Internal columns — confidence, review state, source metadata, retailer references, raw geometry — are withheld deliberately and will not be added silently. attribution is a sibling of locations, not a field on one.

Response — format=geojson

An RFC 7946 FeatureCollection. Coordinates are [lng, lat] — longitude first, per the spec — and appear only in geometry, so each feature’s properties carries the same fields minus lat and lng.

{ "type": "FeatureCollection", "properties": { "brand": "Greggs", "count": 1411 }, "attribution": { "text": "© All The Places, © Foursquare, © Overture Maps Foundation", "scope": "catalogue", "note": "…" }, "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-1.28242573, 51.67061776] }, "properties": { "brand": "Greggs", "name": "Greggs", "address": "12 High Street", "city": "Bicester", "state": "Oxfordshire", "country": "GB", "postcode": "OX26 6AN", "phone": null, "last_updated": "2026-07-25T00:00:00Z" } } ] }

properties and attribution on the collection are RFC 7946 §6.1 foreign members — members not defined by GeoJSON, which the spec explicitly permits on any GeoJSON object. A conforming parser must tolerate them rather than reject the document. Attribution sits on the collection rather than on each feature because the notice describes the dataset; repeating it across 37,000 features would bloat the response for no gain.

The media type is application/json, not application/geo+json.

Opt-in retained snapshot (snapshot=1)

Omitting snapshot preserves the existing JSON/GeoJSON response and 11 public location fields. snapshot=1 selects brandmappr.locations.snapshot.v1. Other supplied values return 400 INVALID_REQUEST. format=json and format=geojson remain supported. Access, billing, attribution and locations:audit scope behavior remain unchanged. Snapshot requests do not grant audit metadata.

The response adds a top-level snapshot object and two fields on each JSON location or GeoJSON feature’s properties:

FieldValue and meaning
snapshot.contract_versionbrandmappr.locations.snapshot.v1
snapshot.snapshot_idsha256:<64 lowercase hex digits>, content identity of the canonical contract version, resolved brand, normalized filters, attribution and sorted returned logical rows, before row IDs are added
snapshot.returned_row_countNumber of returned rows, equal to count; counts rows, with no inferred premises or storefront count
snapshot.filtersbrand (trimmed input), country (validated normalized alpha-2 or null), state, city (lowercase or null), postcode, radius_km, storefront_type; absent/empty string filters become null
snapshot.retrieved_atResponse construction time in UTC. Excluded from the content hash. Not an upstream edition date
snapshot.retrieval{ "status": "complete", "basis": "ordered_pages_with_matching_exact_counts" }; resolver reads and every location page passed completeness checks
snapshot.completeness{ "filtered_rows": "retrieved", "distinct_premises": "unknown", "storefronts": "unknown", "trading_footprint": "unknown" }
snapshot.consistency{ "status": "not_guaranteed", "reason": "Separate reads are not an atomic database snapshot; equal counts cannot detect every concurrent change." }
snapshot.identity_scoperetained_content_only
snapshot.legal_sourceunknown_per_row; the operational source type is insufficient to identify an exact legal source
snapshot_row_idSHA-256 of the canonical {snapshot_id,index} object. Index is zero-based in the sorted logical rows. Unique within this snapshot, including byte-identical duplicate rows. Changes when the snapshot changes. No internal database ID is exposed
source_editionValidated upstream evidence as defined below, otherwise explicit unknown

Canonical hashing uses UTF-8 JSON, lexicographically sorted object keys, preserved array order and JSON string/number serialization. Returned logical rows sort by their canonical JSON, including public fields, edition evidence and any separately authorized audit fields. All rows are retained. Output format and retrieval time are excluded. This is a logical-content hash, not a hash of the transport bytes, a publisher edition or a permanent physical-location identity.

source_edition is either { "status": "unknown", "reason": "no_validated_upstream_edition" } or { "status": "recorded", "publisher": "All The Places", "edition": "2026-09-19-13-32-18", "run_started_on": "2026-09-19", "evidence": "source_metadata.atp_run_id" }. Recorded evidence requires source type atp plus a calendar/time-valid upstream atp_run_id. The run date is its start date, not verification time or a claim that the place is trading. Other publishers remain unknown. The conflated atp source type alone never establishes edition or legal source.

Radius requests preserve the existing RPC selection: country and state choose the city-center lookup, then the radius may cross those borders. They are not a country/state clipping guarantee. postcode does not add a clip to the radius RPC. Snapshot requests escape literal brand % and _ characters so the RPC cannot broaden the requested brand. No database migration is included.

Retrieval rejects alias/ticker/sibling errors, ambiguous resolution, alias expansion beyond the supported bound, missing exact counts, short/oversized pages, repeated/unordered database identities, count drift and invalid/unreadable source-policy settings. Known failures return 500 INTERNAL_ERROR with no snapshot. Zero filtered rows retain the existing free 404 NOT_FOUND. Ordinary callers retain the existing retrieval behavior. Ordered pages and equal counts still cannot prove a point-in-time database snapshot across separate reads.

Retention contract for Studio: save the full successful response with its attribution and exact response bytes, plus content identity and retrieval metadata. Keep the prior good snapshot on failure. Reopen from the saved bytes without refetching. Store a separate SHA-256 of those bytes if byte integrity must be checked. This API candidate does not implement or prove the Studio adapter.

Response headers

HeaderDescription
X-Location-CountRows returned. Same value as count in the body
X-BrandThe canonical brand your input resolved to
X-Credits-ChargedAlways 0 on this route — see Access and billing
X-AttributionCatalogue-wide notice. Prefer the body’s attribution object — the header percent-encodes ©
X-Data-SourcesSource types present in this response (e.g. atp,fsq,overture). Operational provenance, not an attribution instruction. Widens to include alias-contributed types on an audit-scoped response
X-RateLimit-Limit / -Remaining / -WindowLive rate-limit state for your key. See Rate Limits

Coverage and CSV quote responses report the newest load timestamp in their sellable dataset scope. Preview rows retain their own load timestamps.

Access and billing

This route requires the locations:read scope and data access.

PrincipalResult
credits / metered / trial customer403 DATA_ACCESS_FORBIDDEN — cannot use this route at all
enterprise / unlimited customer200, X-Credits-Charged: 0
Service principal (internal system)200, X-Credits-Charged: 0, never billed

Two consequences worth knowing before you write error handling:

  • 402 is not reachable on this route. Every principal that can reach a 200 here is charged nothing.
  • The trial-cap headers are not reachable either. A trial key is refused at the data-access gate before any row is served, so X-Trial-Cap-Applied and X-Total-Available never appear.

If you need location data and hold a standard-tier key, use the one-time ad-hoc purchase flow or ask about an enterprise plan.

How to consume it

Take a full snapshot per brand — optionally per country — and replace your copy wholesale.

  • There is no incremental sync or permanent physical-location ID. The snapshot=1 opt-in adds IDs scoped to the retained snapshot. The response deliberately omits our internal database identifier, because that identifier is not guaranteed to be stable: it can change when de-duplication picks a different winning record, when one source replaces another, or when the catalogue is reloaded. Publishing it would imply a permanence we cannot currently promise, and anything built on it would break silently. If you need incremental sync, ask — it requires a deliberately stable location_id plus dataset-level versioning, which are planned and do not exist yet.
  • No pagination, and no truncation. One call returns the complete filtered set. We page internally past the database’s row limit, so a large brand comes back whole rather than silently cut — a truncated response that looks complete is the failure this design most wanted to avoid.
  • Expect real payloads. The largest single brand×country pairs are roughly 18,000 rows (Starbucks US) and 37,000 (7-Eleven Japan) — on the order of 4–12 MB of JSON. A whole brand worldwide is larger again. Filter by country/state/city for smaller responses, and raise your client timeout for the big ones. Large queries take seconds, not milliseconds: do not put an uncached call in a page-render path.
  • Cache aggressively. The underlying catalogue reloads roughly monthly, so a snapshot refreshed nightly is already fresher than the data changes.

last_updated is not a data date. It records when the row was last loaded into our database, not when the store information was last verified, and it is close to uniform across the catalogue. Do not present it to an end user as an “as of” date.

Errors

HTTPCodeMeaning
400INVALID_REQUESTbrand missing, radius_km without city, a radius_km that is non-positive or above 100 (body returns max_radius_km), or an unknown storefront_type
400INVALID_FORMATAn unsupported format. Use json or geojson. The body returns valid_formats
400INVALID_COUNTRYcountry is not ISO alpha-2. Body returns received, plus a hint when the value looks like a subdivision code
401UNAUTHORIZEDMissing, malformed, or disabled key
403INSUFFICIENT_SCOPEYour key does not hold locations:read. Body returns required_scope and granted_scopes
403DATA_ACCESS_FORBIDDENA standard-tier customer key asked for data. Use a data-enabled key
404NOT_FOUNDNo locations matched. A normal outcome, not an error, and never charged
429RATE_LIMIT_EXCEEDEDOver your limit. Honour Retry-After
500INTERNAL_ERRORA read failed

Validation runs before authentication, so a malformed request spends nothing and leaks nothing.

A 500 never degrades to an empty success. Zero filtered rows return 404 NOT_FOUND. Treat 500 as retryable, and never overwrite a good snapshot with the result of a failed call.

Country codes are validated, never normalised

A code like CN-TW returns 400 INVALID_COUNTRY rather than being mapped to its alpha-2 prefix. Mapping is not a safe transformation:

  • CN-TW → CN maps Taiwan onto mainland China — a Taiwan query would silently return thousands of mainland rows.
  • US-CA → CA maps California onto Canada.

Taiwan is present as TW in its own right. Returning 400 instead of 404 matters because it stops a malformed code being indistinguishable from a market with no locations.

Attribution and licensing

Location data is reconciled from Overture Maps (CDLA-Permissive-2.0), Foursquare Open Places (Apache-2.0), All The Places (CC0-1.0), and our own harvesting from retailer store locators.

OpenStreetMap-derived records are excluded from this endpoint entirely, because ODbL share-alike is incompatible with onward licensing. Do not re-add OSM data into a dataset you then represent as sourced from us.

Read attribution.text from the response body, not the X-Attribution header, whenever the text will be displayed or exported. HTTP header values are effectively ISO-8859-1, so the header ships the copyright sign percent-encoded as %C2%A9. The failure is silent — the header is present, and a client that decodes it shows the right thing — so it surfaces only when someone preserves the string verbatim and renders %C2%A9 on a slide. JSON is UTF-8 by definition. The header is unchanged and still sent; the body is purely additive.

scope is always catalogue, and says so in-band: the text names every source contributing to the BrandMappr catalogue, not only the sources behind the rows you just received. Treat it as a notice, not as a statement about your payload.

X-Data-Sources is different — it lists the source types actually present in this response — but it is operational provenance and not a legally sufficient attribution instruction: overture names our source type rather than Overture’s own upstream contributor chain, and atp conflates genuine All The Places records with BrandMappr’s own harvested records, which are not open data. Do not construct legal attribution by mapping X-Data-Sources.

If you plan to expose this data to your own end users or customers, or to export it into images, SVG or slide decks, flag it before you ship.

Code examples

const url = new URL("https://api.brandmappr.com/api/v1/locations"); url.searchParams.set("brand", "Starbucks"); url.searchParams.set("country", "GB"); const res = await fetch(url, { headers: { "x-api-key": process.env.BRANDMAP_API_KEY } }); if (!res.ok) { const err = await res.json(); // Never overwrite a good snapshot on failure. throw new Error(`${res.status} ${err.code}: ${err.error}`); } const { brand, count, attribution, locations } = await res.json();
import requests res = requests.get( "https://api.brandmappr.com/api/v1/locations", headers={"x-api-key": API_KEY}, params={"brand": "Starbucks", "country": "GB"}, timeout=120, # the largest brand-country pairs run to ~37,000 rows ) res.raise_for_status() data = res.json() print(data["count"], data["attribution"]["text"])
Last updated on