Discard
GuidesAPI ReferenceChangelogDiscussions
GuidesAPI ReferenceChangelogDiscussionsLog In

Negative keywords

  • This endpoint and its underlying capabilities apply ONLY to Open Auction Campaigns & Line items.
    • The negative keyword capability will allow you to declare keywords on which you DO NOT want your ads to run (applies to Search inventory)

Endpoints

  • GET /auction-line-items/{line-item-id}/targeting/keywords Get All Negated Keywords on a specific Line Item
  • POST /auction-line-items/{line-item-id}/targeting/keywords/append Add Negated Keywords to a Specific Line Item
  • POST /auction-line-items/{line-item-id}/targeting/keywords/delete Remove Negated Keywords from a Specific Line Item

Negative Keywords may be entered as either Broad Match or Exact Match. To learn more, please refer to our Support Center article available here.

Negated Keyword Attributes

Attribute

Description

Values

Required

keywords string

Keyword and match-type

Dictionary of keyword to matchType enum; possible matchType values are negativeExact and negativeBroad

Required

Get all negated Keywords on a Line item

This endpoint list all negated keywords to an Open Auction Line item

https://api.criteo.com/2022-04/retail-media/auction-line-items/{line-item-id}/targeting/keywords

Sample Request

curl -X GET "https://api.criteo.com/2022-04/retail-media/auction-line-items/2465695028166499188/targeting/keywords" \
    -H "Authorization: Bearer myaccesstoken"

Sample Response

{
    "data": {
        "type": "RetailMediaKeywordTarget",
        "id": "2465695028166499188",
        "attributes": {
            "keywords": {
                "chips": "negativeExact",
                "soda": "negativeBroad"
            }
        }
    },
    "errors": [     /* omitted if no errors */
        ...
    ],
    "warnings": [   /* omitted if no warnings */
        ...
    ]
}

Add negated Keywords on a Line item

This endpoint adds negated keywords to an Open Auction Line item

https://api.criteo.com/2022-04/retail-media/auction-line-items/{line-item-id}/targeting/keywords/append

Sample Request

curl -X POST "https://api.criteo.com/2022-04/retail-media/auction-line-items/2465695028166499188/targeting/keywords/append" \
    -H "Authorization: Bearer myaccesstoken" \
    -H "Content-Type: application/json" \
    -d '{
            "data": [
                {
                      "type": "RetailMediaKeywordTarget",
                    "attributes": {
                        "keywords": {
                                    "chips": "negativeExact",
                                    "soda": "negativeBroad"
                    }
                },
                
            ]
        }

Sample Response

{
    ...
    "data": {
        "type": "RetailMediaKeywordTarget",
        "id": "2465695028166499188",
        "attributes": {
            "keywords": {
                "chips": "negativeExact",
                "soda": "negativeBroad"
            }
        }
    },
    "errors": [     /* omitted if no errors */
        ...
    ],
    "warnings": [   /* omitted if no warnings */
        ...
    ]
}

Remove Negated Keywords on a Line Item

This endpoint removes previously negated keywords (as a result, these keywords might be targeted)

https://api.criteo.com/2022-04/retail-media/auction-line-items/{line-item-id}/targeting/keywords/delete

Sample Request

curl -X POST "https://api.criteo.com/2022-04/retail-media/auction-line-items/2465695028166499188/targeting/keywords/delete" \
    -H "Authorization: Bearer myaccesstoken" \
    -H "Content-Type: application/json" \
    -d '{
            "data": [
                {
                    "type": "RetailMediaPromotedProduct",
                    "attributes": {
                        "keywords": {
                                    "chips": "negativeExact"
                    }
                }
                
                }
            ]
        }

Sample Response

{
    "data": [
        {
            "type": "RetailMediaPromotedProduct",
            "attributes": {
            "keywords": {
                "chips": "negativeBroad"
            }
        }
        }
    ],
    "metadata": {
        "totalItemsAcrossAllPages": 4,
        "currentPageSize": 4,
        "currentPageIndex": 0,
        "totalPages": 1,
        "nextPage": null,
        "previousPage": null
    }
}

Did this page help you?