The mapiyo API
Read your maps and numbers from Claude, scripts and reports.
The API gives read access to the maps of every Klaviyo account connected to your login, plus a few actions (start a sync, connect an account). Use it from Claude, a report script, or any tool that can make HTTPS requests.
Authentication
- Open Settings and create a token under API tokens. Copy it right away; it's shown once.
- Send it with every request:
Authorization: Bearer mpy_…
A token acts as your login. Keep it private, and revoke it in Settings if it leaks.
Endpoints
Base URL: https://mapiyo.app/api/v1. Accounts can be referenced by mapiyo id or by Klaviyo account id as klaviyo:ABC123.
| Request | Returns |
|---|---|
GET /accounts | Connected Klaviyo accounts, latest snapshot date and profile total |
GET /accounts/{id} | Summary: profiles, subscribers, placement quality, top cities. Add quarter=2026-Q3 for new profiles that quarter vs. the one before |
GET /accounts/{id}/states | One row per state (or country with view=world): profiles, subscribers, per 100k residents, and with a quarter, new profiles, change vs. last quarter and list growth |
GET /accounts/{id}/map.png | A rendered heat map image. Also map.svg, and map.json for the legend only |
GET /accounts/{id}/datacenters | Every suspected data center place, why it was flagged, and whether it's left out. Add format=csv for a spreadsheet |
GET /accounts/{id}/audiences | Every list and segment, with the scope value to map it |
GET /accounts/{id}/layers | Uploaded location layers (stores, retailers and so on). Add points=1 for every location, or format=geojson or format=csv |
GET /accounts/{id}/sync | Status and progress of the latest sync |
POST /accounts/{id}/sync | Start a sync. Body: {"scope":"segment:XyZ"} (optional) |
POST /accounts/connect | Connect a Klaviyo account with a private key. Body: {"private_key":"pk_…","klaviyo_login":"you@agency.com"} |
GET /brands | Your saved brands (ids for brand= on map images) |
Common options
scope:all(default),list:{id}orsegment:{id}(must have been mapped).quarter=2026-Q3, orfrom/to(YYYY-MM-DD) with optionalcompare_from/compare_to. Addcompare=noneto skip the comparison.date=YYYY-MM-DD: use the latest snapshot on or before that date.- Map images:
view=us|world,measure=subscribers|profiles|per_capita|new_profiles|new_subscribers,width(up to 4000),height,transparent=1,borders=0, and eitherbrand={id}orcolor/background/borderas hex (e.g.color=D68B55). The legend comes back in theX-Mapiyo-Legendheader. datacenters=include: put profiles at suspected data centers back in. They're left out by default (a change from October 2026), like on the dashboard, and the places you kept or left out there apply here too. Every response says what happened in adatacentersobject, and map images and CSVs carryX-Mapiyo-Datacenters(excludedorincluded) andX-Mapiyo-Datacenters-Excluded(profiles left out).layers=all, or layer ids from/layersseparated by commas: draw location layers onmap.pngandmap.svg. The key comes back in theX-Mapiyo-Layersheader and inmap.json. Without it, images are unchanged.coordinates=exclude: leave out profiles placed only from latitude and longitude, like turning off Include locations from coordinates on the dashboard. The summary reportsus_state_from_coordinatesandcountry_from_coordinateseither way.
What "new" means
"New profiles" in a period are profiles created in Klaviyo during that period that are still in the account today. "Subscribers" are profiles currently subscribed to email marketing. mapiyo stores counts only, never names or email addresses.