Code Examples
Get Dutch Bros US locations as JSON
The request uses GET /api/v1/locations. A data-enabled key with locations:read is required. BRANDMAPPR_KEY is a server-side environment variable.
JavaScript
const url = new URL('https://api.brandmappr.com/api/v1/locations');
url.search = new URLSearchParams({ brand: 'Dutch Bros', country: 'US' });
const response = await fetch(url, {
headers: { 'x-api-key': process.env.BRANDMAPPR_KEY },
});
if (!response.ok) throw new Error(`BrandMappr request failed: ${response.status}`);
const { count, locations } = await response.json();
console.log(count, locations.slice(0, 2));Use the geography guide for a city, state, or radius. Use the export guide to save GeoJSON for a map.
Last updated on