set

Sets fixed bids and priorities for keywords and autotargetings.

  1. Restrictions
  2. Request
  3. Response
  4. Example

You can set the bid or priority for:

  • A separate keyword or autotargeting.

  • All keywords and autotargetings in an ad group.

  • All keywords and autotargetings in a campaign.

The bid or priority can be assigned according to which display strategy is selected in the campaign:

  • If the HIGHEST_POSITION display strategy is chosen for search, the SearchBid parameter can be specified.
  • If the MAXIMUM_COVERAGE display strategy is chosen for ad networks, the NetworkBid parameter can be specified.
  • If an automatic strategy is selected, you can use the StrategyPriority parameter: keywords with higher priority are allocated more traffic when possible, and they are the last ones to be stopped when budget funds are low.

If an item in the input array contains parameters that are not appropriate for the strategy, the values of these parameters are not changed.

  • If an item in the input array simultaneously contains both appropriate and inappropriate parameters for the strategy (for example, both a bid and a priority), the operation only changes the values of the parameters that correspond to the strategy, and a warning is returned.

  • If an item in the input array contains only parameters that are not appropriate for the strategy (for example, it contains only priority for a manual strategy), the operation is not executed, and an error is returned.

Attention.
  • Bids and prices are passed via the Yandex.Direct API as integer numbers. The value that is passed represents the bid or price multiplied by 1,000,000.

  • All bids and prices are shown in the advertiser's currency.

Restrictions

A single request can only set bids for the same type of objects — either for campaigns only, or for groups only, or for keywords and autotargetings only.

Maximum number of objects per method call:
  • campaigns — maximum of 10
  • groups — maximum of 1000
  • keywords and autotargetings — maximum of 10,000

Request

Request structure in JSON format:

{
  "method": "set",
  "params": { /* params */
    "KeywordBids": [{  /* KeywordBidSetItem */
      "CampaignId": (long),
      "AdGroupId": (long),
      "KeywordId": (long),
      "SearchBid": (long),
      "NetworkBid": (long),
      "StrategyPriority": ( "LOW" | "NORMAL" | "HIGH" ) 
    }, ... ] /* required */
  } 
}
Parameter Type Description Required
Params structure (for JSON) / SetRequest structure (for SOAP)
KeywordBids array of KeywordBidSetItem Bids and/or priorities. Yes
KeywordBidSetItem structure
CampaignId long The campaign ID. Specified when setting the same bid or priority for all the keywords and autotargetings in a campaign. Either CampaignId, AdGroupId, or KeywordId
AdGroupId long ID of the ad group. Specified when setting the same bid or priority for all the keywords and autotargetings in a group.
KeywordId long The keyword ID. Specified when setting a bid or priority for an individual keyword or autotargeting.
SearchBid long

The bid for displays in search results, multiplied by 1,000,000. Integer. Only for manual strategies.

Specified in the advertiser's currency. For restrictions, see the page Minimum and maximum CPC.

At least one of the parameters SearchBid, NetworkBid, or StrategyPriority
NetworkBid long

The bid in ad networks, multiplied by 1,000,000. Integer. Only for manual strategies with independent bid management in ad networks.

Specified in the advertiser's currency. For restrictions, see the page Minimum and maximum CPC.

Attention. An image ad can be displayed only if the bid is at least as high as the minimum bid for an ad with an image.
StrategyPriority PriorityEnum Priority of the keyword: LOW, NORMAL or HIGH. Only for automatic strategies.
Attention. The CampaignId, AdGroupId and KeywordId parameters are mutually exclusive. A single request can only contain one of these parameters.

Response

Response structure in JSON format:

{
  "result": {  /* result */
    "SetResults": [{  /* KeywordBidActionResult */
      "Warnings": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ],
      "Errors": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ],        
      "CampaignId": (long),
      "AdGroupId": (long),
      "KeywordId": (long) 
    }, ... ]
  }
}
Parameter Type Description
Result structure (for JSON) / SetResponse structure (for SOAP)
SetResults array of KeywordBidActionResult Results of setting bids and/or priorities.
KeywordBidActionResult structure
CampaignId long The campaign ID. Returned if there aren't any errors. See the section Operations on object arrays (if it was specified in the request).
AdGroupId long ID of the ad group. Returned if there aren't any errors. See the section Operations on object arrays (if it was specified in the request).
KeywordId long ID of the keyword or autotargeting. Returned if there aren't any errors. See the section Operations on object arrays (if it was specified in the request).
Warnings array of ExceptionNotification

Warnings that occurred during the operation.

Errors array of ExceptionNotification

Errors that occurred during the operation.

Example

Request
{
  "method" : "set",
  "params" : {
    "KeywordBids" : [
      {
        "StrategyPriority" : "HIGH",
        "CampaignId" : 4193065
      },
      {
        "SearchBid" : 14000,
        "CampaignId" : 7273721
      }
    ]
  }
}
Response
{
  "result" : {
    "SetResults" : [
      {
        "CampaignId" : 4193065
      },
      {
        "CampaignId" : 7273721
      }
    ]
  }
}