Image Response
When format is "png" or "jpeg", the response body is the raw image binary. The response is not JSON.
Response headers
| Header | Type | Description |
|---|---|---|
Content-Type | string | image/png or image/jpeg |
X-Location-Count | number | Number of locations plotted |
X-Brand | string | Brand name queried |
X-Region | string | Region filter applied |
X-Render-Time | string | Render duration (e.g. "4231ms") |
X-Cached | boolean | Always false for images — renders are not cached (see below) |
Cache-Control | string | no-store — image renders are never cached |
X-Credits-Charged | number | Credits deducted for this request |
X-Credits-Remaining | number | Credits remaining on your key |
X-Credits-Low | boolean | Present and true when balance drops below 50 |
Handling image responses
The response body is binary data, not JSON. Handle it according to your platform:
const res = await fetch("https://api.brandmappr.com/api/v1/location-map", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "bm_live_your_key"
},
body: JSON.stringify({
brand: "Starbucks",
format: "png",
country: "US",
style: "light"
})
});
// Browser: convert to blob URL
const blob = await res.blob();
const url = URL.createObjectURL(blob);
// Node.js: write to file
const buffer = Buffer.from(await res.arrayBuffer());
fs.writeFileSync("map.png", buffer);💡
Image renders are sent with Cache-Control: no-store and are not cached — every request triggers a fresh render and is charged accordingly (this prevents stale maps when the underlying data updates). Server-side caching applies only to data responses (json/csv/geojson); for image formats the X-Cached header is always false.
Rendering options
See Parameters for the full list. Key options for image output:
width/height— up to 4096×4096 pixelsstyle— six themes: light, dark, voyager, pitchbook, slate, warmmarker_color— any hex colorheatmap— density heatmap instead of individual pinsinclude_legend— brand name and location count overlayfocus_country— isolate a single country (see Focus Mode)