# buildmarketmaps.com API reference

Build and change market maps of real companies from your own code or an AI assistant. The API and the MCP server come with the Pro plan and use the same credits as the website.

## Authentication

Make a key in your account (https://buildmarketmaps.com/account) and send it on every call as `Authorization: Bearer bmm_your_key`. Making a new key stops the old one at once.

## Endpoints

### POST /api/v1/maps

**Build a map.** A new map from a plain-language prompt: segments planned, then filled with real companies and their logos.

Cost: 1 credit. A build that fails is refunded.

```bash
curl -X POST "https://buildmarketmaps.com/api/v1/maps" \
  -H "Authorization: Bearer bmm_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "AI coding assistants by company stage" }'
```

| Field | Notes |
|---|---|
| `prompt` | What to map, 3 to 600 characters. |

Finished within about 20 seconds (HTTP 200):

```
{
  "ok": true,
  "data": {
    "id": "3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21",
    "title": "AI Coding Assistants",
    "status": "done",
    "step": null,
    "next": null,
    "reply": "Built 4 sections with 32 companies.",
    "companies": 32,
    "sections": [
      { "title": "Code Completion & Copilots", "companies": ["GitHub Copilot", "Tabnine", "..."] },
      { "title": "Autonomous Coding Agents", "companies": ["Devin", "..."] }
    ],
    "look": { "theme": "clean", "columns": 2, "logo": "tile", "density": "comfortable" },
    "editor_url": "https://buildmarketmaps.com/make/3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21",
    "png_url": "https://buildmarketmaps.com/api/maps/3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21/export?format=png",
    "svg_url": "https://buildmarketmaps.com/api/maps/3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21/export?format=svg",
    "published": false,
    "public_url": null,
    "embed_code": null,
    "keep_fresh": false,
    "last_refresh": null,
    "last_refresh_note": null,
    "text": "AI Coding Assistants\n\nCode Completion & Copilots (8)\n- GitHub Copilot\n...",
    "spec": { "version": 4, "title": "AI Coding Assistants", "sections": ["..."] }
  },
  "credits": 1999
}
```

Still building: read it again (HTTP 202):

```
{
  "ok": true,
  "data": { "id": "3f2c0a9e-...", "status": "building", "step": "Filling Autonomous Coding Agents", "next": "Still building: read it again in about 5 seconds (GET /api/v1/maps/3f2c0a9e-...).", "companies": 16, "...": "..." },
  "credits": 1999
}
```

### GET /api/v1/maps/{id}

**Read a map.** The map now. While status is "building", call again every few seconds until it is "done" or "failed".

Cost: Free.

```bash
curl "https://buildmarketmaps.com/api/v1/maps/{id}" \
  -H "Authorization: Bearer bmm_your_key"
```

The map (HTTP 200):

```
{
  "ok": true,
  "data": {
    "id": "3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21",
    "title": "AI Coding Assistants",
    "status": "done",
    "step": null,
    "next": null,
    "reply": "Built 4 sections with 32 companies.",
    "companies": 32,
    "sections": [
      { "title": "Code Completion & Copilots", "companies": ["GitHub Copilot", "Tabnine", "..."] },
      { "title": "Autonomous Coding Agents", "companies": ["Devin", "..."] }
    ],
    "look": { "theme": "clean", "columns": 2, "logo": "tile", "density": "comfortable" },
    "editor_url": "https://buildmarketmaps.com/make/3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21",
    "png_url": "https://buildmarketmaps.com/api/maps/3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21/export?format=png",
    "svg_url": "https://buildmarketmaps.com/api/maps/3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21/export?format=svg",
    "published": false,
    "public_url": null,
    "embed_code": null,
    "keep_fresh": false,
    "last_refresh": null,
    "last_refresh_note": null,
    "text": "AI Coding Assistants\n\nCode Completion & Copilots (8)\n- GitHub Copilot\n...",
    "spec": { "version": 4, "title": "AI Coding Assistants", "sections": ["..."] }
  },
  "credits": 1999
}
```

### POST /api/v1/maps/{id}

**Change a map.** Send one of: an instruction in plain words, a look, publish, or keep_fresh.

Cost: As listed per field.

```bash
curl -X POST "https://buildmarketmaps.com/api/v1/maps/{id}" \
  -H "Authorization: Bearer bmm_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "instruction": "add Mistral to Foundation models" }'
```

| Field | Notes |
|---|---|
| `instruction` | 1 credit. Add or remove companies, split or merge sections, narrow to a region, rename. |
| `look` | Free. { "theme": "clean|shadcn|glass|dark|editorial|brand|soft|mono|paper|midnight|aurora|colorful", "columns": 1-4, "logo": "tile|square|wordmark|card", "density": "compact|comfortable|roomy" } |
| `publish` | Free. true makes a public page and an embed code; false takes them down (and stops keep_fresh). |
| `keep_fresh` | 1 credit a day while on, published maps only: closed companies come off, new ones that fit go on, logos refresh. |

The changed map (HTTP 200):

```
{
  "ok": true,
  "data": {
    "id": "3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21",
    "title": "AI Coding Assistants",
    "status": "done",
    "step": null,
    "next": null,
    "reply": "Built 4 sections with 32 companies.",
    "companies": 32,
    "sections": [
      { "title": "Code Completion & Copilots", "companies": ["GitHub Copilot", "Tabnine", "..."] },
      { "title": "Autonomous Coding Agents", "companies": ["Devin", "..."] }
    ],
    "look": { "theme": "clean", "columns": 2, "logo": "tile", "density": "comfortable" },
    "editor_url": "https://buildmarketmaps.com/make/3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21",
    "png_url": "https://buildmarketmaps.com/api/maps/3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21/export?format=png",
    "svg_url": "https://buildmarketmaps.com/api/maps/3f2c0a9e-6b1d-4c7e-9a52-1d8e4b7f0c21/export?format=svg",
    "published": false,
    "public_url": null,
    "embed_code": null,
    "keep_fresh": false,
    "last_refresh": null,
    "last_refresh_note": null,
    "text": "AI Coding Assistants\n\nCode Completion & Copilots (8)\n- GitHub Copilot\n...",
    "spec": { "version": 4, "title": "AI Coding Assistants", "sections": ["..."] }
  },
  "credits": 1999
}
```

### GET /api/v1/maps

**List maps.** The maps on the account, newest first.

Cost: Free.

```bash
curl "https://buildmarketmaps.com/api/v1/maps" \
  -H "Authorization: Bearer bmm_your_key"
```

Maps (HTTP 200):

```
{
  "ok": true,
  "data": [
    { "id": "3f2c0a9e-...", "title": "AI Coding Assistants", "status": "done", "published": true, "keep_fresh": true, "created": "2026-11-10T14:02:11.000Z", "updated": "2026-11-11T06:00:40.000Z" }
  ],
  "credits": 1999
}
```

### GET /api/maps/{id}/export?format=png

**Export a map.** The map as a PNG image or an SVG file (format=svg), with your footer line (set it in your account; empty for none).

Cost: Free.

```bash
curl "https://buildmarketmaps.com/api/maps/{id}/export?format=png" \
  -H "Authorization: Bearer bmm_your_key"
```

The file (HTTP 200):

```
Content-Type: image/png (or image/svg+xml), Content-Disposition: attachment
```

### DELETE /api/v1/maps/{id}

**Delete a map.** Deletes the map, its page and its embed.

Cost: Free.

```bash
curl -X DELETE "https://buildmarketmaps.com/api/v1/maps/{id}" \
  -H "Authorization: Bearer bmm_your_key"
```

Deleted (HTTP 200):

```
{ "ok": true, "data": { "deleted": true }, "credits": 1999 }
```

## Errors

Errors answer `{ "ok": false, "error": "<code>", "message": "...", "credits": n }`.

| HTTP | error | Meaning |
|---|---|---|
| 400 | `bad_request` | The prompt or instruction is missing or too short. |
| 401 | `invalid_key` | The key is missing, mistyped, or was replaced by a new one. |
| 402 | `plan_required` | The API comes with Pro, or the action (publish, keep fresh) needs a plan. |
| 402 | `no_credits` | The account is out of credits. Top up or change plan. |
| 404 | `not_found` | No map with that id on this account. |
| 409 | `busy` | The map is still building. Read it again, then send the change. |
| 409 | `not_published` | keep_fresh needs a published map. |
| 503 | `engine_off` | Map building is paused for a moment. Try again shortly; nothing was charged. |

## Timing

- A map builds in about 20 seconds. Calls answer within that time with the map so far (202) and the rest arrives on GET.
- One change at a time per map: a change sent while it is building answers 409.
- Every answer carries "credits": what the account has left after the call.

## Use it from Claude, ChatGPT or Cursor (MCP)

An MCP server at `https://buildmarketmaps.com/api/mcp` (streamable HTTP, JSON-RPC 2.0). Sign in with OAuth from Claude, or use your API key as the token:

```json
{
  "mcpServers": {
    "buildmarketmaps": {
      "url": "https://buildmarketmaps.com/api/mcp",
      "headers": { "Authorization": "Bearer bmm_your_key" }
    }
  }
}
```

| Tool | Arguments | What it does |
|---|---|---|
| `build_market_map` | prompt | Builds a map (1 credit). Read it with get_market_map while it is building. |
| `get_market_map` | id | The map now, with sections, companies and links. Free. |
| `edit_market_map` | id, instruction | Changes a map in plain words (1 credit). |
| `style_market_map` | id, theme, columns, logo, density | Restyles a map. Free. |
| `publish_market_map` | id, publish | Publishes a page and embed code, or takes them down. Free. |
| `keep_market_map_fresh` | id, on | Daily updates on or off (1 credit a day while on). |
| `list_market_maps` | none | The maps on the account. Free. |
