# Keywords

Read the Sponsored Products and Sponsored Brands keywords your Amazon campaigns run, add keywords and negative keywords, change a keyword's bid or status, and archive it.

import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

Sponsored Products and Sponsored Brands ad groups show on the searches their keywords match. Zernio syncs them with their metrics and writes new ones to Amazon.

## Read synced keywords

Call `GET /v1/ads/keywords` with the `amazonads` account and the profile as `adAccountId`.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: synced } = await zernio.adcampaigns.listAdKeywords({
  query: {
    accountId: '66b2e19d8c3f5a7e9d0b1c2d',
    adAccountId: '3245678901234567',
    negative: false,
    limit: 100
  }
});

console.log(synced.keywords);
```
</Tab>
<Tab value="Python">
```python
synced = client.ad_campaigns.list_ad_keywords(
    account_id="66b2e19d8c3f5a7e9d0b1c2d",
    ad_account_id="3245678901234567",
    negative=False,
    limit=100,
)

print(synced["keywords"])
```
</Tab>
<Tab value="curl">
```bash
curl "https://zernio.com/api/v1/ads/keywords?accountId=66b2e19d8c3f5a7e9d0b1c2d&adAccountId=3245678901234567&negative=false&limit=100" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```
</Tab>
</Tabs>

Response (`200`), trimmed:

```json
{
  "keywords": [
    {
      "id": "66f2b3c4d5e6f7a8b9c0d1f0",
      "platformCriterionId": "412345678901234",
      "platform": "amazon",
      "adAccountId": "3245678901234567",
      "campaignId": "190345678901234",
      "adSetId": "205678901234567",
      "keyword": "trail bottle",
      "matchType": "exact",
      "status": "active",
      "negative": false,
      "metrics": { "windowDays": 30, "clicks": 41, "impressions": 1980, "cost": 28.7, "conversions": 6 }
    }
  ],
  "pagination": { "page": 1, "limit": 100, "total": 1, "pages": 1 }
}
```

The filters are those of [List ad keywords](/ad-campaigns/list-ad-keywords): `campaignId`, `adSetId`, `status`, `matchType`, `negative` and `search`.

## Add keywords

Call `POST /v1/ads/keywords` with a Sponsored Products or Sponsored Brands ad group as `adSetId`. New keywords bid the ad group's default bid. `negative: true` adds negative keywords instead.

```bash
curl -X POST "https://zernio.com/api/v1/ads/keywords" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
    "adSetId": "205678901234567",
    "keywords": ["hiking bottle", { "text": "bpa free bottle", "matchType": "phrase" }]
  }'
```

## Change or archive a keyword

`PATCH /v1/ads/keywords/{keywordId}` takes `status` (`active` or `paused`) and `cpcBid`, the keyword's own bid in the profile's currency. A negative keyword takes `status` only.

```bash
curl -X PATCH "https://zernio.com/api/v1/ads/keywords/66f2b3c4d5e6f7a8b9c0d1f0" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "cpcBid": 0.9 }'
```

`DELETE /v1/ads/keywords/{keywordId}` archives the keyword. Archiving is Amazon's delete: the keyword stays in reports and can never be enabled again.

## Campaign negative keywords

Sponsored Products campaigns also take negative keywords at the campaign level. Read them with `GET /v1/ads/campaigns/{campaignId}/negative-keywords`, and replace the list with `PUT` on the same path: Zernio creates the missing ones and archives the rest.

## How it behaves

- Keywords sync at most every six hours per profile, so one made in the Amazon Ads console can take that long to appear.
- `metrics` is a trailing 30-day window in the profile's currency, from Amazon's keyword report.
- A negative keyword sent without `matchType` is `exact`. Negatives match `exact` or `phrase` only.
- Sponsored Display has no keywords: it targets products, categories and audiences.

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| `422` on `adSetId` | The ad group is Sponsored Display | Add keywords to a Sponsored Products or Sponsored Brands ad group. |
| `422` on `matchType` | `broad` on a negative keyword | Send `exact` or `phrase`. |
| `422` on `cpcBid` | A bid on a negative keyword | Send `status` only. |
| `422` on `status` | Pausing a Sponsored Brands negative keyword | Archive it with `DELETE` instead. |
| `422` on campaign negative keywords | A Sponsored Brands or Sponsored Display campaign | Use ad group negatives on Sponsored Brands. |
| `404` | The keyword or ad group is not a Zernio id | Use the `id` from `GET /v1/ads/keywords` or `GET /v1/ads/tree`. |

## Related

- [List ad keywords](/ad-campaigns/list-ad-keywords)
- [Targeting](/platforms/amazon-ads/targeting): product, category and audience targets.
- [Analytics](/platforms/amazon-ads/analytics): keyword-level spend and sales.