getHistograms
Note: All calls in the Finding API have been deprecated and will be decommissioned on February 5, 2025. An alternative to this API is the Browse API, which also has advanced search capabilities.
This call retrieves category and/or aspect histogram information for the eBay category you specify using the categoryId field.
Usage Details
Histograms are item counts for the associated category or aspect value. Category histograms return histogram information for the specified eBay category, as well as for the immediate children categories of the specified category. Category histograms are returned for non-leaf categories only. Category histograms aren't returned for leaf categories, because they have no children categories.
Aspects are well-known, standardized characteristics of an item. For example, "Screen Size," "Processor Type," and "Processor Speed" could be aspects of Laptop PCs. Aspects can vary for different kinds of items. For example, the aspects of Laptop PCs are different from those of Women's Dresses (aspects for Women's Dresses might include "Sleeve Style," "Dress Length," and "Size"). Aspect histograms are returned for categories.
You can retrieve the eBay category ID numbers from the response of this call and from the eBay web site. You can also obtain a complete list of eBay categories with the Shopping API GetCategoryInfo call.
Related Information
See also the reference documentation for these calls:
- findItemsByCategory - Finds items in a specific category. Results can be filtered and sorted.
- findItemsAdvanced - Finds items by a keyword query and/or category and allows searching within item descriptions.
- findItemsByKeywords - Finds items on eBay based upon a keyword query and returns details for matching items.
Output Detail Controls 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"?> <getHistogramsRequest xmlns="http://www.ebay.com/marketplace/search/v1/services"> <!-- Call-specific Input Fields --> <categoryId> string </categoryId> </getHistogramsRequest>
Argument | Type | Occurrence | Meaning |
---|
categoryId | string | Required |
Specifies the category from which you want to retrieve histogram information. If a specified category ID doesn't match an existing category for the site, eBay returns an invalid-category error message. To determine valid categories, use the Trading API GetCategories call. Retrieving histograms by category is not supported on the eBay Italy site (global ID EBAY-IT) at this time. Max length: 10. See GetCategories in the Trading API for information on retrieving eBay category information. |
Input Detail Controls 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"?> <getHistogramsResponse xmlns="http://www.ebay.com/marketplace/search/v1/services"> <!-- Call-specific Output Fields --> <aspectHistogramContainer> AspectHistogramContainer <aspect name="string"> Aspect <valueHistogram valueName="string"> AspectValueHistogram <count> long </count> </valueHistogram> <!-- ... more valueHistogram nodes allowed here ... --> </aspect> <!-- ... more aspect nodes allowed here ... --> <domainDisplayName> token </domainDisplayName> <domainName> string </domainName> </aspectHistogramContainer> <categoryHistogramContainer> CategoryHistogramContainer <categoryHistogram> CategoryHistogram (Category) <categoryId> string </categoryId> <categoryName> string </categoryName> <childCategoryHistogram> CategoryHistogram (Category) <categoryId> string </categoryId> <categoryName> string </categoryName> <childCategoryHistogram> CategoryHistogram (Category) <categoryId> string </categoryId> <categoryName> string </categoryName> <childCategoryHistogram> CategoryHistogram (Category) </childCategoryHistogram> <!-- >>> childCategoryHistogram can be nested within itself an unlimited number of times >>> --> <!-- ... more childCategoryHistogram values allowed here ... --> <count> long </count> </childCategoryHistogram> <!-- ... more childCategoryHistogram values allowed here ... --> <count> long </count> </childCategoryHistogram> <!-- ... more childCategoryHistogram values allowed here ... --> <count> long </count> </categoryHistogram> <!-- ... more categoryHistogram values allowed here ... --> </categoryHistogramContainer> <conditionHistogramContainer> ConditionHistogramContainer <conditionHistogram> ConditionHistogram <condition> Condition <conditionDisplayName> string </conditionDisplayName> <conditionId> int </conditionId> </condition> <count> int </count> </conditionHistogram> <!-- ... more conditionHistogram nodes allowed here ... --> </conditionHistogramContainer> <!-- 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> </getHistogramsResponse>
Return Value | Type | Occurrence | Meaning |
---|
Call-specific Output Fields [Jump to standard fields] |
aspectHistogramContainer | AspectHistogramContainer | Conditionally | Response container for aspect histograms. Aspect histograms are returned for categories that have been mapped to domains only. In most cases, just leaf categories are mapped to domains, but there are exceptions. |
aspectHistogramContainer .aspect |
Aspect | Conditionally,
repeatable: [1..*] |
A characteristic of an item in a domain. For example, "Optical Zoom", "Brand", and "Megapixels" could be aspects of the Digital Cameras domain. Aspects are well-known, standardized characteristics of a domain, and they vary from domain to domain (the aspects of "Men's Shoes" are different from those of "Digital Cameras"). A search request on the eBay site will often display aspects and their respective aspect values on the left-had side of a query response. Aspects are extracted from item listing properties (such as item titles and subtitles), and represent the characteristics of active items. Values returned in the Aspect container can be used as inputs to the aspectFilter fields in a query to distill the items returned by the query. eBay generates aspects dynamically from the items currently listed; aspects provide a view into what is currently available on eBay. Because of this, aspect values returned one day cannot be guaranteed to be valid the next day. The following graphic shows how eBay might return a set of aspects for the Digital Cameras domain. In this graphic, "Product Type", "Brand", and "Megapixels" are aspects, and "Point & Shoot", "Canon", and "12.0 to 12.9 MP" are aspect values. Histogram values (item counts) are shown for each aspect value. |
aspectHistogramContainer .aspect [ attribute name ] |
string | Conditionally |
A characteristic of an item in a domain. For example, "Optical Zoom", "Brand", and "Megapixels" could be aspects of the Digital Cameras domain. Aspects are well-known, standardized characteristics of a domain, and they vary from domain to domain (the aspects of "Men's Shoes" are different from those of "Digital Cameras"). A search request on the eBay site will often display aspects and their respective aspect values on the left-had side of a query response. Aspects are extracted from item listing properties (such as item titles and subtitles), and represent the characteristics of active items. Values returned in the Aspect container can be used as inputs to the aspectFilter fields in a query to distill the items returned by the query. eBay generates aspects dynamically from the items currently listed; aspects provide a view into what is currently available on eBay. Because of this, aspect values returned one day cannot be guaranteed to be valid the next day. The following graphic shows how eBay might return a set of aspects for the Digital Cameras domain. In this graphic, "Product Type", "Brand", and "Megapixels" are aspects, and "Point & Shoot", "Canon", and "12.0 to 12.9 MP" are aspect values. Histogram values (item counts) are shown for each aspect value. |
aspectHistogramContainer .aspect.valueHistogram |
AspectValueHistogram | Conditionally,
repeatable: [0..*] |
Container that returns the name of the respective aspect value and the histogram (the number of available items) that share that item characteristic. This value is not returned if there are no matching aspects for the associated domain. |
aspectHistogramContainer .aspect.valueHistogram [ attribute valueName ] |
string | Conditionally |
Container that returns the name of the respective aspect value and the histogram (the number of available items) that share that item characteristic. This value is not returned if there are no matching aspects for the associated domain. |
aspectHistogramContainer .aspect.valueHistogram.count |
long | Conditionally | Number of items that share the characteristic the respective aspect value. |
aspectHistogramContainer .domainDisplayName |
token | Conditionally | A buy-side group of items, for example "Shoes." Domains are extracted from item listing properties, such as the title, descriptions, and so on. |
aspectHistogramContainer .domainName |
string | Conditionally |
A buy-side group of items that share aspects, but not necessarily an eBay category. For example "Women's Dresses" or "Digital Cameras" could be domains. You can use a domainName to label a set of aspects that you display. Domains are extracted from item listing properties (such as item titles and subtitles). |
categoryHistogramContainer | CategoryHistogramContainer | Conditionally |
Response container for category histograms. This container is returned only when the specified category has children categories. Note: Category histograms may not be available for some parent categories on the eBay Motors site. |
categoryHistogramContainer .categoryHistogram |
CategoryHistogram (Category) | Conditionally,
repeatable: [0..*] |
Statistical (item count) information on the categories that contain items that match the search criteria or specified category or categories. A category histogram contains information for up to 10 child categories. Search result total entries may not necessarily match the sum of category histogram item counts. For search calls, the item count shows the distribution of matching items across each of the returned categories. A category histogram is not returned if there are no matching items or if the search is restricted to a single leaf category. For getHistograms, the category histogram contains the total item count for the specified category and item counts for the child categories containing the most item listings. A category histogram is not returned if the specified category is a leaf category. For categories associated with specific items, review the individual item containers returned in the search result. |
categoryHistogramContainer .categoryHistogram.categoryId |
string | Conditionally |
The unique ID of a category on the specified eBay site. Max length: 10. |
categoryHistogramContainer .categoryHistogram .categoryName |
string | Conditionally |
Display name of a category as it appears on the eBay Web site. Max length: 30. |
categoryHistogramContainer .categoryHistogram .childCategoryHistogram |
CategoryHistogram (Category) | Conditionally,
repeatable: [0..10] |
Container for histogram information pertaining to a child of the category specified in the request. Histograms return data on up to 10 children. Histograms are only a single level deep. That is, a given category histogram contains only immediate children. |
categoryHistogramContainer .categoryHistogram .childCategoryHistogram .categoryId |
string | Conditionally |
The unique ID of a category on the specified eBay site. Max length: 10. |
categoryHistogramContainer .categoryHistogram .childCategoryHistogram .categoryName |
string | Conditionally |
Display name of a category as it appears on the eBay Web site. Max length: 30. |
categoryHistogramContainer .categoryHistogram .childCategoryHistogram .childCategoryHistogram |
CategoryHistogram (Category) | Conditionally,
repeatable: [0..10] |
Container for histogram information pertaining to a child of the category specified in the request. Histograms return data on up to 10 children. Histograms are only a single level deep. That is, a given category histogram contains only immediate children.
Recursion: Whatever the depth of data returned, the deepest level does not include childCategoryHistogram. |
categoryHistogramContainer .categoryHistogram .childCategoryHistogram.count |
long | Conditionally | The total number of items in the associated category that match the search criteria. |
categoryHistogramContainer .categoryHistogram.count |
long | Conditionally | The total number of items in the associated category that match the search criteria. |
conditionHistogramContainer | ConditionHistogramContainer | Conditionally |
Response container for condition histograms. Returned for leaf and parent categories. Only returned when you search the eBay US site (as of February 2011). International items in US search results are included in the histogram counts. |
conditionHistogramContainer .conditionHistogram |
ConditionHistogram | Conditionally,
repeatable: [0..*] |
Statistical (item count) information on the condition of items that match the search criteria (or specified category). For example, the number of brand new items that match the query. Each conditionHistogram specifies one condition and the number of matching items found. The list of all conditionHistogram containers returned represents the union of all conditions that were found in the item results. For example, if items were found in different categories, and if those categories support different sets of item conditions, then all those conditions are returned in the list, regardless of category. If multiple items use the same condition ID, but some items use different display names for that condition, the histogram shows the site's default display name for that condition. This means that the condition name in a histogram may not always exactly match the condition names on the counted items. |
conditionHistogramContainer .conditionHistogram.condition |
Condition | Conditionally | The name and unique ID of the item condition for which the count is being displayed. |
conditionHistogramContainer .conditionHistogram.condition .conditionDisplayName |
string | Conditionally |
The human-readable label for the item condition. Display names are localized for the site on which they're listed (not necessarily the site on which they're viewed). In item results, this is only returned when the seller specified the item's condition using a structured format eBay recognizes. When conditionId is also present: Most categories use the same display name for the same condition ID. Some categories may override the display name based on buyer expectations for items in the category. For example, condition ID 1000 could be called "New" in one category and "New with tags" in another. If an item is listed in two categories, the primary category controls the display name. Behind the scenes, eBay's search engine uses the ID (not the display name) to determine whether items are new, used, or refurbished. So, if you need to normalize the conditions across categories (such as to group items by condition), it may be easier to use the ID and then show the varying display names for reference. In condition histograms: If you search against a specific category and some items match based on their secondary category, the histogram only shows the display name if the secondary category supports the condition. (Condition IDs and names are dependent on the primary category.) However, the histogram shows the condition ID and item counts. This should only occur in a very small percent of results. As a workaround, you can fill in the missing name based on the "Item Condition IDs and Names" (link below) or based on the condition from an applicable item in the results. For example, suppose a seller lists a concert T-shirt in a clothing category with the condition "New without tags" (1500), and also in a music accessories secondary category (where "New without tags" isn't a recognized condition). If you specify the music accessories category in your request, the condition ID (1500) is shown in the histogram, but not the display name. However, the display name is shown within the items. See Item Condition IDs and Names for a list of display names and the typical meaning of each condition. |
conditionHistogramContainer .conditionHistogram.condition .conditionId |
int | Conditionally |
The numeric ID (e.g., 1000) for the item condition. In item results, this is only returned when the seller listed the item with a condition ID. Some categories don't support or require condition IDs (e.g., most Antiques categories don't). If you Condition as a itemFilter, the response returns items with the correctly matching condition(s), even if conditionId is not returned. See Item Condition IDs and Names for a list of display names and the typical meaning of each condition. |
conditionHistogramContainer .conditionHistogram.count |
int | Conditionally | The number of items found that match the condition. Only counts items where the seller specified the condition by using item.conditionId. |
Standard Output Fields |
ack | AckValue | Always |
Indicates whether or not errors or warnings were generated during the processing of the request.
Applicable values: Code so that your app gracefully handles any future changes to this list. |
errorMessage | ErrorMessage | Conditionally | Description of an error or warning that occurred when eBay processed the request. Not returned if the ack value is Success. |
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 in which the error occurred.
|
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 caused in the error. |
errorMessage.error.parameter | ErrorParameter (string) | Conditionally,
repeatable: [0..*] |
Various 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 | Various 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 reported problem is fatal (an error) or is less- severe (a warning). Review the error message details for information on the cause. If the request fails and the application is the source of the error (for example, a required element is missing), update the application before you retry the request. If the problem is due to incorrect user data, 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, re-send the request to eBay. If the source of the problem is on eBay's side, you can retry the request a reasonable number of times (eBay recommends you try the request twice). If the error persists, contact Developer Technical Support. Once the problem has been resolved, you can resend the request in its original form. If a warning occurs, warning information is returned in addition to the business data. Normally, you do not need to resend the request (as the original request was successful). However, depending on the cause of the warning, you might need to contact the end user, or eBay, to effect a long term solution to the problem. Applicable values: Code so that your app gracefully handles any future changes to this list. |
errorMessage.error.subdomain | string | Conditionally |
Name of the subdomain in which the error occurred.
|
timestamp | dateTime | Always | This value represents the date and time when eBay processed the request. This value is returned in GMT, the ISO 8601 date and time format (YYYY- MM- DDTHH:MM:SS.SSSZ). See the "dateTime" type for information about the time format, and for details on converting to and from the GMT time zone. |
version | string | Always |
The release version that eBay used to process the request. Developer Technical Support may ask you for the version value if you work with them to troubleshoot issues. Note: The version in use is normally the latest release version, as specified in the release notes. Note that eBay releases the API to international sites about a week after the API version is released to the US site. |
Input Output Samples Change History |
Detail Controls
DetailLevel
This call does not support varying Detail Levels. You do not need to pass DetailLevel in the request.
Input Output Detail Controls Change History |
Samples
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.
Retrieves a set of category, aspect, and condition histograms for a specified category.
Description
The user is interested in music and wants to see the distribution of the type of music media and accessories available on eBay.
The response contains histogram information (item counts) for the specified category, Music (category ID 11233), as well as a list of the immediate sub- categories (child categories) with their associated item counts.
The response also contains condition histogram information that can help the user decide whether to search against specific conditions in find calls (by using the Condition itemFilter).You can retrieve the eBay categoryId numbers from the response of this call and from the eBay web site. You can also obtain a complete list of eBay categories with the GetCategoryInfo call in the Shopping API or the GetCategories call in the Trading API.
Input
The categoryId field specifies the category for which the histograms are returned.
Note: URL samples have been wrapped for readability. To run the samples, undo the line wrapping and insert your own SECURITY-APPNAME
.
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/services/search/FindingService/v1?
OPERATION-NAME=getHistograms&
SERVICE-VERSION=1.0.0&
SECURITY-APPNAME=YourAppID&
RESPONSE-DATA-FORMAT=XML&
REST-PAYLOAD&
categoryId=11233
Here is the same input in XML format. Note that this does not include standard values.
XML format. Also available is the JSON equivalent. <?xml version="1.0" encoding="UTF-8"?> <getHistogramsRequest xmlns="http://www.ebay.com/marketplace/search/v1/services"> <categoryId>11233</categoryId> </getHistogramsRequest>
Output
XML format. Also available is the JSON equivalent. <?xml version="1.0" encoding="utf-8"?> <getHistogramsResponse xmlns:ms="https://www.ebay.com/marketplace/services" xmlns="http://www.ebay.com/marketplace/search/v1/services"> <ack>Success</ack> <version>1.12.0</version> <timestamp>2016-07-31T00:33:12.891Z</timestamp> <categoryHistogramContainer> <categoryHistogram> <categoryId>11233</categoryId> <categoryName>Music</categoryName> <count>1807588</count> <childCategoryHistogram> <categoryId>307</categoryId> <categoryName>CDs</categoryName> <count>1448859</count> </childCategoryHistogram> <childCategoryHistogram> <categoryId>306</categoryId> <categoryName>Records</categoryName> <count>261008</count> </childCategoryHistogram> <childCategoryHistogram> <categoryId>31608</categoryId> <categoryName>Wholesale Lots</categoryName> <count>20875</count> </childCategoryHistogram> <childCategoryHistogram> <categoryId>1600</categoryId> <categoryName>Cassettes</categoryName> <count>18448</count> </childCategoryHistogram> <childCategoryHistogram> <categoryId>618</categoryId> <categoryName>Other Formats</categoryName> <count>17942</count> </childCategoryHistogram> <childCategoryHistogram> <categoryId>52473</categoryId> <categoryName>Accessories</categoryName> <count>4878</count> </childCategoryHistogram> <childCategoryHistogram> <categoryId>46353</categoryId> <categoryName>DVD Audio</categoryName> <count>1572</count> </childCategoryHistogram> <childCategoryHistogram> <categoryId>46354</categoryId> <categoryName>Super Audio CDs</categoryName> <count>1205</count> </childCategoryHistogram> </categoryHistogram> </categoryHistogramContainer> <aspectHistogramContainer> <domainName>Music_CDs</domainName> <domainDisplayName>Music CDs</domainDisplayName> <aspect name="Genre"> <valueHistogram valueName="Blues"> <count>30383</count> </valueHistogram> <valueHistogram valueName="Children's"> <count>9782</count> </valueHistogram> <valueHistogram valueName="Christian & Gospel"> <count>33357</count> </valueHistogram> <valueHistogram valueName="Classical"> <count>172756</count> </valueHistogram> <valueHistogram valueName="Comedy"> <count>6206</count> </valueHistogram> <valueHistogram valueName="Country"> <count>62644</count> </valueHistogram> <valueHistogram valueName="Dance, DJ & Electronic"> <count>44756</count> </valueHistogram> <valueHistogram valueName="Easy Listening"> <count>12081</count> </valueHistogram> <valueHistogram valueName="Folk"> <count>17440</count> </valueHistogram> <valueHistogram valueName="Holiday"> <count>8843</count> </valueHistogram> <valueHistogram valueName="Jazz"> <count>115272</count> </valueHistogram> <valueHistogram valueName="Karaoke"> <count>5122</count> </valueHistogram> <valueHistogram valueName="Latin"> <count>43218</count> </valueHistogram> <valueHistogram valueName="Metal"> <count>57697</count> </valueHistogram> <valueHistogram valueName="New Age"> <count>15291</count> </valueHistogram> <valueHistogram valueName="Pop"> <count>66613</count> </valueHistogram> <valueHistogram valueName="R&B & Soul"> <count>81852</count> </valueHistogram> <valueHistogram valueName="Rap & Hip Hop"> <count>22742</count> </valueHistogram> <valueHistogram valueName="Reggae & Ska"> <count>13967</count> </valueHistogram> <valueHistogram valueName="Rock"> <count>370884</count> </valueHistogram> <valueHistogram valueName="Soundtrack & Theater"> <count>41259</count> </valueHistogram> <valueHistogram valueName="Spoken Word & Interviews"> <count>2573</count> </valueHistogram> <valueHistogram valueName="World Music"> <count>61575</count> </valueHistogram> <valueHistogram valueName="Not Specified"> <count>143597</count> </valueHistogram> </aspect> <aspect name="Duration"> <valueHistogram valueName="Album or EP"> <count>910263</count> </valueHistogram> <valueHistogram valueName="Single"> <count>28557</count> </valueHistogram> <valueHistogram valueName="Box Set"> <count>19462</count> </valueHistogram> <valueHistogram valueName="Not Specified"> <count>482163</count> </valueHistogram> </aspect> <aspect name="Condition"> <valueHistogram valueName="Brand New"> <count>1097853</count> </valueHistogram> <valueHistogram valueName="Like New"> <count>169018</count> </valueHistogram> <valueHistogram valueName="Very Good"> <count>106884</count> </valueHistogram> <valueHistogram valueName="Good"> <count>30592</count> </valueHistogram> <valueHistogram valueName="Acceptable"> <count>35559</count> </valueHistogram> <valueHistogram valueName="Not Specified"> <count>28</count> </valueHistogram> </aspect> <aspect name="Special Attributes"> <valueHistogram valueName="Import"> <count>37337</count> </valueHistogram> <valueHistogram valueName="Remastered"> <count>15264</count> </valueHistogram> <valueHistogram valueName="Special Edition"> <count>12506</count> </valueHistogram> <valueHistogram valueName="Promo"> <count>11828</count> </valueHistogram> <valueHistogram valueName="Digipak"> <count>10916</count> </valueHistogram> <valueHistogram valueName="Enhanced CD"> <count>5771</count> </valueHistogram> <valueHistogram valueName="Compilation"> <count>1225</count> </valueHistogram> <valueHistogram valueName="24k Gold Disc"> <count>899</count> </valueHistogram> <valueHistogram valueName="Not Specified"> <count>1351543</count> </valueHistogram> </aspect> </aspectHistogramContainer> </getHistogramsResponse>
Input Output Detail Controls Samples |
Change History
Change Date | Description |
---|---|
1.10.0 02/23/2011 |
|
1.0.0 06/24/2009 |
|