setBids

Sets bids and priorities for audience targets.

You can set a bid or specify priority for a particular audience target, for all audience targets in an ad group, or for all 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.

Alert

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

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

Learn more

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 — maximum of 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 */
  }
}

Parameter

Type

Description

Required

params structure (for JSON) / AddRequest structure (for SOAP)

Bids

array of AudienceTargetSetBidsItem

The audience targets to set the bid or priority for.

Yes

AudienceTargetSetBidsItem structure

Id

long

ID of the audience target. Specified when setting the bid or priority for an individual audience target.

Use either Id or AdGroupId or CampaignId

AdGroupId

long

ID of the ad group. Specified when setting the same bid or priority for all the audience targets in a group.

CampaignId

long

The campaign ID. Specified when setting the same bid or priority for all the audience targets in a campaign.

ContextBid

long

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.

Alert

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

StrategyPriority

PriorityEnum

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

Alert

The Id, AdGroupId, and CampaignId parameters are mutually exclusive. A single request may 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 */
  }
}

Parameter

Type

Description

result structure (for JSON) / SetBidsResponse structure (for SOAP)

SetBidsResults

array of SetBidsActionResult

Results of setting bids and/or priorities.

SetBidsActionResult structure

Id

long

ID of the audience target. Returned if there aren't any errors (if it was specified in the request). See the section Operations on object arrays.

AdGroupId

long

ID of the ad group. Returned if there aren't any errors (if it was specified in the request). See the section Operations on object arrays.

CampaignId

long

The campaign ID. Returned if there aren't any errors (if it was specified in the request). See the section Operations on object arrays.

Warnings

array of ExceptionNotification

Warnings that occurred during the operation.

Errors

array of ExceptionNotification

Errors that occurred during the operation.

Previous