Query Negative Keywords
Query negative keywords using structured filters, sorting, and pagination.
URL
POST https://api.ads.apple.com/v1/negative-keywords/queryHeader Parameters
| Name | Type | Description |
|---|---|---|
X-Ap-Context Required | string |
Response Codes
| Status | Reason | Type | Description |
|---|---|---|---|
| 200 | OK Content-Type: application/json | NegativeKeywordQueryResponse | |
| 400 | Bad Request Content-Type: application/json | ErrorResponse | |
| 401 | Unauthorized Content-Type: application/json | ErrorResponse | |
| 403 | Forbidden Content-Type: application/json | ErrorResponse | |
| 404 | Not Found Content-Type: application/json | ErrorResponse | |
| 429 | Too Many Requests Content-Type: application/json | ErrorResponse | |
| 500 | Internal Server Error Content-Type: application/json | ErrorResponse |
Discussion
This endpoint queries negative keywords using a standard QueryRequest body. The adGroupId field is always required. The API returns an error if it is omitted.
The
adGroupId EQUALSoradGroupId INfilter scopes the query to one or more specific ad groups. ThecampaignIdfield is optional with these operators. TheadGroupId INfilter accepts up to 1000 values.The
adGroupId IS_NULLfilter combined with acampaignId EQUALSfilter returns only campaign-level negatives.The
adGroupId IS_NOT_NULLfilter combined with acampaignId EQUALSfilter returns only ad-group-level negatives across the campaign.The
adGroupId NOT_EQUALSfilter combined with acampaignId EQUALSfilter returns ad-group-level negatives, excluding the specified ad group.The
campaignIdfield only supportsEQUALS.Filtering by
id(EQUALSorIN) is exempt from theadGroupIdrequirement, sinceidalready fully bounds the query.
See QueryFilterOperator for the full set of supported comparison operators.
Filterable Fields
Field | Type | Operators | Sortable | Description |
|---|---|---|---|---|
| integer |
| Yes (default) | The unique identifier for the negative keyword. |
| integer |
| Yes | The ad group this negative keyword belongs to. Null if defined at campaign level. |
| integer |
| Yes | The campaign ID. Negative keywords can be defined at campaign or ad group level. |
| string |
| The original advertiser-given keyword text. | |
| string (enum) |
| Match type for this negative keyword. See Keywordmatchtype. | |
| string (enum) |
| Whether the negative keyword is active or paused. See Negativekeywordstatus. |
The request body is a QueryRequest composed of QueryFilter conditions and QuerySort directives (QuerySortOrder), controlled by QueryPagination.