getRelatedCategoryItems
Note: All calls in the Merchandising API have been deprecated as of July 29, 2024, and will be decommissioned on January 6, 2025.
Retrieves recommended items from categories related to a specified category or item. If categoryId is specified, then items are returned from categories related to the given category. If itemId is specified, then items are returned from categories related to the given item's category. In either case, the response contains items from the three best matching categories. The selection of items is evenly distributed between the best matching categories. The recommended items are sorted by end time, with items ending soonest first.
The request must contain either categoryId or ItemId. If both itemId and categoryId are specified, categoryId takes precedence.
Note: In some cases, the item recommendations returned by getRelatedCategoryItems are not closely related to the item specified in the request. Refer to the getRelatedCategoryItems does not return related items thread in the eBay Shopping and Merchandising API Production System Announcements board for more information, including an ETA for when this problem will be resolved.
Output Samples Change History |
Input
See also Samples.
The box below lists all fields that could be included in the call request. To learn more about an individual field or its type, click its name in the box (or scroll down to find it in the table below the box).
<?xml version="1.0" encoding="utf-8"?> <getRelatedCategoryItemsRequest xmlns="http://www.ebay.com/marketplace/services"> <!-- Call-specific Input Fields --> <categoryId> string </categoryId> <itemId> string </itemId> <!-- Standard Input Fields --> <affiliate> Affiliate <customId> string </customId> <networkId> string </networkId> <trackingId> string </trackingId> </affiliate> <maxResults> int </maxResults> </getRelatedCategoryItemsRequest>
Argument | Type | Occurrence | Meaning |
---|
Call-specific Input Fields [Jump to standard fields] |
categoryId | string | Conditional |
Specifies the category used to determine related categories from which to retrieve item listings. This field takes the same category ID data as used with other eBay APIs. Category IDs are site-specific. If the specified category ID doesn't match an existing category for the site, an invalid-category error message is returned. To determine valid categories, you can use either the Shopping API or the Trading API. In the Shopping API, use the FindItemsAdvanced call with the CategoryHistogram value in the IncludeSelector field to retrieve matching category information. In the Trading API, use calls like GetCategories and GetCategoryFeatures to determine valid values for the site. Max length: 10. See:
|
itemId | string | Conditional |
The ID of an active item listing. Related categories are determined from the primary category in which the item is listed. If both categoryId is also specified, it takes precedence. Max length: 19. |
Standard Input Fields |
affiliate | Affiliate | Optional |
Container for affiliate details. eBay uses the specified affiliate details to build a View Item URL and Product URL string in the response that includes your affiliate tracking information in the correct format. When a user clicks through these URLs to eBay and performs certain tasks, you may get an affiliate commission. See the eBay Partner Network for information about commissions. |
affiliate.customId | string | Optional | Need not be specified. You can define an AffiliateUserID (up to 256 characters) if you want to leverage it to better monitor your marketing efforts. If you are using the eBay Partner Network, and you provide an AffiliateUserID, the tracking URL returned by eBay Partner Network will contain the AffiliateUserID, but it will be referred to as a "customid". |
affiliate.networkId | string | Optional |
Specifies your tracking partner for affiliate commissions. Affiliates earn money from eBay for driving traffic to eBay. Required if you specify a TrackingID. Depending on your tracking partner, specify one of the following values. Not all partners are valid for all sites. For PlaceOffer, only eBay Partner Network and Mediaplex are valid: 2 = Be Free 3 = Affilinet 4 = TradeDoubler 5 = Mediaplex 6 = DoubleClick 7 = Allyes 8 = BJMT 9 = eBay Partner Network For information about commissions, see the eBay Partner Network. |
affiliate.trackingId | string | Optional | The value you specify is obtained from your tracking partner. For eBay Partner Network, the TrackingID is the Campaign ID ("campid") provided by eBay Partner Network. A Campaign ID is a 10-digit, unique number to be used for associating traffic. A Campaign ID is valid across all programs to which you have been accepted. Another example is the Affiliate ID given to you by TradeDoubler. |
maxResults | int | Optional |
Specifies the maximum number of entries to return in a single call. If the number of entries that can be returned is less than the value you specify, the lower number is returned. Values less than 1 or greater than 50 (or 20 in the case of getTopSellingProducts) will be ignored. Min: 1. Max: 50. Default: 20. |
Input Samples Change History |
Output
See also Samples.
The box below lists all fields that might be returned in the response. To learn more about an individual field or its type, click its name in the box (or scroll down to find it in the table below the box).
<?xml version="1.0" encoding="utf-8"?> <getRelatedCategoryItemsResponse xmlns="http://www.ebay.com/marketplace/services"> <!-- Call-specific Output Fields --> <itemRecommendations> ItemRecommendations <item> Item <bidCount> int </bidCount> <buyItNowPrice currencyId="string"> Amount (double) </buyItNowPrice> <country> string </country> <currentPrice currencyId="string"> Amount (double) </currentPrice> <globalId> string </globalId> <imageURL> anyURI </imageURL> <itemId> string </itemId> <originalPrice currencyId="string"> Amount (double) </originalPrice> <primaryCategoryId> string </primaryCategoryId> <primaryCategoryName> string </primaryCategoryName> <shippingCost currencyId="string"> Amount (double) </shippingCost> <shippingType> string </shippingType> <subtitle> string </subtitle> <timeLeft> duration </timeLeft> <title> string </title> <viewItemURL> anyURI </viewItemURL> </item> <!-- ... more item nodes allowed here ... --> </itemRecommendations> <!-- Standard Output Fields --> <ack> AckValue </ack> <errorMessage> ErrorMessage <error> ErrorData <category> ErrorCategory </category> <domain> string </domain> <errorId> long </errorId> <exceptionId> token </exceptionId> <message> string </message> <parameter name="string"> ErrorParameter (string) </parameter> <!-- ... more parameter values allowed here ... --> <severity> ErrorSeverity </severity> <subdomain> string </subdomain> </error> <!-- ... more error nodes allowed here ... --> </errorMessage> <timestamp> dateTime </timestamp> <version> string </version> </getRelatedCategoryItemsResponse>
Return Value | Type | Occurrence | Meaning |
---|
Call-specific Output Fields [Jump to standard fields] |
itemRecommendations | ItemRecommendations | Always | A list of items matching the given criteria. Item sort order is different for each call. Returned when there are items that match the search criteria. |
itemRecommendations.item | Item | Conditionally,
repeatable: [0..*] |
Contains details for a single recommended item. Returned when there is at least one item that matches the search criteria. |
itemRecommendations.item .bidCount |
int | Conditionally | The number of bids that have been placed on the item. |
itemRecommendations.item .buyItNowPrice |
Amount (double) | Conditionally |
The Buy It Now Price of the item (if any), in the currency of the site on which the item was listed. For Chinese auctions (Quantity=1, competitive bidding online auctions), Buy It Now lets a user purchase the item at a fixed price and end the auction immediately. On most sites, after a Chinese auction has bids, the listing is no longer eligible for Buy It Now. However, calls can still return the Buy It Now Price that the seller set for the listing. Use the item.bidCount field to determine whether an auction with Buy It Now has bids or not. Some eBay sites also support Buy It Now for Dutch auctions (multi- quantity, competitive bidding), where you can buy multiple items from the same listing at a fixed price, instead of bidding. On some sites, the Buy It Now option remains available for Dutch auctions even after there are bids. For fixed-price (FixedPriceItem) and Store Inventory listings (StoresFixedPrice), see currentPrice instead. Only returned if an item was listed with Buy It Now. |
itemRecommendations.item .buyItNowPrice [ attribute currencyId ] |
string | Always |
The Buy It Now Price of the item (if any), in the currency of the site on which the item was listed. For Chinese auctions (Quantity=1, competitive bidding online auctions), Buy It Now lets a user purchase the item at a fixed price and end the auction immediately. On most sites, after a Chinese auction has bids, the listing is no longer eligible for Buy It Now. However, calls can still return the Buy It Now Price that the seller set for the listing. Use the item.bidCount field to determine whether an auction with Buy It Now has bids or not. Some eBay sites also support Buy It Now for Dutch auctions (multi- quantity, competitive bidding), where you can buy multiple items from the same listing at a fixed price, instead of bidding. On some sites, the Buy It Now option remains available for Dutch auctions even after there are bids. For fixed-price (FixedPriceItem) and Store Inventory listings (StoresFixedPrice), see currentPrice instead. Only returned if an item was listed with Buy It Now. |
itemRecommendations.item .country |
string | Conditionally | Two-letter ISO 3166 country code to indicate the country where the item is located. For English names that correspond to each code (e.g., KY="Cayman Islands"), see the ISO site. |
itemRecommendations.item .currentPrice |
Amount (double) | Conditionally | For competitive-bidding listings (Chinese and Dutch auctions), current minimum asking price (start price) or the current highest bid for the item if bids have been placed. Shows minimum bid if no bids have been placed on the item. For Basic Fixed-Price, Store Inventory, or Ad type listings, this returns the original price specified when the item was listed/re-listed or the revised price if the item was revised. |
itemRecommendations.item .currentPrice [ attribute currencyId ] |
string | Always | For competitive-bidding listings (Chinese and Dutch auctions), current minimum asking price (start price) or the current highest bid for the item if bids have been placed. Shows minimum bid if no bids have been placed on the item. For Basic Fixed-Price, Store Inventory, or Ad type listings, this returns the original price specified when the item was listed/re-listed or the revised price if the item was revised. |
itemRecommendations.item .globalId |
string | Conditionally |
The site upon which the item is listed. Returns a Global ID, which is a unique identifier for combinations of site, language, and territory. For a list of possible enumeration values and how they map to eBay sites, see Global ID Values. |
itemRecommendations.item .imageURL |
anyURI | Conditionally | URL for a picture used as the Gallery thumbnail, if any. The image uses one of the following graphics formats: JPEG, BMP, TIF, or GIF. Only returned if the seller chose to show a gallery image. |
itemRecommendations.item .itemId |
string | Always |
The ID that uniquely identifies the item listing. The ID is generated by eBay after an item is listed. You cannot choose or revise this value. Max length: 19. |
itemRecommendations.item .originalPrice |
Amount (double) | Conditionally | Original price of an item whose price a seller has reduced with the Promotional Price Display feature. Only returned if the price has been revised. |
itemRecommendations.item .originalPrice [ attribute currencyId ] |
string | Always | Original price of an item whose price a seller has reduced with the Promotional Price Display feature. Only returned if the price has been revised. |
itemRecommendations.item .primaryCategoryId |
string | Conditionally |
Numeric ID of the first (or only) category in which the item is listed. (Listings can appear in more than one category.) Note: Currently, the Merchandising API calls do not return a listing's secondary category, if any. Max length: 10. |
itemRecommendations.item .primaryCategoryName |
string | Conditionally |
Display name of the first (or only) category in which the item is listed. This is a fully qualified category breadcrumb (e.g., Computers & Networking:Laptops, Notebooks). Max length: 30. |
itemRecommendations.item .shippingCost |
Amount (double) | Conditionally | The shipping cost associated with the first shipping service. Only returned when shipping type is flat. |
itemRecommendations.item .shippingCost [ attribute currencyId ] |
string | Always | The shipping cost associated with the first shipping service. Only returned when shipping type is flat. |
itemRecommendations.item .shippingType |
string | Conditionally |
The shipping cost model offered by the seller.
|
itemRecommendations.item .subtitle |
string | Conditionally |
Subtitle of the item. Only returned if the seller included a subtitle for the listing. Note: Due to an eBay platform change in January 2015, this field is no longer supported for the getSimilarItems and getMostWatchedItems calls. It is returned in the response but will always be blank. Max length: 55. |
itemRecommendations.item .timeLeft |
duration | Conditionally | Time left before the item listing ends. The duration is represented in the ISO 8601 duration format (PnDTnHnMnS). For ended listings, the time left is P0DT0H0M0S (zero days, zero hours, zero minutes, and zero seconds). |
itemRecommendations.item.title | string | Always |
Name of the item as it appears in the listing or search results. Max length: 55. |
itemRecommendations.item .viewItemURL |
anyURI | Always | The URL of the web page where a user can view the listing. On the US site, this is called the "View Item" page. If you enabled affiliate tracking in the call, viewItemURL contains a string that includes affiliate tracking information (see the eBay Partner Network). |
Standard Output Fields |
ack | AckValue | Always |
Indicates whether there are any errors or warnings associated with the processing of the request.
Applicable values: Code so that your app gracefully handles any future changes to this list. |
errorMessage | ErrorMessage | Conditionally | Information for an error or warning that occurred when eBay processed the request. Not returned when responseStatus is Success. See Errors by Number for a list of errors and warnings that can be returned by Merchandising API calls. |
errorMessage.error | ErrorData | Conditionally,
repeatable: [0..*] |
Details about a single error. |
errorMessage.error.category | ErrorCategory | Conditionally |
There are three categories of errors: request errors, application errors, and system errors.
Applicable values: Code so that your app gracefully handles any future changes to this list. |
errorMessage.error.domain | string | Conditionally |
Name of the domain upon which the error occurred. Domains include:
|
errorMessage.error.errorId | long | Conditionally | A unique code that identifies the particular error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. |
errorMessage.error.exceptionId | token | Conditionally | Unique identifier for an exception associated with an error. |
errorMessage.error.message | string | Conditionally | A detailed description of the condition that resulted in the error. |
errorMessage.error.parameter | ErrorParameter (string) | Conditionally,
repeatable: [0..*] |
Some warning and error messages return one or more variables that contain contextual information about the error. This is often the field or value that triggered the error. |
errorMessage.error.parameter [ attribute name ] |
string | Conditionally | Some warning and error messages return one or more variables that contain contextual information about the error. This is often the field or value that triggered the error. |
errorMessage.error.severity | ErrorSeverity | Conditionally |
Indicates whether the error caused the request to fail (Error) or not (Warning). If the request fails and the source of the problem is within the application (such as a missing required element), please change the application before you retry the request. If the problem is due to end- user input data, please alert the end-user to the problem and provide the means for them to correct the data. Once the problem in the application or data is resolved, you can attempt to re- send the request to eBay. If the source of the problem is on eBay's side, you can retry the request as-is a reasonable number of times (eBay recommends twice). If the error persists, contact Developer Technical Support. Once the problem has been resolved, the request may be resent in its original form. When a warning occurs, the error is returned in addition to the business data. In this case, you do not need to retry the request (as the original request was successful). However, depending on the cause or nature of the warning, you might need to contact either the end user or eBay to effect a long term solution to the problem to prevent it from reoccurring in the future. Applicable values: Code so that your app gracefully handles any future changes to this list. |
errorMessage.error.subdomain | string | Conditionally |
Name of the subdomain upon which the error occurred. Subdomains include:
|
timestamp | dateTime | Always | This value represents the date and time when eBay processed the request. The time zone of this value is GMT and the format is the ISO 8601 date and time format (YYYY-MM-DDTHH:MM:SS.SSSZ). See the "dateTime" type for information about this time format and converting to and from the GMT time zone. |
version | string | Always | The version of the response payload schema. Indicates the version of the schema that eBay used to process the request. Developer Technical Support may ask you for the version value when you work with them to troubleshoot issues. |
Input Output Change History |
Samples
New to making API calls? Please see Making a Call.
Note: Some item IDs, user IDs, or other data in these samples might no longer be active on eBay. If necessary, you can substitute current eBay data in your requests.
Available samples:
- Basic Call ↓ - Retrieves items from categories related to the category for the specified item.
- Specifying a Category ↓ - Retrieves items from categories related to the specified category.
Retrieves items from categories related to the category for the specified item.
Description
The user b*********r has an item he's interested in and he wants to see some recommended items from related categories.
Input
The category within which the specified itemId is listed is used to determine the related categories.
URL format. See also the non-wrapped version of this URL. For results in a format other than XML,
specify a different value for responseencoding. https://svcs.ebay.com/MerchandisingService?
OPERATION-NAME=getRelatedCategoryItems&
SERVICE-NAME=MerchandisingService&
SERVICE-VERSION=1.1.0&
CONSUMER-ID=YourAppID&
RESPONSE-DATA-FORMAT=XML&
REST-PAYLOAD&
maxResults=3&
itemId=1**********5
Here is the same input in XML format. Note that this does not include standard values.
XML format.
<?xml version="1.0" encoding="UTF-8"?>
<getRelatedCategoryItems xmlns="https://www.ebay.com/marketplace/services">
<maxResults>3</maxResults>
<itemId>1**********5</itemId>
</getRelatedCategoryItems>
Output
The response contains a list of recommended items from which b*********r can choose. The current price and shipping costs are returned for each item, along with basic information about the listing, such as itemId, title, and time left. The viewItemURL links to the View Item page.
XML format.
<?xml version="1.0" encoding="UTF-8"?>
<getRelatedCategoryItemsResponse xmlns="https://www.ebay.com/marketplace/services" xmlns:sct="https://www.ebay.com/soaframework/common/types">
<ack>Success</ack>
<version>1.1.0</version>
<timestamp>2008-08-15T16:09:35.113-07:00</timestamp>
<itemRecommendations>
<item>
<itemId>3********2</itemId>
<title>Lionel 76 Boulevard Lamps Cello Window BOX ONLY</title>
<viewItemURL>
https://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=3193577262&ih=018&category=4
146&_trksid=_trkparms=algo
</viewItemURL>
<globalId>EBAY-US</globalId>
<timeLeft>P14DT17H52M38S</timeLeft>
<primaryCategoryId>220</primaryCategoryId>
<primaryCategoryName>Toys & Hobbies</primaryCategoryName>
<buyItNowPrice currencyId="USD">35.0</buyItNowPrice>
<country>US</country>
<imageURL>https://thumbs.ebaystatic.com/pict/3********2_3.jpg</imageURL>
<shippingCost currencyId="USD">3.55</shippingCost>
<shippingType>Flat</shippingType>
</item>
<item>
<itemId>5********6</itemId>
<title>MTH Premier NYC Reefer Car...From Set</title>
<viewItemURL>
https://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=5928873256&ih=011&category=4
730&_trksid=_trkparms=algo
</viewItemURL>
<globalId>EBAY-US</globalId>
<timeLeft>P22DT23H31M34S</timeLeft>
<primaryCategoryId>220</primaryCategoryId>
<primaryCategoryName>Toys & Hobbies</primaryCategoryName>
<buyItNowPrice currencyId="USD">33.0</buyItNowPrice>
<country>US</country>
<imageURL>https://thumbs.ebaystatic.com/pict/5********6_3.jpg</imageURL>
<shippingType>NotSpecified</shippingType>
</item>
<item>
<itemId>5********4</itemId>
<title>1972-3 LIONEL TRAINS CANADIAN CATALOG MINT NR</title>
<viewItemURL>
https://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=5979899154&ih=010&category=4
147&_trksid=_trkparms=algo
</viewItemURL>
<globalId>EBAY-US</globalId>
<timeLeft>P9DT13H14M39S</timeLeft>
<primaryCategoryId>220</primaryCategoryId>
<primaryCategoryName>Toys & Hobbies</primaryCategoryName>
<buyItNowPrice currencyId="USD">14.95</buyItNowPrice>
<country>US</country>
<imageURL>https://thumbs.ebaystatic.com/pict/5********4_2.jpg</imageURL>
<shippingType>NotSpecified</shippingType>
</item>
</itemRecommendations>
</getRelatedCategoryItemsResponse>
Retrieves items from categories related to the specified category.
Description
The user b*********r is browsing listings within a specific category, and he wants to see some recommended item from related categories.
Input
The related categories are determined from the specified categoryId.
URL format. See also the non-wrapped version of this URL. For results in a format other than XML,
specify a different value for responseencoding. https://svcs.ebay.com/MerchandisingService?
OPERATION-NAME=getRelatedCategoryItems&
SERVICE-NAME=MerchandisingService&
SERVICE-VERSION=1.1.0&
CONSUMER-ID=YourAppID&
RESPONSE-DATA-FORMAT=XML&
REST-PAYLOAD&
maxResults=3&
categoryId=267
Here is the same input in XML format. Note that this does not include standard values.
XML format.
<?xml version="1.0" encoding="UTF-8"?>
<getRelatedCategoryItems xmlns="https://www.ebay.com/marketplace/services">
<maxResults>3</maxResults>
<categoryId>267</categoryId>
</getRelatedCategoryItems>
Output
The response contains a list of recommended items from which b*********r can choose. The current price and shipping costs are returned for each item, along with basic information about the listing, such as itemId, title, and time left. The viewItemURL links to the View Item page.
XML format.
<?xml version="1.0" encoding="UTF-8"?>
<getRelatedCategoryItemsResponse xmlns:sct="https://www.ebay.com/soaframework/common/types" xmlns="https://www.ebay.com/marketplace/services">
<ack>Success</ack>
<version>1.1.0</version>
<timestamp>2008-08-15T15:13:32.994-07:00</timestamp>
<itemRecommendations>
<item>
<itemId>3********2</itemId>
<title>Lionel 76 Boulevard Lamps Cello Window BOX ONLY</title>
<viewItemURL>
https://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=3193577262&ih=018&category=4
146&_trksid=_trkparms=algo
</viewItemURL>
<globalId>EBAY-US</globalId>
<timeLeft>P14DT17H51M39S</timeLeft>
<primaryCategoryId>220</primaryCategoryId>
<primaryCategoryName>Toys & Hobbies</primaryCategoryName>
<buyItNowPrice currencyId="USD">35.0</buyItNowPrice>
<country>US</country>
<imageURL>https://thumbs.ebaystatic.com/pict/3********2_3.jpg</imageURL>
<shippingCost currencyId="USD">3.55</shippingCost>
<shippingType>Flat</shippingType>
</item>
<item>
<itemId>5********6</itemId>
<title>MTH Premier NYC Reefer Car...From Set</title>
<viewItemURL>
https://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=5928873256&ih=011&category=4
730&_trksid=_trkparms=algo
</viewItemURL>
<globalId>EBAY-US</globalId>
<timeLeft>P22DT23H30M35S</timeLeft>
<primaryCategoryId>220</primaryCategoryId>
<primaryCategoryName>Toys & Hobbies</primaryCategoryName>
<buyItNowPrice currencyId="USD">33.0</buyItNowPrice>
<country>US</country>
<imageURL>https://thumbs.ebaystatic.com/pict/5********6_3.jpg</imageURL>
<shippingType>NotSpecified</shippingType>
</item>
<item>
<itemId>5********4</itemId>
<title>1972-3 LIONEL TRAINS CANADIAN CATALOG MINT NR</title>
<viewItemURL>
https://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=5979899154&ih=010&category=4
147&_trksid=_trkparms=algo
</viewItemURL>
<globalId>EBAY-US</globalId>
<timeLeft>P9DT13H13M40S</timeLeft>
<primaryCategoryId>220</primaryCategoryId>
<primaryCategoryName>Toys & Hobbies</primaryCategoryName>
<buyItNowPrice currencyId="USD">14.95</buyItNowPrice>
<country>US</country>
<imageURL>https://thumbs.ebaystatic.com/pict/5********4_2.jpg</imageURL>
<shippingType>NotSpecified</shippingType>
</item>
</itemRecommendations>
</getRelatedCategoryItemsResponse>
Input Output Samples |
Change History
Change Date | Description |
---|---|
1.5.0 2015-01-23 |
|
1.4.0 2010-03-03 |
|
1.1.0 2008-08-12 |
|
1.0.0 2008-06-11 |
|