Ads

Vendor docs

https://advertising.amazon.com/API/docs/en-us/sponsored-brands/3-0/openapi/prod

Specification

https://d3a0d0y2hgofx6.cloudfront.net/openapi/en-us/sponsored-brands/4-0/openapi.json

class ad_api.api.sb.AdsV4(account: str = 'default', marketplace: Marketplaces = Marketplaces.EU, credentials: Dict[str, str] | None = None, proxies: Dict[str, str] | None = None, verify: bool = True, timeout: int | None = None, debug: bool = False, access_token: str | None = None, verify_additional_credentials: bool = True)
list_ads(version: int = 4, **kwargs) → ApiResponse

Lists all Sponsored Brands ads.

Request Body (optional)
campaignIdFilter (dict) : Filter entities by the list of objectIds.
stateFilter (dict) : Filter entities by state.
maxResults (int) : Number of records to include in the paginated response. Defaults to max page size for given API.
nextToken (string) : Token value allowing to navigate to the next response page.
adIdFilter (dict) : Filter entities by the list of objectIds.
adGroupIdFilter (dict) : Filter entities by the list of objectIds.
nameFilter (dict) : Filter entities by name.
Returns

ApiResponse

create_video_ads(version: int = 4, **kwargs) → ApiResponse

Creates Sponsored Brand video ads.

Request Body (required)
ads ([{}]) : name (string) : The name of the ad state (CreateOrUpdateEntityState > String) Entity state for create or update operation. Enum : [ENABLED, PAUSED] adGroupId (string) : The adGroup identifier. creative (dict) : asins ([string]) [optional] videoAssetIds ([string]) [optional]
Returns

ApiResponse

create_product_collection_ads(version: int = 4, **kwargs) → ApiResponse

Creates Sponsored Brands product collection ads.

Request Body (required)
ads ([{}]) : landingPage (dict) : asins [string] [optional] pageType (LadingPageType > String ) : The type of landing page, such as store page, product list (simple landing page), custom url. [optional] url (string) : URL of an existing simple landing page or Store page. [optional] name (string) : The name of the ad state (CreateOrUpdateEntityState > String) Entity state for create or update operation. Enum : [ENABLED, PAUSED] adGroupId (string) : The adGroup identifier. creative (dict) : brandLogoCrop (string) [optional] brandName (string) [optional] customImageAssetId (string) customImageCrop ({int}) [optional] brandLogoAssetID (string) [optional] headline (string) The headline text [optional]
Returns

ApiResponse

create_brand_video_ads(version: int = 4, **kwargs) → ApiResponse

Creates Sponsored Brands brand video ads.

Request Body (required)
ads ([{}]) : landingPage (dict) : asins [string] [optional] pageType (LadingPageType > String ) : The type of landing page, such as store page, product list (simple landing page), custom url. [optional] url (string) : URL of an existing simple landing page or Store page. [optional] name (string) : The name of the ad state (CreateOrUpdateEntityState > String) Entity state for create or update operation. Enum : [ENABLED, PAUSED] adGroupId (string) : The adGroup identifier. creative (dict) : asins ([string]) brandName (string) [optional] brandLogoCrop ({}) [optional] videoAssetIds ([string]) [optional] brandLogoAssetID (string) [optional] headline (string) The headline text [optional]
Returns

ApiResponse

create_store_spotlight_ads(version: int = 4, **kwargs) → ApiResponse

Creates Sponsored Brands store spotlight ads.

Request Body (required)
ads ([{}]) : landingPage (dict) : asins [string] [optional] pageType (LadingPageType > String ) : The type of landing page, such as store page, product list (simple landing page), custom url. [optional] url (string) : URL of an existing simple landing page or Store page. [optional] name (string) : The name of the ad state (CreateOrUpdateEntityState > String) Entity state for create or update operation. Enum : [ENABLED, PAUSED] adGroupId (string) : The adGroup identifier. creative (dict) : brandLogoCrop (string) [optional] brandName (string) [optional] subpages (string) [optional] brandLogoAssetID (string) [optional] headline (string) The headline text [optional]
Returns

ApiResponse

update_ads(version: int = 4, **kwargs) → ApiResponse

Updates the Sponsored Brands ads.

Request Body (required)
ads ([{}]) : adsId (string) [required] : The product ad identifier. name (string) [optional] : The name of the ad state (State>String) [optional] : Entity state for create or update operation. Enum : [ENABLED, PAUSED]
Returns

ApiResponse

create_auto_collection_ads(version: int = 4, **kwargs) → ApiResponse

Creates Sponsored Brands auto collection ads.

Request Body [Required]
ads (array): [required] One entry per ad. | adGroupId (string): [required] Ad group the ad belongs to. | name (string): [required] Ad name. | state (string): [required] ENABLED, PAUSED or ARCHIVED. | creative ({}): [required] | brandName (string): [required] | brandLogoAssetID (string): [optional] | brandLogoCrop ({}): [optional] top, left, width and height. | asinExclusions (array of string): [optional]
Returns:

ApiResponse

Note

An empty body answers 400 INVALID_ARGUMENT with “Ad list cannot be empty.”, and application/json answers 404 Could not find resource, so the versioned media type is what routes the call.

create_manual_collection_ads(version: int = 4, **kwargs) → ApiResponse

Creates Sponsored Brands manual collection ads.

Request Body [Required]
ads (array): [required] One entry per ad, each with adGroupId, name, state and a creative block.
Returns:

ApiResponse

Note

An empty body answers 400 INVALID_ARGUMENT with “Ad list cannot be empty.”

create_product_collection_extended_ads(version: int = 4, **kwargs) → ApiResponse

Creates Sponsored Brands extended product collection ads.

This route is flagged deprecated in the 4.0 contract, together with the creative side of the same name. It still answers on the live service, which is why it stays available, but new integrations should use create_auto_collection_ads or create_manual_collection_ads.

Request Body [Required]
ads (array): [required] One entry per ad.
Returns:

ApiResponse

Note

An empty body answers 400 INVALID_ARGUMENT with “Ad list cannot be empty.”

delete_ads(version: int = 4, **kwargs) → ApiResponse

Deletes Sponsored Brands ads.

Request Body
adIdFilter (dict) : Filter entities by the list of objectIds. include : list of adIds as string