Skip to main content

GET/ad_campaign/{campaign_id}/keyword

Note: This method is only available for select partners who have been approved for the eBay Promoted Listings Advanced (PLA) program. For information about how to request access to this program, refer to Promoted Listings Advanced Access Requests in the Promoted Listings Playbook. To determine if a seller qualifies for PLA, use the getAdvertisingEligibility method in Account API.
This method can be used to retrieve all of the keywords for ad groups in PLA campaigns that use the Cost Per Click (CPC) funding model.

In the request, specify the campaign_id as a path parameter. If one or more ad_group_ids are passed in the request body, the keywords for those ad groups will be returned. If ad_group_ids are not passed in the response body, the call will return all the keywords in the campaign.

Call the getCampaigns method to retrieve a list of current campaign IDs for a seller.

Input

Resource URI (production)

GET https://api.ebay.com/sell/marketing/v1/ad_campaign/{campaign_id}/keyword?

URI parameters

ParameterTypeDescription
campaign_idstringA unique eBay-assigned ID for an ad campaign that is generated when a campaign is created.

Note: You can retrieve the campaign IDs for a specified seller using the getCampaigns method.

Occurrence: Required

ad_group_idsstringA comma-separated list of ad group IDs. This query parameter is used if the seller wants to retrieve keywords from one or more specific ad groups. If this query parameter is not used, all keywords that are part of the CPC campaign are returned.Note:You can call the getAdGroups method to retrieve the ad group IDs for a seller.

Occurrence: Optional

keyword_statusstringA comma-separated list of keyword statuses. The results will be filtered to only include the given statuses of the keyword. If none are provided, all keywords are returned.

Occurrence: Optional

limitstring

Specifies the maximum number of results to return on a page in the paginated response.

Default: 10
Maximum: 500

Occurrence: Optional

offsetstringSpecifies the number of results to skip in the result set before returning the first report in the paginated response.

Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set.

Default: 0

Occurrence: Optional

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

All other standard RESTful request headers are optional. For more information on standard RESTful request headers, see the HTTP request headers- opens rest request components page table.

OAuth scope

This request requires an access token created with the authorization code grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):

https://api.ebay.com/oauth/api_scope/sell.marketing.readonly

https://api.ebay.com/oauth/api_scope/sell.marketing

See OAuth access tokens for more information.

Request payload

This call has no payload.

Request fields

This call has no field definitions.

Output

HTTP response headers

This call has no response headers.

Response payload

Response fields

Output container/fieldTypeDescription
hrefstring

The URI of the current page of results from the result set.

Occurrence: Always

keywordsarray of Keyword

This array contains all of the keywords that match the request criteria. Keywords will be sorted by adGroupId, regardless of whether you searched for keywords across the entire campaign, or if you searched for keywords within one or specific ad groups.

Occurrence: Always

keywords.adGroupIdstring

This field identifies the ad group that the keyword is associated with.

Occurrence: Always

keywords.bidAmount

The bid associated with the keyword. This container will not be returned if the keyword does not have a defined bid value.

Occurrence: Conditional

keywords.bid.currencyCurrencyCodeEnum

The base currency applied to the value field to establish a monetary amount.

The currency is represented as a 3-letter ISO 4217 currency code. For example, the code for the Canadian Dollar is CAD.

Default: The default currency of the eBay marketplace that hosts the listing.

Occurrence: Conditional

keywords.bid.valuestring

The monetary amount in the specified currency.

Required in the amount type.

Occurrence: Conditional

keywords.keywordIdstring

The unique identifier of a keyword.

Occurrence: Always

keywords.keywordStatusKeywordStatusEnum

The status of the keyword.

Valid Values:

  • ACTIVE
  • PAUSED
  • ARCHIVED

Occurrence: Always

keywords.keywordTextstring

The text of the keyword.

Occurrence: Always

keywords.matchTypeMatchTypeEnum

A field that defines the match type for the keyword.

Valid Values:

  • BROAD
  • EXACT
  • PHRASE

Occurrence: Always

limitinteger

The number of keywords returned on a single page from the result set. This value can be set in the request with the limit query parameter.

Occurrence: Always

nextstring

The call URI that can be used to retrieve the next page in the result set. This value is returned only if there is an additional page of results to display from the result set.

Max length: 2048

Occurrence: Conditional

offsetinteger

The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter.

Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0.

Occurrence: Always

prevstring

The call URI that can be used to retrieve the previous page in the result set. Basically, all of the request parameters will remain the same except the offset value, which will be decreased to retrieve the previous page of results.

Max length: 2048

Occurrence: Conditional

totalinteger

The total number of keywords retrieved in the result set.

If no keywords are found, this field is returned with a value of 0.

Occurrence: Always

HTTP status codes

This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.

StatusMeaning
200Success
400Bad Request
404Not Found
409Business error
500Internal Server error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
35001API_MARKETINGAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay Developer Technical Support for assistance.
35002API_MARKETINGAPPLICATIONInternal error. Please wait a few minutes and try the call again.
35029API_MARKETINGREQUESTThe 'limit' has to be greater than zero and less than {maxLimitValue}.
35030API_MARKETINGREQUESTThe 'offset' cannot be less than zero.
35045API_MARKETINGREQUESTNo campaign found for campaign id {campaign_id}.
36314API_MARKETINGREQUESTAd Group Ids should be delimited by {adGroupIdsDelimiter}

Warnings

This call has no warnings.

Samples

New to making API calls? Please see Making a Call.

Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.

Sample 1: Retrieve Details for Multiple Keywords

This example retrieves the details for all keywords associated with the specified Promoted Listings Advanced (PLA) campaign.

Input

The input for this sample is the campaign_id of the PLA ad campaign with which the keywords are associated.

GEThttps://api.ebay.com/sell/marketing/v1/ad_campaign/1********4/keyword

Output

If the call is successful, details for the keywords associated with the specified PLA ad campaign are returned.