setBids

Sets bids and priorities for audience targets.

  1. Restrictions
  2. Request
  3. Response

You can set a bid or priority for an individual audience target, for all the audience targets in an ad group, or for all the audience targets in a campaign.

The bid or priority is used depending on which display strategy is selected in the campaign:
  • If a manual strategy is set up in the campaign, the ContextBid parameter is used.

  • If the campaign has an automatic strategy set up, the StrategyPriority parameter is used: ads for audience targets with higher priority are allocated more traffic when possible, and they are the last ones to be stopped when budget funds are low.

If no parameter appropriate to the strategy is specified, an error is returned.

If both the bid and priority are specified, the values will be saved:

  • If the strategy is manual but the priority is specified, this priority value will be applied later when the strategy is switched to an automatic one.

  • If the strategy is automatic but a bid is specified, this bid value will not be applied: if the strategy switches from automatic to manual, the bid will be set according to an automatic algorithm.

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

In a single request, you can only set bids for a single kind of objects — either only for audience targets, only for ad groups, or only for campaigns.

Maximum number of objects per method call:

  • Audience targets — 10,000.
  • Groups — 1000.
  • Campaigns — 100.

Request

Request structure in JSON format:

{
  "method": "setBids",
  "params": { /* params */
    "Bids": [{  /* AudienceTargetSetBidsItem */
      "Id": (long),
      "AdGroupId": (long),
      "CampaignId": (long),
      "ContextBid": (long),
      "StrategyPriority": ( "LOW" | "NORMAL" | "HIGH" )
    }, ... ] /* required */
  }
}
ParameterTypeDescriptionRequired
Params structure (for JSON) / AddRequest structure (for SOAP)
Bidsarray of AudienceTargetSetBidsItemThe audience targets to set the bid or priority for.Yes
AudienceTargetSetBidsItem structure
IdlongID of the audience target. Specified if setting the bid or priority for an individual audience target.Either Id, or AdGroupId, or CampaignId
AdGroupIdlongID of the ad group. Specified if setting the same bid or priority for all the audience targets in a group.
CampaignIdlongThe campaign ID. Specified if setting the same bid or priority for all the audience targets in a campaign.
ContextBidlong

The bid in ad networks, multiplied by 1,000,000. Integer. Only used for a manual strategy.

Specified in the advertiser's currency. Restrictions are listed in the currency reference. To get it, use the Dictionaries.get method and specify the Currencies dictionary name in the request.

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.
For a manual strategy
StrategyPriorityPriorityEnum

The priority of the audience target: LOW, NORMAL or HIGH. Only used for an automatic strategy.

The default value is NORMAL.

For an automatic strategy
Attention. The CampaignId, AdGroupId and CampaignId parameters are mutually exclusive. A single request can only contain one of these parameters.

Response

Response structure in JSON format:

{
  "result": { /* result */
    "SetBidsResults": [{  /* SetBidsActionResult */
      "Id": (long),
      "AdGroupId": (long),
      "CampaignId": (long),
      "Warnings": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ],
      "Errors": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ]
    }, ... ] /* required */
  }
}
ParameterTypeDescription
result structure (for JSON) / SetBidsResponse structure (for SOAP)
SetBidsResultsarray of SetBidsActionResultResults of setting bids and/or priorities.
SetBidsActionResult structure
IdlongID of the audience target. Returned if there aren't any errors (if it was specified in the request). See the section Operations on objects arrays.
AdGroupIdlongID of the ad group. Returned if there aren't any errors (if it was specified in the request). See the section Operations on objects arrays.
CampaignIdlongThe campaign ID. Returned if there aren't any errors (if it was specified in the request). See the section Operations on objects arrays.
Warningsarray of ExceptionNotification

Warnings that occurred during the operation.

Errorsarray of ExceptionNotification

Errors that occurred during the operation.