add
Creates ads.
Learn more
Restrictions
To manage product ads, use this URL: https://api.direct.yandex.com/v501/
.
The ad type must match the ad group type. See the table in Ad type.
You can't add ads to an archived campaign.
Maximum of 1000 ads per method call.
To check the limit on the number of ads per group for an advertiser, use the Clients.get or AgencyClients.get method (look for the ADS_TOTAL_PER_ADGROUP element in the Restrictions array).
Request
Request structure in JSON format:
{
"method": "add",
"params": { /* params */
"Ads": [{ /* AdAddItem */
"AdGroupId": (long), /* required */
"TextAd": { /* TextAdAdd */
"Title": (string), /* required */
"Title2": (string),
"Text": (string), /* required */
"Href": (string),
"Mobile": ( "YES" | "NO" ), /* required */
"DisplayUrlPath": (string),
"VCardId": (long),
"AdImageHash": (string),
"SitelinkSetId": (long),
"AdExtensionIds": [(long), ... ],
"VideoExtension": { /* VideoExtensionAddItem */
"CreativeId": (long)
},
"PriceExtension": { /* PriceExtensionAddItem */
"Price": (long), /* required */
"OldPrice": (long),
"PriceQualifier": ( "FROM" | "UP_TO" | "NONE" ), /* required */
"PriceCurrency": ( "RUB" | "BYN" | "CHF" | "EUR" | "KZT" | "TRY" | "UAH" | "USD" | "UZS" ) /* required */
},
"TurboPageId": (long),
"BusinessId": (long),
"PreferVCardOverBusiness": ( "YES" | "NO" ),
"ErirAdDescription" : (string)
},
"DynamicTextAd": { /* DynamicTextAdAdd */
"VCardId": (long),
"AdImageHash": (string),
"SitelinkSetId": (long),
"AdExtensionIds": [(long), ... ],
"Text": (string) /* required */
},
"MobileAppAd": { /* MobileAppAdAdd */
"AdImageHash": (string),
"Text": (string), /* required */
"Title": (string), /* required */
"TrackingUrl": (string),
"Action": ( "DOWNLOAD" | "GET" | "INSTALL" | "MORE" | "OPEN" | "UPDATE" | "PLAY" | "BUY_AUTODETECT" ), /* required */
"Features": [{ /* MobileAppAdFeatureItem */
"Feature": ( "PRICE" | "ICON" | "CUSTOMER_RATING" | "RATINGS" ), /* required */
"Enabled": ( "YES" | "NO" ) /* required */
}, ... ],
"AgeLabel": ( "AGE_0" | ... | "AGE_18" ),
"VideoExtension": { /* VideoExtensionAddItem */
"CreativeId": (long)
},
"ErirAdDescription" : (string)
},
"TextImageAd": { /* TextImageAdAdd */
"AdImageHash": (string), /* required */
"ErirAdDescription" : (string),
"Href": (string),
"TurboPageId": (long)
},
"MobileAppImageAd": { /* MobileAppImageAdAdd */
"AdImageHash": (string), /* required */
"ErirAdDescription" : (string),
"TrackingUrl": (string)
},
"TextAdBuilderAd": { /* TextAdBuilderAdAdd */
"Creative": { /* AdBuilderAdAddItem */
"CreativeId": (long) /* required */
}, /* required */
"ErirAdDescription" : (string),
"Href": (string),
"TurboPageId": (long)
},
"MobileAppAdBuilderAd": { /* MobileAppAdBuilderAdAdd */
"Creative": { /* AdBuilderAdAddItem */
"CreativeId": (long) /* required */
}, /* required */
"ErirAdDescription" : (string),
"TrackingUrl": (string)
},
"MobileAppCpcVideoAdBuilderAd" : { /* MobileAppCpcVideoAdBuilderAdAdd */
"Creative" : { /* AdBuilderAdAddItem */
"CreativeId" : (long) /* required */
},
"ErirAdDescription" : (string),
"TrackingUrl" : (string)
}, /* required */
"CpmBannerAdBuilderAd": { /* CpmBannerAdBuilderAdAdd */
"Creative": { /* AdBuilderAdAddItem */
"CreativeId": (long) /* required */
}, /* required */
"ErirAdDescription" : (string),
"Href": (string),
"TrackingPixels": { /* ArrayOfString */
"Items": [(string), ... ] /* required */
},
"TurboPageId": (long)
},
"CpcVideoAdBuilderAd": { /* CpcVideoAdBuilderAdAdd */
"Creative": { /* AdBuilderAdAddItem */
"CreativeId": (long) /* required */
}, /* required */
"ErirAdDescription" : (string),
"Href": (string),
"TurboPageId": (long)
},
"CpmVideoAdBuilderAd": { /* CpmVideoAdBuilderAdAdd */
"Creative": { /* AdBuilderAdAddItem */
"CreativeId": (long) /* required */
}, /* required */
"ErirAdDescription" : (string),
"Href": (string),
"TrackingPixels": { /* ArrayOfString */
"Items": [(string), ... ] /* required */
},
"TurboPageId": (long)
},
"SmartAdBuilderAd": { /* SmartAdBuilderAdAdd */
"Creative": { /* AdBuilderAdAddItem */
"CreativeId": (long) /* required */
}, /* required */
"ErirAdDescription" : (string)
},
"ShoppingAd" : {
"SitelinkSetId" : (long),
"AdExtensionIds" : [ (long) ],
"BusinessId" : (long),
"FeedId" : (long) /* required */,
"FeedFilterConditions" : [ {
"Operand" : (string) /* required */,
"Operator" : ("CONTAINS_ANY"|"EQUALS_ANY"|"EXISTS"|"GREATER_THAN"|"IN_RANGE"|"LESS_THAN"|"NOT_CONTAINS_ALL") /* required */,
"Arguments" : [ (string) ] /* required */
}, ... ],
"TitleSources" : [ (string) ],
"TextSources" : [ (string) ],
"DefaultTexts" : [ (string) ] /* required */
},
"ListingAd" : {
"SitelinkSetId" : (long),
"AdExtensionIds" : [ (long) ],
"BusinessId" : (long),
"FeedId" : (long) /* required */,
"FeedFilterConditions" : [ {
"Operand" : (string) /* required */,
"Operator" : ("CONTAINS_ANY"|"EQUALS_ANY"|"EXISTS"|"GREATER_THAN"|"IN_RANGE"|"LESS_THAN"|"NOT_CONTAINS_ALL") /* required */,
"Arguments" : [ (string) ] /* required */
}, ... ],
"TitleSources" : [ (string) ],
"TextSources" : [ (string) ],
"DefaultTexts" : [ (string) ] /* required */
}
}, ... ] /* required */
}
}
params structure (for JSON) / AddRequest structure (for SOAP) |
|||
Parameter |
Type |
Description |
Required |
|
array of AdAddItem |
Ads to add. |
Yes |
AdAddItem structure |
|||
|
long |
ID of the group that the ad is being created in. |
Yes |
|
TextAdAdd |
Parameters of a Text & Image ad. See Ad type. |
Use either |
|
DynamicTextAdAdd |
Parameters of a dynamic ad. |
|
|
MobileAppAdAdd |
Parameters of a mobile app ad |
|
|
TextImageAdAdd |
Parameters of an image ad to create from an image (when adding it to a group of Text & Image ads). |
|
|
MobileAppImageAdAdd |
Parameters of an image ad to create from an image (when adding it to a group of mobile app ads). |
|
|
TextAdBuilderAdAdd |
Parameters of an image ad to create from a creative (when adding it to a group of Text & Image ads). |
|
|
MobileAppAdBuilderAdAdd |
Parameters of an image ad to create from a creative (when adding it to a group of mobile app ads). |
|
|
MobileAppCpcVideoAdBuilderAdAdd |
Parameters of a video ad to create from a creative (when adding it to a group of ads for mobile apps). |
|
|
CpmBannerAdBuilderAdAdd |
Display ad parameters. |
|
|
CpcVideoAdBuilderAdAdd |
Video ad parameters in a “Text & Image ads” campaign. |
|
|
CpmVideoAdBuilderAdAdd |
Parameters of a display video ad in a display campaign. |
|
|
SmartAdBuilderAdAdd |
Smart banner parameters. |
|
|
ShoppingAdAdd |
Product ad parameters. |
|
|
ListingAdAdd |
Parameters of ads for catalog pages. |
|
TextAdAdd structure |
|||
|
string |
Title 1. Maximum of 56 characters, counting "narrow" characters. Maximum of 22 characters per word. When using a template, the # character doesn't count towards the length. |
Yes |
|
string |
Title 2. A maximum of 30 characters not counting “narrow” characters, plus up to 15 “narrow” characters. Maximum of 22 characters per word. When using a template, the # character doesn't count towards the length. |
No |
|
string |
Ad text. Maximum of 81 characters not counting "narrow" characters, plus up to 15 "narrow" characters. Maximum of 23 characters per word. When using a template, the # character doesn't count towards the length. |
Yes |
|
YesNoEnum |
Indicates whether this is a mobile ad: YES or NO. See Mobile ads in Yandex Direct Help. |
Yes |
|
string |
Link to the advertiser's website. Maximum of 1024 characters. When using a template, the # character doesn't count towards the length. It must include the protocol and domain name. May contain substitution variables. |
At least one of the parameters |
|
long |
ID of the Turbo page. |
|
|
long |
ID of the vCard. The vCard must belong to the same campaign as the ad. |
|
|
long |
ID of the business profile on Yandex. To get data from business profiles, use the Businesses.get method. A business profile can be linked to an ad only if the YES value is returned for the Note The business profile is available at |
|
|
YesNoEnum |
Indicates which data source takes priority when displaying an ad: YES — vCard, NO — business profile. Alert This parameter is used if the |
No |
|
string |
Ad object description. |
No |
|
string |
Hash of the image. For Text & Image ads, only images of the REGULAR or WIDE type are acceptable. See Type of image. |
No |
|
long |
ID of a set of sitelinks. Allowed only with the |
No |
|
string |
Display link. Allowed only with the It may contain letters, numbers, and the symbols -, №, /, %, #. Spaces, underscores (_), and double characters -- and // are not allowed. See Display link in the Yandex Direct Help. |
No |
|
array of long |
IDs of extensions. Maximum of 50 items in the array. |
No |
|
VideoExtensionAddItem |
Video extension. If this parameter is omitted and the advertiser set ENABLE_VIDEO_EXTENSION_BY_DEFAULT to YES, a video extension is generated automatically. See Video extensions in the Yandex Direct Help. |
No |
|
PriceExtensionAddItem |
Price in the ad. |
No |
VideoExtensionAddItem structure |
|||
|
long |
ID of the creative. |
Yes |
PriceExtensionAddItem structure |
|||
|
long |
The price of a product or service multiplied by 1,000,000. An integer that is a multiple of 10,000 (the price with two digits after the decimal point). Maximum value: 10,000,000,000,000,000. |
Yes |
|
long |
The previous price of a product or service multiplied by 1,000,000. An integer that is a multiple of 10,000. The old price must be higher than the current price. |
No |
|
PriceQualifierEnum |
Text explanation of the price:
|
Yes |
|
PriceCurrencyEnum |
The currency that the price is shown in. |
Yes |
DynamicTextAdAdd structure |
|||
|
long |
ID of the vCard. The vCard must belong to the same campaign as the ad. |
No |
|
string |
Hash of the image. For dynamic ads, only images of the REGULAR or WIDE type are acceptable. See Type of image. |
No |
|
long |
ID of a set of sitelinks. |
No |
|
array of long |
IDs of extensions. Maximum of 50 items in the array. |
No |
|
string |
Ad text. Maximum of 81 characters not counting "narrow" characters, plus up to 15 "narrow" characters. Maximum of 23 characters per word. When using a template, the # character doesn't count towards the length. |
Yes |
MobileAppAdAdd structure |
|||
|
string |
Hash of the image. For mobile app ads, only images of the WIDE type are acceptable. See Type of image. |
No |
|
string |
Ad text. Maximum of 75 characters, counting "narrow" characters. Maximum of 23 characters per word. When using a template, the # character doesn't count towards the length. |
Yes |
|
string |
Title. Maximum of 56 characters, counting "narrow" characters. Maximum of 22 characters per word. When using a template, the # character doesn't count towards the length. |
Yes |
|
string |
Tracking link for tracking app installations. Maximum of 1024 characters. It must include the protocol and domain name. |
No |
|
MobileAppAdActionEnum |
The button label:
|
Yes |
|
array of MobileAppAdFeatureItem |
Add-ons that need to be automatically downloaded from the app store and displayed in the ad. |
No |
|
MobAppAgeLabelEnum |
Age restriction. The default value is AGE_18. |
No |
|
VideoExtensionAddItem |
Video extension. If this parameter is omitted and the advertiser set ENABLE_VIDEO_EXTENSION_BY_DEFAULT to YES, a video extension is generated automatically. See Video extensions in the Yandex Direct Help. |
No |
|
string |
Ad object description. |
No |
MobileAppAdFeatureItem structure |
|||
|
MobileAppFeatureEnum |
Type of extension:
If the add-on type is omitted from the |
Yes |
|
YesNoEnum |
Whether to display an add-on in the ad. Note
|
Yes |
TextImageAdAdd structure |
|||
|
string |
Hash of the image. For image ads, only images of the FIXED_IMAGE type are acceptable. See Type of image. |
Yes |
|
string |
Ad object description. |
No |
|
string |
Link to the advertiser's website. Maximum of 1024 characters. When using a template, the # character doesn't count towards the length. It must include the protocol and domain name. May contain substitution variables. |
One or both of the |
|
long |
ID of the Turbo page. |
|
MobileAppImageAdAdd structure |
|||
|
string |
Hash of the image. For image ads, only images of the FIXED_IMAGE type are acceptable. See Type of image. |
Yes |
|
string |
Ad object description. |
No |
|
string |
Tracking link for tracking app installations. Maximum of 1024 characters. It must include the protocol and domain name. |
No |
TextAdBuilderAdAdd structure |
|||
|
AdBuilderAdAddItem |
A creative that was created in the Ad Builder. See Creative Ad Builder for image ads in the Yandex Direct Help. |
Yes |
|
string |
Ad object description. |
No |
|
string |
Link to the advertiser's website. Maximum of 1024 characters. When using a template, the # character doesn't count towards the length. It must include the protocol and domain name. May contain substitution variables. |
One or both of the |
|
long |
ID of the Turbo page. |
|
MobileAppAdBuilderAdAdd structure |
|||
|
AdBuilderAdAddItem |
A creative that was created in the Ad Builder. See Creative Ad Builder for image ads in the Yandex Direct Help. |
Yes |
|
string |
Ad object description. |
No |
|
string |
Tracking link for tracking app installations. Maximum of 1024 characters. It must include the protocol and domain name. |
No |
MobileAppCpcVideoAdBuilderAdAdd structure |
|||
|
AdBuilderAdAddItem |
A creative that was created in the Ad Builder. See Creative Ad Builder for video extensions in Yandex Direct Help. |
Yes |
|
string |
Ad object description. |
No |
|
string |
Tracking link for tracking app installations. Maximum of 1024 characters. It must include the protocol and domain name. |
No |
CpmBannerAdBuilderAdAdd structure |
|||
|
AdBuilderAdAddItem |
A creative that was uploaded in the web interface or created in the Ad Builder. See Creating a display campaign in the Yandex Direct Help. |
Yes |
|
string |
Ad object description. |
No |
|
string |
Link to the advertiser's website. Maximum of 1024 characters. When using a template, the # character doesn't count towards the length. It must include the protocol and domain name. May contain substitution variables. |
One or both of the |
|
long |
ID of the Turbo page. |
|
|
ArrayOfString |
Can contain a maximum of two strings:
The maximum length of each string is 1024 characters. |
No |
CpcVideoAdBuilderAdAdd structure |
|||
|
AdBuilderAdAddItem |
A creative that was created in the Ad Builder. See the section Video ads / Creative Ad Builder in the Help for Yandex Direct. |
Yes |
|
string |
Ad object description. |
No |
|
string |
Link to the advertiser's website. Maximum of 1024 characters. When using a template, the # character doesn't count towards the length. It must include the protocol and domain name. May contain substitution variables. |
One or both of the |
|
long |
ID of the Turbo page. |
|
CpmVideoAdBuilderAdAdd structure |
|||
|
AdBuilderAdAddItem |
A creative that was created in the Ad Builder. See Video advertising / How to launch in Yandex Direct Help. |
Yes |
|
string |
Ad object description. |
No |
|
string |
Link to the advertiser's website. Maximum of 1024 characters. When using a template, the # character doesn't count towards the length. It must include the protocol and domain name. May contain substitution variables. |
One or both of the |
|
long |
ID of the Turbo page. |
|
|
ArrayOfString |
An ADFOX tracking tag. The tag must have the |
No |
SmartAdBuilderAdAdd structure |
|||
|
AdBuilderAdAddItem |
A creative that was created in the Ad Builder. See Creative Ad Builder for smart banners in the Help for Yandex Direct. |
Yes |
|
string |
Ad object description. |
No |
AdBuilderAdAddItem structure |
|||
|
long |
ID of the creative. |
Yes |
ShoppingAdAdd structure |
|||
|
long |
ID of a set of sitelinks. |
No |
|
array of long |
IDs of extensions. Maximum of 50 items in the array. |
No |
|
long |
ID of the business profile on Yandex. To get data from business profiles, use the Businesses.get method. A business profile can be linked to an ad only if the YES value is returned for the Note The business profile is available at |
No |
|
long |
ID of the feed to generate ads from. |
Yes |
|
FeedFilterConditionsItem |
Rules for selecting product offers. No more than 30 filters in the array. The total length of the selection rules is a maximum of 65 KB (in JSON). A product offer is selected for ad generation if it meets all the selection rules at the same time. If this parameter is omitted, all product offers from the feed are used for ad generation. |
No |
|
array of string |
Names of feed fields used to generate ad titles. You can retrieve the acceptable field names through the |
No |
|
array of string |
Names of feed fields used to generate ad texts. You can retrieve the acceptable field names through the |
No |
|
array of string |
Default texts. You can specify only one value. |
Yes |
ListingAdAdd structure |
|||
|
long |
ID of a set of sitelinks. |
No |
|
array of long |
IDs of extensions. Maximum of 50 items in the array. |
No |
|
long |
ID of the business profile on Yandex. To get data from business profiles, use the Businesses.get method. A business profile can be linked to an ad only if the YES value is returned for the Note The business profile is available at |
No |
|
long |
ID of the feed to generate ads from. |
Yes |
|
FeedFilterConditionsItem |
Rules for selecting product offers. No more than 30 filters in the array. The total length of the selection rules is a maximum of 65 KB (in JSON). A product offer is selected for ad generation if it meets all the selection rules at the same time. If this parameter is omitted, all product offers from the feed are used for ad generation. |
No |
|
array of string |
Names of feed fields used to generate ad titles. You can retrieve the acceptable field names through the |
No |
|
array of string |
Names of feed fields used to generate ad texts. You can retrieve the acceptable field names through the |
No |
|
array of string |
Default texts. You can specify only one value. |
Yes |
FeedFilterConditionsItem structure |
|||
|
string |
Feed parameter. For a description of the fields for each feed type, see Configuring filters in the Yandex Direct Help. |
Yes |
|
StringConditionOperatorEnum |
Comparison operator. For information on the compatibility of feed fields and operators, as well as restrictions on values, see Rules for selecting product ads. |
Yes |
|
array of string |
An array of strings to compare the operand to. |
Yes |
Note
"Narrow" characters are: !,.;:"
Response
Response structure in JSON format:
{
"result": { /* result */
"AddResults": [{ /* ActionResult */
"Id": (long),
"Warnings": [{ /* ExceptionNotification */
"Code": (int), /* required */
"Message": (string), /* required */
"Details": (string)
}, ... ],
"Errors": [{ /* ExceptionNotification */
"Code": (int), /* required */
"Message": (string), /* required */
"Details": (string)
}, ... ]
}, ... ]
}
}
Parameter |
Type |
Description |
result structure (for JSON) / AddResponse structure (for SOAP) |
||
|
array of ActionResult |
Results of adding ads. |
ActionResult structure |
||
|
long |
ID of the ad that was created. Returned if there aren't any errors. See the section Operations on object arrays. |
|
array of ExceptionNotification |
Warnings that occurred during the operation. |
|
array of ExceptionNotification |
Errors that occurred during the operation. |