# get_campaign_performance

> Spend, clicks, orders, sales and ACoS for each campaign over a date range, in the same fields on Amazon and Google Ads.

## Endpoint

POST https://build-api.sellermate.ai/v1/tools/get_campaign_performance — Spend, clicks, orders, sales and ACoS for each campaign over a date range, in the same fields on Amazon and Google Ads. (writes: no; platforms: Amazon, Google Ads)

The call shape is illustrative until the contract is final.

## When to use it

Use it for client reports, budget pacing, an exec card or a ranked board. Ask for the same dates on Amazon and Google Ads to put them side by side.

## Request fields

| Name | Type | Required | Description |
|---|---|---|---|
| `account` | string | yes | The account to read. A key only reaches the accounts you chose when you created it. |
| `start` | date | no | First day, as `YYYY-MM-DD`. |
| `end` | date | no | Last day, as `YYYY-MM-DD`. |

## Response fields

Every answer says how fresh it is with `data_as_of`.

| Name | Type | Description |
|---|---|---|
| `platform` | string | The platform the row came from, for example `amazon` or `google_ads`. |
| `account_id` | string | The account the row belongs to. |
| `campaign_name` | string | The campaign, as named on the platform. |
| `spend` | number | Spend over the period, in the account currency. |
| `clicks` | number | Clicks over the period. |
| `orders` | number | Orders over the period. |
| `sales` | number | Sales over the period, in the account currency. |
| `acos` | number | Spend divided by sales, as a fraction. |
| `currency` | string | One currency per account. |

_To write: confirm the exact types and units of each field, and add any field beyond these nine_

## Examples

**curl**

```bash
curl -X POST https://build-api.sellermate.ai/v1/tools/get_campaign_performance \
  -H "X-API-Key: $BUILD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"account":"acct_123","start":"2026-10-01","end":"2026-10-28"}'
```

**Node**

```js
const res = await fetch("https://build-api.sellermate.ai/v1/tools/get_campaign_performance", {
  method: "POST",
  headers: { "X-API-Key": process.env.BUILD_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ account: "acct_123", start: "2026-10-01", end: "2026-10-28" }),
});
console.log(await res.json());
```

**Python**

```python
import os, requests

res = requests.post(
    "https://build-api.sellermate.ai/v1/tools/get_campaign_performance",
    headers={"X-API-Key": os.environ["BUILD_API_KEY"]},
    json={"account": "acct_123", "start": "2026-10-01", "end": "2026-10-28"},
)
print(res.json())
```

**Response**

```json
{
  "rows": [
    {
      "platform": "amazon",
      "account_id": "amz_northwind",
      "campaign_name": "SP - Bottles - Exact",
      "spend": 1842.10,
      "clicks": 2210,
      "orders": 161,
      "sales": 6120.40,
      "acos": 0.301,
      "currency": "USD"
    }
  ],
  "meta": { "data_as_of": "2026-10-30T06:00:00Z" }
}
```

_To write: replace with a real response from the API, including the real envelope around rows_

## Errors

### 429 Too many requests

You went over the plan's requests per minute. The body says when to retry.

```json
{ "error": "rate_limited", "retry": 12, "upgrade": "https://build.sellermate.ai/pricing" }
```

_To write: the other errors this tool can return, with the real status and body: a missing or wrong key, an account the key cannot reach, bad dates_

## Platforms

- Amazon: Reads: yes · Writes: yes
- Google Ads: Reads: yes · Writes: no

## Open in your AI

Paste this into Claude Code, Cursor, Lovable, n8n or Zapier. It points your AI at the docs and at your key.

Prompt:

```
Read https://build.sellermate.ai/SKILL.md. My key is in BUILD_API_KEY. Use get_campaign_performance to show last week’s spend, sales and ACoS for each campaign, worst ACoS first.
```
