---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/direct/doc/en/keywordbids/setAuto.md
  - https://yandex.com/dev/direct/doc/ru/keywordbids/setAuto.md
  - href: en/keywordbids/setAuto.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/ref-v5/keywordbids/setAuto.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/direct/doc/en/llms.txt

# setAuto

Sets bids for keywords on search depending on the desired traffic volume, or bids in ad networks depending on the desired frequency of impressions (audience share).

Bid calculation formula:

{% list tabs %}

- In search results

  Bid that corresponds to [TargetTrafficVolume](*TargetTrafficVolume) × (1 + [IncreasePercent](*IncreasePercent) / 100),

  but no more than [BidCeiling](*BidCeiling).

  Over time, competitors' activity might drive up the bid for the traffic volume you want until it exceeds your bid. The higher the markup, the higher the traffic volume, but spending also increases.

- In ad networks

  Bid that corresponds to impression freqency [TargetCoverage](*TargetCoverage) × (1 + [IncreasePercent](*IncreasePercent) / 100),

  but no more than [BidCeiling](*BidCeiling).

  Over time, competitors' activity might drive up the bid for the impression frequency you need until it exceeds your bid. The higher the markup, the higher the frequency of impressions, but spending also might increase.

{% endlist %}

The method does not return the assigned bids, but you can get them using the [get](https://yandex.com/dev/direct/doc/en/keywordbids/get.md) method.

The method doesn't reset the [automatic bid](https://yandex.com/support/direct/en/impression-criteria/autotargeting.html#autotargeting__auto-bids) value (`AutotargetingSearchBidIsAuto`).

## Learn more

- [Operations on object arrays](https://yandex.com/dev/direct/doc/best-practice/modify.html)

## Restrictions {#restrictions}

You can specify the bid for search results only if the campaign uses the HIGHEST_POSITION strategy for impressions in search results. Otherwise, an error is returned.

You can specify the bid for ad networks only if the campaign uses the MAXIMUM_COVERAGE or MANUAL_CPM strategy for impressions in ad networks. Otherwise, an error is returned.

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

The method doesn't support setting the bid for autotargeting separately. Changing bids in search for all the keywords in an ad group or campaign may affect the autotargeting bid.

Maximum number of objects per method call:

- Campaigns: A maximum of 10
- Groups: A maximum of 1000
- Keywords: A maximum of 10,000.


## Request {#input}

Request structure in JSON format:

```javascript translate=no
{
  "method": "setAuto",
  "params": { /* params */
    "KeywordBids": [{  /* KeywordBidSetAutoItem */
      "CampaignId": (long),
      "AdGroupId": (long),
      "KeywordId": (long),
      "BiddingRule": { /* BiddingRule */
        "SearchByTrafficVolume": { /* SearchByTrafficVolume */
          "TargetTrafficVolume": (int), /* required */
          "IncreasePercent": (int),
          "BidCeiling": (long)
        },
        "NetworkByCoverage": { /* NetworkByCoverage */
          "TargetCoverage": (int), /* required */
          "IncreasePercent": (int),
          "BidCeiling": (long)
        }
      } /* required */
    }, ... ] /* required */
  }
}
```

#|
||
**Parameter**
|
**Type**
|
**Description**
|
**Required**
||

||
**params structure (for JSON) / SetAutoRequest structure (for SOAP)**
||
||
`KeywordBids`
|
array of KeywordBidSetAutoItem
|
Bid calculation parameters
|
Yes
||

||
**KeywordBidSetAutoItem structure**
||
||
`CampaignID`
|
long
|
The campaign ID. Specified when updating the bid for all the campaign's keywords.
|
Use either `CampaignId` or `AdGroupId` or `KeywordId`
||
||
`AdGroupId`
|
long
|
ID of the ad group. Specified when the bid needs to be updated for all the group's keywords.
||
||
`KeywordId`
|
long
|
The keyword ID. Specified when updating the bid for an individual keyword.


{% note alert %}

The autotargeting ID is not allowed.

{% endnote %}
||
||
`BiddingRule`
|
BiddingRule
|
Parameters for calculating bids.
|
Yes
||

||
**BiddingRule structure**
||
||
`SearchByTrafficVolume`
|
SearchByTrafficVolume
|
Parameters for calculating bids in search results.
|
Use either `SearchByTrafficVolume` or `NetworkByCoverage`
||
||
`NetworkByCoverage`
|
NetworkByCoverage
|
Parameters for calculating bids in ad networks.
||

||
**SearchByTrafficVolume structure**
||
||
`TargetTrafficVolume`
|
int
|
The desired traffic volume in search results. Indicated as a percentage from 5 to 100.

A markup is added to the bid that corresponds to the selected traffic volume (see the `IncreasePercent` parameter).
|
Yes
||
||
`IncreasePercent`
|
int
|
Markup percent from 0 to 1000. If omitted, markup is not calculated.
|
No
||
||
`BidCeiling`
|
long
|
Limit on the bid, multiplied by 1,000,000. Integer.

<!-- source: en/_includes/keywords/add/id-input/bid-limits.md -->
Specified in the user's currency. Restrictions are listed in the currency reference. To get it, use the [Dictionaries](https://yandex.com/dev/direct/doc/en/dictionaries/dictionaries.md).[get](https://yandex.com/dev/direct/doc/en/dictionaries/get.md) method and specify the `Currencies` dictionary name in the request.
<!-- endsource: en/_includes/keywords/add/id-input/bid-limits.md -->
|
No
||

||
**NetworkByCoverage structure**
||
||
`TargetCoverage`
|
int
|
The desired frequency of impressions (the audience coverage) in ad networks. Indicated as a percentage from 0 to 100.

A markup is added to the bid that corresponds to the selected impression frequency (see the `IncreasePercent` parameter).
|
Yes
||
||
`IncreasePercent`
|
int
|
Markup percent from 0 to 1000. If omitted, markup is not calculated.
|
No
||
||
`BidCeiling`
|
long
|
Limit on the bid, multiplied by 1,000,000. Integer.

<!-- source: en/_includes/keywords/add/id-input/bid-limits-network.md -->
Specified in the user's currency. Restrictions are listed in the currency reference. To get it, use the [Dictionaries](https://yandex.com/dev/direct/doc/en/dictionaries/dictionaries).[get](https://yandex.com/dev/direct/doc/en/dictionaries/get) method and specify the `Currencies` dictionary name in the request.
<!-- endsource: en/_includes/keywords/add/id-input/bid-limits-network.md -->
|
No
||
|# 


{% note alert %}

The `CampaignId`, `AdGroupId`, and `KeywordId` parameters are mutually exclusive. A single request may only contain one of these parameters.

{% endnote %}

## Response {#output}

Response structure in JSON format:

```javascript translate=no
{
  "result": { /* result */
    "SetAutoResults": [{  /* 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) / SetAutoResponse structure (for SOAP)**
||
||
`SetAutoResults`
|
array of KeywordBidActionResult
|
The results of the bidding.
||

||
**KeywordBidActionResult structure**
||
||
`CampaignID`
|
long
|
The campaign ID. Returned if there aren't any errors. See the section [Operations on object arrays](https://yandex.com/dev/direct/doc/best-practice/modify.html) (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](https://yandex.com/dev/direct/doc/best-practice/modify.html) (if it was specified in the request).
||
||
`KeywordId`
|
long
|
Keyword ID. Returned if there aren't any errors. See the section [Operations on object arrays](https://yandex.com/dev/direct/doc/best-practice/modify.html) (if it was specified in the request).
||
||
`Warnings`
|
array of [ExceptionNotification](https://yandex.com/dev/direct/doc/best-practice/modify.html)
|
Warnings that occurred during the operation.
||
||
`Errors`
|
array of [ExceptionNotification](https://yandex.com/dev/direct/doc/best-practice/modify.html)
|
Errors that occurred during the operation.
||
|# 


## Examples {#samples}

**Request example**

Sets the bid in search for all keywords in an ad group to get the traffic volume of 75, increased by 10%, but not more than 12.

```javascript translate=no
    {
      "method": "setAuto",
      "params": {
        "KeywordBids": [{
          "AdGroupId": 636056397,
          "BiddingRule": {
            "SearchByTrafficVolume": {
              "TargetTrafficVolume": 75,
              "IncreasePercent": 10,
              "BidCeiling": 12000000,
            }
          }
        }]
      }
    }
```

**Response example**

 
```javascript translate=no
    {
      "result" : {
        "SetAutoResults" : [
          {
            "AdGroupId" : 636056397
          }
        ]
      }
    }
```
