GetCategories

Returns the latest category hierarchy for the eBay site specified in the CategorySiteID property. By default, this is the site to which you submit the request. You can retrieve all categories on the site, or you can use CategoryParent to retrieve one particular category and its subcategories. The returned category list is contained in the CategoryArray property.

eBay requires sellers to specify a category ID for most new listings and you can only add item listings in leaf categories. The GetCategories call can help you find the leaf categories on any eBay site.

For each category, the call returns the category name, its unique ID (within the site to which you sent the request), and meta-data that helps you determine where the category fits in the hierarchy. The call also identifies a few eBay features that are only supported in some categories. For example, some categories support immediate payment (AutoPay). For information about additional features that vary by category, use GetCategoryFeatures and/or GetCategory2CS.

The API provides other calls that supplement GetCategories. For example, consider using GetSuggestedCategories to help the seller choose a category ID. In certain cases, it may be helpful to use GetCategoryMappings to update locally stored item data (although most applications can use the simpler CategoryMappingAllowed flag in AddItem for this purpose).

See Retrieving the Category Hierarchy for a Site for a detailed description of retrieving the category data for an eBay site.

Working with the Response

GetCategories returns the category data for the specified eBay site into a CategoryArrayType object in the CategoryArray property of the GetCategories response object. Within this array is one CategoryType object for each category retrieved.

  1. Traverse the category array to visit each of the category objects it contains.
  2. Inspect the properties of each CategoryType object to get the values for the category it represents.
  3. Remember that the value of ReservePriceAllowed (specifying whether the site allows listings with reserve prices) can be reversed by the CategoryType.ORPA field for an individual category.
  4. As applicable for the application, store the data (for example, to a table).

Best Practices

The following sections list several hints and suggestions for working with GetCategories.

Data Filters

There is no limit on the number of categories that can be returned using GetCategories. Unless otherwise specified by a filter, all of the categories for a particular site can be returned in one call.

Because category data can be quite voluminous, applications can reduce the volume of data retrieved by using the CategoryParent input property to target the specific categories used by the application. By specifying a category with CategoryParent, a call retrieves a subset of the total category hierarchy. Using this method, you can download the portions of the category hierarchy that you need. While several calls might be needed to gain all the category data required, the individual responses are more targeted.

You can use the LevelLimit property to limit the categories returned to just those up to the specified level in the category hierarchy.

Setting the ViewAllNodes property to false (the default) limits the categories returned; only leaf categories are returned, representing the categories in which you must list an item.

Optimizing Your Calls

Retrieving the full set of eBay categories can be time-consuming and the result sets can be quite large. It can be worthwhile to issue one GetCategories call to retrieve the data for the top-level categories (set LevelLimit to 1), then get the full hierarchy of the branches you are interested by specifying those categories as CategoryParent values in subsequent calls to GetCategories.

Use GetCategories to retrieve the category hierarchy only when necessary and retrieve category data only when a change in the category hierarchy version is indicated for the specified site (see "Checking the Category Hierarchy Version" in Maintaining Category Data for details on category versioning). Although checking the category version does not reduce the number of calls you make to GetCategories, you can optimize your calls by downloading category data only when needed.

Testing GetCategories

Use the following methods to test GetCategories:

Related Information

See Categories.

See also the reference documentation for these calls:



Back to top

GetCategories Input

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).

See also Samples.

See also the Deprecated Objects link above. Fields presented in this color are deprecated, and fields presented in this color are (or soon will be) non-operational.

The XML prototype does not include requester credentials. This is a documentation limitation only (see Standard Requester Credentials for Making Calls).

<?xml version="1.0" encoding="utf-8"?>
<GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <!-- Standard Input Fields -->
  <DetailLevel> DetailLevelCodeType </DetailLevel>
  <!-- ... more DetailLevel nodes here ... -->
  <ErrorLanguage> string </ErrorLanguage>
  <MessageID> string </MessageID>
  <OutputSelector> string </OutputSelector>
  <!-- ... more OutputSelector nodes here ... -->
  <Version> string </Version>
  <WarningLevel> WarningLevelCodeType </WarningLevel>
  <!-- Call-specific Input Fields -->
  <CategoryParent> string </CategoryParent>
  <!-- ... more CategoryParent nodes here ... -->
  <CategorySiteID> string </CategorySiteID>
  <LevelLimit> int </LevelLimit>
  <ViewAllNodes> boolean </ViewAllNodes>
</GetCategoriesRequest>
Argument Type Occurrence Meaning
Standard Input Fields   [Jump to call-specific fields]
DetailLevel DetailLevelCodeType Optional,
repeatable: [0..*]
Detail levels are instructions that define standard subsets of data to return for particular data components (e.g., each Item, Transaction, or User) within the response payload. For example, a particular detail level might cause the response to include buyer-related data in every result (e.g., for every Item), but no seller-related data. Specifying a detail level is like using a predefined attribute list in the SELECT clause of an SQL query. Use the DetailLevel element to specify the required detail level that the client application needs pertaining to the data components that are applicable to the request.

The DetailLevelCodeType defines the global list of available detail levels for all request types. Most request types support certain detail levels or none at all. If you pass a detail level that exists in the schema but that isn't valid for a particular request, eBay ignores it processes the request without it. For each request type, see the detail level tables in the Input/Output Reference to determine which detail levels are applicable and which elements are returned for each applicable detail level. (Some detail level tables are still in the eBay Web Services guide. They will be moved to the Input/Output Reference in a future release.)

Note that DetailLevel is required input for GetMyMessages.

With GetSellerList and other calls that retrieve large data sets, please avoid using ReturnAll when possible. For example, if you use GetSellerList, use a GranularityLevel or use the GetSellerEvents call instead. If you do use ReturnAll with GetSellerList, use a small EntriesPerPage value and a short EndTimeFrom/EndTimeTo range for better performance.

Applicable values:

•   ReturnAll

(in) Returns all available data. With GetSellerList and other calls that retrieve large data sets, please avoid using ReturnAll when possible. For example, if you use GetSellerList, use a GranularityLevel or use the GetSellerEvents call instead. If you use ReturnAll with GetSellerList, use a small EntriesPerPage value and a short EndTimeFrom/EndTimeTo range for better performance.


(Not all values in DetailLevelCodeType apply to this field.)
ErrorLanguage string Optional Use ErrorLanguage to return error strings for the call in a different language from the language commonly associated with the site that the requesting user is registered with. Specify the standard RFC 3066 language identification tag (e.g., en_US).
ID--- country
----- -----
de_AT Austria
de_CH Switzerland
de_DE Germany
en_AU Australia
en_CA Canada
en_GB United Kingdom
en_SG Singapore
en_US United States
es_ES Spain
fr_BE Belgium (French)
fr_CA Canada (French)
fr_FR France
it_IT Italy
nl_BE Belgium (Dutch)
nl_NL Netherlands
zh_CN China
en_IN India
en_IE Ireland
zh_HK Hong Kong

See Tags for the Identification of Languages.

MessageID string Optional In most cases, all calls support a MessageID element in the request and a CorrelationID element in the response. If you pass a message ID in a request, we will return the same value in CorrelationID in the response. You can use this for tracking that a response is returned for every request and to match particular responses to particular requests. If you do not pass MessageID in the request, CorrelationID is not returned.

Note: GetCategories, GetAttributesCS, GetCategory2CS, GetAttributesXSL, GetProductFinder, GetProductFinderXSL, and GetProductSearchPage are designed to retrieve very large sets of metadata that change once a day or less often. To improve performance, these calls return cached responses when you request all available data (with no filters). When this occurs, the MessageID and CorrelationID fields aren't applicable. However, if you specify an input filter to reduce the amount of data returned, the calls retrieve the latest data (not cached). When this occurs, MessageID and CorrelationID are applicable.
OutputSelector string Optional,
repeatable: [0..*]
You can use the OutputSelector field to restrict the data returned by this call. When you make a call such as GetItem that retrieves data from eBay, the OutputSelector field is useful for restricting the data returned. This field makes the call response easier to use, especially when a large payload would be returned. If you use the OutputSelector field, the output data will include only the fields you specified in the request. For example, if you are using GetItem and you want the item data in the response to be restricted to the ViewItemURL (the URL where a user can view the listing) and BuyItNowPrice, then within the GetItem request, specify those output fields. To use this field, see the information at the following link.

See Selecting Fields to Retrieve.

Version string Conditional The version number of the API code that you are programming against (e.g., 549). The version you specify for a call has these basic effects:
- It indicates the version of the code lists and other data that eBay should use to process your request.
- It indicates the schema version you are using.
You need to use a version that is greater than or equal to the lowest supported version.

For the SOAP API: If you are using the SOAP API, this field is required. Specify the version of the WSDL your application is using.

For the XML API: If you are using the XML API, this field has no effect. Instead, specify the version in the X-EBAY-API-COMPATIBILITY-LEVEL HTTP header. (If you specify Version in the body of an XML API request and it is different from the value in the HTTP header, eBay returns an informational warning that the value in the HTTP header was used instead.)

See:
    HTTP Headers (XML API Only)
    eBay Schema Versioning Strategy
    Lowest Supported Version

WarningLevel WarningLevelCodeType Optional Controls whether or not to return warnings when the application passes unrecognized or deprecated elements in a request.

An unrecognized element is one that is not defined in any supported version of the schema. Schema element names are case-sensitive, so using WarningLevel can also help you remove any potential hidden bugs within your application due to incorrect case or spelling in field names before you put your application into the Production environment.

WarningLevel only validates elements; it doesn't validate XML attributes. It also doesn't control warnings related to user-entered strings or numbers, or warnings for logical errors.

We recommend that you only use this during development and debugging. Do not use this in requests in your production code.

Applicable values:

•   High

(in) Return warnings when the application passes unrecognized or deprecated elements in a request.

•   Low

(in) Do not return warnings when the application passes unrecognized or deprecated elements in a request. This is the default value if WarningLevel is not specified.


See Warning Level.

Call-specific Input Fields
CategoryParent string Optional,
repeatable: [0..*]
Specifies the ID of the highest-level category to return, along with its subcategories. If no parent category is specified, all categories are returned for the specified site. (Please do not pass a value of 0; zero (0) is an invalid value for CategoryParent.) To determine available category IDs, call GetCategories with no filters and use a DetailLevel value of ReturnAll. If you specify multiple parent categories, the hierarchy for each one is returned.
CategorySiteID string Optional Specifies the eBay site for which to retrieve the category hierarchy. Use the numeric site code (e.g., 77 for eBay Germany). Only necessary if you want to retrieve category data for a site other than the site to which you are submitting the request.

If you are using the GetCategories call with eBay Motors, this is a required field and must have a value of 100,
Default: The site ID of the request.
LevelLimit int Optional Specifies the maximum depth of the category hierarchy to retrieve, where the top-level categories (meta-categories) are at level 1. Retrieves all category nodes with a category level less than or equal to this value. If not specified, retrieves categories at all applicable levels. As with all calls, the actual data returned will vary depending on how you configure other fields in the request (including DetailLevel).
Default: 0.
ViewAllNodes boolean Optional If false or omitted, retrieves only leaf categories. (You can only list in leaf categories.) If true, retrieves both leaf and internal (non-leaf) categories. As with all calls, the actual data returned will vary depending on how you configure other fields in the request.
Default: false.



Back to top

GetCategories Output

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).

See also Samples.

See also the Deprecated Objects link above. Fields presented in this color are deprecated, and fields presented in this color are not returned (or soon will not be returned) or are not operational (or soon will be non-operational).

The XML prototype does not include requester credentials. This is a documentation limitation only (see Standard Requester Credentials for Making Calls).

<?xml version="1.0" encoding="utf-8"?>
<GetCategoriesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <!-- Standard Output Fields -->
  <Ack> AckCodeType </Ack>
  <Build> string </Build>
  <CorrelationID> string </CorrelationID>
  <Errors> ErrorType 
    <ErrorClassification> ErrorClassificationCodeType </ErrorClassification>
    <ErrorCode> token </ErrorCode>
    <ErrorParameters ParamID="string"> ErrorParameterType 
      <Value> string </Value>
    </ErrorParameters>
    <!-- ... more ErrorParameters nodes here ... -->
    <LongMessage> string </LongMessage>
    <SeverityCode> SeverityCodeType </SeverityCode>
    <ShortMessage> string </ShortMessage>
  </Errors>
  <!-- ... more Errors nodes here ... -->
  <HardExpirationWarning> string </HardExpirationWarning>
  <Timestamp> dateTime </Timestamp>
  <Version> string </Version>
  <!-- Call-specific Output Fields -->
  <CategoryArray> CategoryArrayType 
    <Category> CategoryType 
      <AutoPayEnabled> boolean </AutoPayEnabled>
      <B2BVATEnabled> boolean </B2BVATEnabled>
      <BestOfferEnabled> boolean </BestOfferEnabled>
      <CategoryID> string </CategoryID>
      <CategoryLevel> int </CategoryLevel>
      <CategoryName> string </CategoryName>
      <CategoryParentID> string </CategoryParentID>
      <!-- ... more CategoryParentID nodes here ... -->
      <Expired> boolean </Expired>
      <IntlAutosFixedCat> boolean </IntlAutosFixedCat>
      <LeafCategory> boolean </LeafCategory>
      <LSD> boolean </LSD>
      <ORPA> boolean </ORPA>
      <ORRA> boolean </ORRA>
      <SellerGuaranteeEligible> boolean </SellerGuaranteeEligible>
      <Virtual> boolean </Virtual>
    </Category>
    <!-- ... more Category nodes here ... -->
  </CategoryArray>
  <CategoryCount> int </CategoryCount>
  <CategoryVersion> string </CategoryVersion>
  <MinimumReservePrice> double </MinimumReservePrice>
  <ReduceReserveAllowed> boolean </ReduceReserveAllowed>
  <ReservePriceAllowed> boolean </ReservePriceAllowed>
  <UpdateTime> dateTime </UpdateTime>
</GetCategoriesResponse>
Return Value Type Occurrence Meaning
Standard Output Fields   [Jump to call-specific fields]
Ack AckCodeType Always A token representing the application-level acknowledgement code that indicates the response status (e.g., success). The AckCodeType list specifies the possible values for Ack.

Applicable values:

•   CustomCode

(out) Reserved for internal or future use.

•   Failure

(out) Request processing failed

•   Success

(out) Request processing succeeded

•   Warning

(out) Request processing completed with warning information being included in the response message


(Not all values in AckCodeType apply to this field.)
Build string Always This refers to the specific software build that eBay used when processing the request and generating the response. This includes the version number plus additional information. eBay Developer Support may request the build information when helping you resolve technical issues.
CorrelationID string Conditionally In most cases, all calls support a MessageID element in the request and a CorrelationID element in the response. If you pass a message ID in a request, we will return the same value in CorrelationID in the response. You can use this for tracking that a response is returned for every request and to match particular responses to particular requests. If you do not pass MessageID in the request, CorrelationID is not returned.

Note: GetCategories, GetAttributesCS, GetCategory2CS, GetAttributesXSL, GetProductFinder, GetProductFinderXSL, and GetProductSearchPage are designed to retrieve very large sets of metadata that change once a day or less often. To improve performance, these calls return cached responses when you request all available data (with no filters). When this occurs, the MessageID and CorrelationID fields aren't applicable. However, if you specify an input filter to reduce the amount of data returned, the calls retrieve the latest data (not cached). When this occurs, MessageID and CorrelationID are applicable.
Errors ErrorType Conditionally,
repeatable: [0..*]
A list of application-level errors (if any) that occurred when eBay processed the request.

See Error Handling.

Errors.ErrorClassification ErrorClassificationCodeType Conditionally API errors are divided between two classes: system errors and request errors.

Applicable values:

•   CustomCode

(out) Reserved for internal or future use.

•   RequestError

(out) An error has occurred either as a result of a problem in the sending application or because the application's end-user has attempted to submit invalid data (or missing data). In these cases, do not retry the request. The problem must be corrected before the request can be made again. If the problem is due to something in the application (such as a missing required field), the application must be changed. If the problem is a result of end-user data, the application must alert the end-user to the problem and provide the means for the end-user to correct the data. Once the problem in the application or data is resolved, resend the request to eBay with the corrected data.

•   SystemError

(out) Indicates that an error has occurred on the eBay system side, such as a database or server down. An application 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.


Errors.ErrorCode token 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. See the "Errors by Number" document.
Errors.ErrorParameters ErrorParameterType Conditionally,
repeatable: [0..*]
This optional element carries a list of context-specific error variables that indicate details about the error condition. These are useful when multiple instances of ErrorType are returned.
Errors.ErrorParameters
  [ attribute ParamID ]
string Conditionally The index of the parameter in the list of parameter types returned within the error type.
Errors.ErrorParameters.Value string Conditionally The value of the variable (e.g., the attribute set ID)
Errors.LongMessage string Conditionally A more detailed description of the condition that raised the error.
Errors.SeverityCode SeverityCodeType Conditionally Indicates whether the error is a severe error (causing the request to fail) or an informational error (a warning) that should be communicated to the user.

Applicable values:

•   CustomCode

(out) Reserved for internal or future use

•   Error

(out) Application-level error

•   Warning

(out) Warning or informational error


Errors.ShortMessage string Conditionally A brief description of the condition that raised the error.
HardExpirationWarning string Conditionally Expiration date of the user's authentication token. Only returned within the 7-day period prior to a token's expiration. To ensure that user authentication tokens are secure and to help avoid a user's token being compromised, tokens have a limited life span. A token is only valid for a period of time (set by eBay). After this amount of time has passed, the token expires and must be replaced with a new token.
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 Time Values in the eBay Web Services guide for information about this time format and converting to and from the GMT time zone.

Note: GetCategories, GetAttributesCS, GetCategory2CS, GetAttributesXSL, GetProductFinder, GetProductFinderXSL, and GetProductSearchPage are designed to retrieve very large sets of metadata that change once a day or less often. To improve performance, these calls return cached responses when you request all available data (with no filters). When this occurs, this time value reflects the time the cached response was created. Thus, this value is not necessarily when the request was processed. However, if you specify an input filter to reduce the amount of data returned, the calls retrieve the latest data (not cached). When this occurs, this time value does reflect when the request was processed.
Version string Always The version of the response payload schema. Indicates the version of the schema that eBay used to process the request. See "Standard Data for All Calls" in the eBay Web Services Guide for information on using the response version when troubleshooting "CustomCode" values that appear in the response.
Call-specific Output Fields
CategoryArray CategoryArrayType Always List of the returned categories. The category array contains one CategoryType object for each returned category. Returns empty if no detail level is specified.

DetailLevel: ReturnAll.
CategoryArray.Category CategoryType Always,
repeatable: [1..*]
Contains details about one category. For GetCategories, this node is not returned when no detail level is specified.

DetailLevel: ReturnAll.
CategoryArray.Category
  .AutoPayEnabled
boolean Conditionally If true, indicates that the category supports immediate payment. If not present, the category does not support immediate payment. Will not be returned if false.

DetailLevel: ReturnAll.

See Requiring Immediate Payment.

CategoryArray.Category
  .B2BVATEnabled
boolean Conditionally If true, the category supports business-to-business (B2B) VAT listings. Applicable to the eBay Germany (DE), Austria (AT), and Switzerland CH) sites only. If not present, the category does not support this feature. Will not be returned if false.

DetailLevel: ReturnAll.

See Working with Business Features and VAT.

CategoryArray.Category
  .BestOfferEnabled
boolean Conditionally If true, the category supports best offers. If not present, the category does not support best offers. Will not be returned if false.

DetailLevel: ReturnAll.
CategoryArray.Category
  .CategoryID
string Always Distinct numeric ID for a category on eBay. In GetItem and related calls, see CategoryName for the text name of the category. Use GetCategories to look up the category parent ID.

For GetPopularKeywords, -1 represents the root category.

For GetItem, Half.com items return the Half.com category ID in PrimaryCategory. This ID is not necessarily returned in GetCategories.
Max length: 10.

DetailLevel: ReturnAll.
CategoryArray.Category
  .CategoryLevel
int Always The level where the category fits in the site's category hierarchy. For example, if this field has a value of 2, then the category is two levels below the root category in the site's category hierarchy. For the GetSearchResults response, NumOfItems indicates the total quantity of matching items in a category. Matching categories at the same level (i.e., in sibling categories) are sorted by NumOfItems, descending order.

DetailLevel: ReturnAll.
CategoryArray.Category
  .CategoryName
string Always Display name of the category as it would appear on the eBay Web site. In GetItem, this is a fully qualified category name (e.g., Collectibles:Decorative Collectibles:Hummel, Goebel).

In GetItem, always returned for eBay.com listings. Not returned in PrimaryCategory for Half.com listings.
Max length: 30.

DetailLevel: ReturnAll.
CategoryArray.Category
  .CategoryParentID
string Always,
repeatable: [1..*]
Category ID identifying a category that is an ancestor of the category indicated in CategoryID. For GetCategories, returns the same value as CategoryID if the CategoryLevel is 1. For GetSuggestedCategories, multiple CategoryParentID fields can be returned in sequence, starting with the root category and ending with the category that is the direct parent of the category specified in CategoryID. Use these parent fields and the CategoryID field to build the fully qualified category browse path or "breadcrumbs" (e.g., 58058:3516:3517). For GetPopularKeywords, -1 represents the root category.
Max length: 10.

DetailLevel: ReturnAll.
CategoryArray.Category.Expired boolean Always If true, indicates a category that has expired and to which items may not be listed. Will not be returned if false.

DetailLevel: ReturnAll.
CategoryArray.Category
  .IntlAutosFixedCat
boolean Always If true, indicates that the category is a fixed-fee category. Use this information to identify categories are not eligible for eBay Stores Inventory format listings. You cannot list eBay Store Inventory format listings in fixed-fee categories on international sites. Output only. Will not be returned if false.

DetailLevel: ReturnAll.
CategoryArray.Category
  .LeafCategory
boolean Always If true, indicates that the category indicated in CategoryID is a leaf category, in which items may be listed (if the category is not also expired or virtual). Will not be returned if false.

DetailLevel: ReturnAll.
CategoryArray.Category.LSD boolean Always Item.LotSize is not permitted when you list in this category. If true, indicates that lot sizes are disabled in the specified category. Will not be returned if false.

DetailLevel: ReturnAll.
CategoryArray.Category.ORPA boolean Always Indicates whether the category (and its subcategories) allows or disallows listing with a reserve price, depending on the prevailing site configuration indicated by ReservePriceAllowed. ORPA (override reserve price allowed) indicates when the category is an exception to the site's ReservePriceAllowed policy.

If ORPA is true, the category overrides (toggles or reverses) the site's ReservePriceAllowed setting. In other words:
- If ReservePriceAllowed is true, reserve price is not allowed in this category.
- If ReservePriceAllowed is false, reserve price is allowed in this category.

If ORPA is not present, there is no override. That is, the category's setting is the same as the site's ReservePriceAllowed setting.

This field will not be returned in the response if false. This toggling logic is designed to reduce the size of the GetCategories response by only returning ORPA when the category's policy is different from the site's policy. (If ORPA is true for a category, you can assume its subcategories inherit the same setting unless otherwise specified.)

DetailLevel: ReturnAll.
CategoryArray.Category.ORRA boolean Conditionally Indicates whether the category (and its subcategories) allows or disallows reducing a listing's reserve price, depending on the prevailing site configuration indicated by ReduceReserveAllowed. ORRA (override reduce reserve allowed) indicates when the category is an exception to the site's ReduceReserveAllowed policy.

If ORRA is true, the category overrides (toggles or reverses) the site's ReduceReserveAllowed setting. In other words:
- If ReduceReserveAllowed is true, reserve price reduction is not allowed in this category.
- If ReduceReserveAllowed is false (because it is not present in the response), reserve price reduction is allowed in this category.

If ORRA is not present, there is no override. Will not be returned in the response if false. That is, the category's setting is the same as the site's ReduceReserveAllowed setting.

This toggling logic is designed to reduce the size of the GetCategories response by only returning ORRA when the category's policy is different from the site's policy. (If ORRA is true for a category, you can assume its subcategories inherit the same setting unless otherwise specified.)

DetailLevel: ReturnAll.
CategoryArray.Category
  .SellerGuaranteeEligible
boolean Conditionally Indicates whether this category is eligible for Motors Seller Guarantee program. This tag is emitted for eligible categories only on the eBay Motors site. Will not be returned if false.

DetailLevel: ReturnAll.
CategoryArray.Category.Virtual boolean Always If true, indicates the category indicated in CategoryID is a virtual category, to which items may not be listed. Will not be returned if false.

DetailLevel: ReturnAll.
CategoryCount int Always Indicates the number of categories returned (i.e., the number of CategoryType objects in CategoryArray).

DetailLevel: ReturnAll.
CategoryVersion string Always Indicates the version of the category hierarchy on the specified eBay site.

DetailLevel: ReturnAll. Also returned if DetailLevel is not provided on input.
MinimumReservePrice double Always Indicates the lowest possible reserve price allowed for any item listed in any category on the site. You can use the fields returned by GetCategoryFeatures to determine if a different Minimum Reserve Price is defined for the category you want to use.

DetailLevel: ReturnAll. Also returned if DetailLevel is not provided on input.
ReduceReserveAllowed boolean Always If true, ReduceReserveAllowed indicates that all categories on the site allow the seller to reduce an item's reserve price. If false, this field is not returned in the response and all categories on the site do not normally allow sellers to reduce an item's reserve price. The Category.ORRA (override reduce reserve price) field can override (or toggle) the reserve price reduction setting for a given category. For example, if ReduceReserveAllowed is false and Category.ORRA is true, the category overrides the site setting and supports reducing reserve prices. If ReduceReserveAllowed is true and Category.ORRA is true, the category overrides the site setting and does does not support reducing reserve prices.

DetailLevel: ReturnAll. Also returned if DetailLevel is not provided on input.
ReservePriceAllowed boolean Always If true, ReservePriceAllowed indicates that all categories on the site allow the seller to specify a reserve price for an item. If false, this field is not returned in the response and all categories on the site do not normally allow sellers to specify reserve prices. The Category.ORPA (override reserve price allowed) field can override (or toggle) the reserve price allowed setting for a given category. For example, if ReservePriceAllowed is false and Category.ORPA is true, the category overrides the site setting and supports reserve prices. If ReservePriceAllowed is true and Category.ORPA is true, the category overrides the site setting and does does not support reserve prices.

DetailLevel: ReturnAll. Also returned if DetailLevel is not provided on input.
UpdateTime dateTime Always Indicates the last date and time that eBay modified the category hierarchy for the specified eBay site.

DetailLevel: ReturnAll. Also returned if DetailLevel is not provided on input.



Back to top

GetCategories Detail Controls


Detail Control: DetailLevel

The DetailLevel input field influences which call-specific fields may be returned. (All standard output fields are returned regardless of DetailLevel.)

The none column indicates the fields that are returned when you do not specify a DetailLevel.

YThe field is always returned.
(Y)The field is conditionally returned. See the field description for clarification of conditions.
-The field is not returned.

Output Field none ReturnAll
CategoryArray-Y
CategoryArray.Category-Y
CategoryArray.Category.AutoPayEnabled-(Y)
CategoryArray.Category.B2BVATEnabled-(Y)
CategoryArray.Category.BestOfferEnabled-(Y)
CategoryArray.Category.CategoryID-Y
CategoryArray.Category.CategoryLevel-Y
CategoryArray.Category.CategoryName-Y
CategoryArray.Category.CategoryParentID-Y
CategoryArray.Category.Expired-Y
CategoryArray.Category.IntlAutosFixedCat-Y
CategoryArray.Category.LeafCategory-Y
CategoryArray.Category.LSD-Y
CategoryArray.Category.ORPA-Y
CategoryArray.Category.ORRA-(Y)
CategoryArray.Category.SellerGuaranteeEligible-(Y)
CategoryArray.Category.Virtual-Y
CategoryCount-Y
CategoryVersionYY
MinimumReservePriceYY
ReduceReserveAllowedYY
ReservePriceAllowedYY
UpdateTimeYY



Back to top

GetCategories Samples

New to making API calls? Please see Routing the Request.

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:

Sample: Basic Call

Retrieves the category version.

Description

This basic sample has no input parameters and returns the current version of the category hierarchy in . The XML sample uses the header value to determine the target eBay site (in this case, equals ).

Use this simple call to get the latest version number of the category hierarchy. Compare the version number returned with the version of your stored category data to determine if your stored category data needs updating.

Input

XML format (HTTP POST). Also available is the .txt version of this XML.

<?xml version="1.0" encoding="utf-8"?>
<GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <RequesterCredentials>
    <eBayAuthToken>ABC...123</eBayAuthToken>
  </RequesterCredentials>
</GetCategoriesRequest> 

Output

XML format. Also available is the .txt version of this XML.

<GetCategoriesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <Timestamp>2009-07-15T17:08:04.394Z</Timestamp>
  <Ack>Success</Ack>
  <Version>619</Version>
  <Build>e619__Bundled_9183565_R1</Build>
  <UpdateTime>2009-06-15T14:51:30.000Z</UpdateTime>
  <CategoryVersion>91</CategoryVersion>
  <ReservePriceAllowed>true</ReservePriceAllowed>
  <MinimumReservePrice>0.0</MinimumReservePrice>
</GetCategoriesResponse>

Back to list of samples

Sample: Complete Category Hierarchy

Retrieves a hierarchical list of all categories, with full details, for the specified eBay site.

Description

This sample retrieves all the details for the eBay US site (Site ID 0) category hierarchy. The full output for this call is well over 200,000 lines and it is possible for the call to time out. The sample output shown is an abbreviated version of the full output.

The recommended process for getting comprehensive category information is described in the Knowledge Base article Best practices for GetCategories API call. For more information about retrieving the category hierarchy, see Retrieving the Category Hierarchy for a Site in the Web Services Guide.

Input

The critical input for this sample is with a value of . You can set if you need to override the Site ID set in the XML headers.

XML format (HTTP POST). Also available is the .txt version of this XML.

<?xml version="1.0" encoding="utf-8"?>
<GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <RequesterCredentials>
    <eBayAuthToken>ABC...123</eBayAuthToken>
  </RequesterCredentials>
  <CategorySiteID>0</CategorySiteID>
  <DetailLevel>ReturnAll</DetailLevel>
</GetCategoriesRequest> 

Output

Each Category node in the response contains information needed to build a category tree. The data includes information reflecting the , , , , and status of each category.

XML format. Also available is the .txt version of this XML.

<GetCategoriesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <Timestamp>2009-06-30T19:21:13.942Z</Timestamp>
  <Ack>Success</Ack>
  <Version>619</Version>
  <Build>e619__Bundled_9183565_R1</Build>
  <CategoryArray>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <AutoPayEnabled>true</AutoPayEnabled>
      <CategoryID>20081</CategoryID>
      <CategoryLevel>1</CategoryLevel>
      <CategoryName>Antiques</CategoryName>
      <CategoryParentID>20081</CategoryParentID>
    </Category>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <AutoPayEnabled>true</AutoPayEnabled>
      <CategoryID>37903</CategoryID>
      <CategoryLevel>2</CategoryLevel>
      <CategoryName>Antiquities</CategoryName>
      <CategoryParentID>20081</CategoryParentID>
    </Category>

    ...

    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <CategoryID>10162</CategoryID>
      <CategoryLevel>2</CategoryLevel>
      <CategoryName>ESPN</CategoryName>
      <CategoryParentID>10159</CategoryParentID>
      <LeafCategory>true</LeafCategory>
    </Category>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <CategoryID>140151</CategoryID>
      <CategoryLevel>2</CategoryLevel>
      <CategoryName>SDC</CategoryName>
      <CategoryParentID>10159</CategoryParentID>
      <LeafCategory>true</LeafCategory>
    </Category>
  </CategoryArray>
  <CategoryCount>25805</CategoryCount>
  <UpdateTime>2009-06-15T14:51:30.000Z</UpdateTime>
  <CategoryVersion>91</CategoryVersion>
  <ReservePriceAllowed>true</ReservePriceAllowed>
  <MinimumReservePrice>0.0</MinimumReservePrice>
</GetCategoriesResponse>

Back to list of samples

Sample: First-Level Category Tree

Retrieves a list of the top-level categories for the specified eBay site.

Description

Magic Bookseller wants to sell a copy of "Harry Potter and The Sorcerers Stone" on the US site (SiteID=0) and she wants to find the best category to list the item.

This sample retrieves a complete list of top-level categories. The response contains the category hierarchy version, the number of categories returned, as well as the settings for certain features (for example, and ).

Input

The critical input fields for this sample are (set to ) and (set to ). This specifies that full details should be returned for only the top-level categories.

XML format (HTTP POST). Also available is the .txt version of this XML.

<?xml version="1.0" encoding="utf-8"?>
<GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <RequesterCredentials>
    <eBayAuthToken>ABC...123</eBayAuthToken>
  </RequesterCredentials>
  <CategorySiteID>0</CategorySiteID>
  <DetailLevel>ReturnAll</DetailLevel>
  <LevelLimit>1</LevelLimit>
</GetCategoriesRequest>

Output

In this sample, Magic Bookseller is interested in the category version number, as well as the number of the top-level category (267 for Books) that best fits the item she is selling. Note that the output has been abbreviated.

XML format. Also available is the .txt version of this XML.

<GetCategoriesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <Timestamp>2009-06-30T19:35:43.357Z</Timestamp>
  <Ack>Success</Ack>
  <Version>619</Version>
  <Build>e619__Bundled_9183565_R1</Build>
  <CategoryArray>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <AutoPayEnabled>true</AutoPayEnabled>
      <CategoryID>20081</CategoryID>
      <CategoryLevel>1</CategoryLevel>
      <CategoryName>Antiques</CategoryName>
      <CategoryParentID>20081</CategoryParentID>
    </Category>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <AutoPayEnabled>true</AutoPayEnabled>
      <CategoryID>550</CategoryID>
      <CategoryLevel>1</CategoryLevel>
      <CategoryName>Art</CategoryName>
      <CategoryParentID>550</CategoryParentID>
    </Category>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <AutoPayEnabled>true</AutoPayEnabled>
      <CategoryID>2984</CategoryID>
      <CategoryLevel>1</CategoryLevel>
      <CategoryName>Baby</CategoryName>
      <CategoryParentID>2984</CategoryParentID>
    </Category>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <AutoPayEnabled>true</AutoPayEnabled>
      <CategoryID>267</CategoryID>
      <CategoryLevel>1</CategoryLevel>
      <CategoryName>Books</CategoryName>
      <CategoryParentID>267</CategoryParentID>
    </Category>

    ...

    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <CategoryID>2038</CategoryID>
      <CategoryLevel>1</CategoryLevel>
      <CategoryName>Live Auctions</CategoryName>
      <CategoryParentID>2038</CategoryParentID>
      <Expired>true</Expired>
      <LSD>true</LSD>
    </Category>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <CategoryID>10159</CategoryID>
      <CategoryLevel>1</CategoryLevel>
      <CategoryName>Partner</CategoryName>
      <CategoryParentID>10159</CategoryParentID>
    </Category>
  </CategoryArray>
  <CategoryCount>36</CategoryCount>
  <UpdateTime>2009-06-15T14:51:30.000Z</UpdateTime>
  <CategoryVersion>91</CategoryVersion>
  <ReservePriceAllowed>true</ReservePriceAllowed>
  <MinimumReservePrice>0.0</MinimumReservePrice>
</GetCategoriesResponse>

Back to list of samples

Sample: Get Details on a Specific Category

Retrieves the details on the specified category.

Description

Magic Bookseller is selling a Harry Potter book and is looking for the best category to list her book. She has found that the US Books category is number 267, and she want to drill down into that category to find the best category match for her item. This sample retrieves details about the Books category ( is set to ).

Input

A top-level category is input as the "Parent" category, and the request specifies that only the first level of subcategories be returned (the is set to ). The is set to , indicating that the user wants to see all the available information for each returned category.

If Magic Bookseller needs to see the entire category tree for Books, she can omit the input parameter.

XML format (HTTP POST). Also available is the .txt version of this XML.

<?xml version="1.0" encoding="utf-8"?>
<GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <RequesterCredentials>
    <eBayAuthToken>ABC...123</eBayAuthToken>
  </RequesterCredentials>
  <CategoryParent>267</CategoryParent>
  <DetailLevel>ReturnAll</DetailLevel>
  <LevelLimit>2</LevelLimit>
</GetCategoriesRequest>

Output

The seller finds that there are 13 sub-categories to the US Books category and she sees that the Fiction Books sub-category is the best sub-category for her Harry Potter title. She can also see that the Fiction Books category has no sub-categories of its own; the element is returned (and set to ).

With this information, the seller will add her item to the US category number 377. The version of this category hierarchy is 91, as shown in the field.

XML format. Also available is the .txt version of this XML.

<GetCategoriesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <Timestamp>2009-07-15T17:52:23.899Z</Timestamp>
  <Ack>Success</Ack>
  <Version>619</Version>
  <Build>e619__Bundled_9183565_R1</Build>
  <CategoryArray>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <AutoPayEnabled>true</AutoPayEnabled>
      <CategoryID>267</CategoryID>
      <CategoryLevel>1</CategoryLevel>
      <CategoryName>Books</CategoryName>
      <CategoryParentID>267</CategoryParentID>
    </Category>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <AutoPayEnabled>true</AutoPayEnabled>
      <CategoryID>45110</CategoryID>
      <CategoryLevel>2</CategoryLevel>
      <CategoryName>Accessories</CategoryName>
      <CategoryParentID>267</CategoryParentID>
    </Category>

    ...

    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <AutoPayEnabled>true</AutoPayEnabled>
      <CategoryID>377</CategoryID>
      <CategoryLevel>2</CategoryLevel>
      <CategoryName>Fiction Books</CategoryName>
      <CategoryParentID>267</CategoryParentID>
      <LeafCategory>true</LeafCategory>
    </Category>

    ...

    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <AutoPayEnabled>true</AutoPayEnabled>
      <CategoryID>268</CategoryID>
      <CategoryLevel>2</CategoryLevel>
      <CategoryName>Other</CategoryName>
      <CategoryParentID>267</CategoryParentID>
      <LeafCategory>true</LeafCategory>
    </Category>
  </CategoryArray>
  <CategoryCount>13</CategoryCount>
  <UpdateTime>2009-06-15T14:51:30.000Z</UpdateTime>
  <CategoryVersion>91</CategoryVersion>
  <ReservePriceAllowed>true</ReservePriceAllowed>
  <MinimumReservePrice>0.0</MinimumReservePrice>
</GetCategoriesResponse>

Back to list of samples



Back to top

GetCategories Change History
Version Description
551
2008-02-07
  • CategoryArray.Category.AutoPayEnabled (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • CategoryArray.Category.B2BVATEnabled (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • CategoryArray.Category.BestOfferEnabled (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • CategoryArray.Category.Expired (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • CategoryArray.Category.IntlAutosFixedCat (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • CategoryArray.Category.LeafCategory (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • CategoryArray.Category.LSD (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • CategoryArray.Category.ORPA (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • CategoryArray.Category.ORRA (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • CategoryArray.Category.SellerGuaranteeEligible (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • CategoryArray.Category.Virtual (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • GetCategories.ReduceReserveAllowed (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
  • GetCategories.ReservePriceAllowed (modified): If this field is to be included in the response (e.g. per the DetailLevel specified in the request), only returned if true. Not returned if false or if not set by eBay.
499
2007-02-07
  • Currency, ReduceReserveInclusive, ReservePriceInclusive (modified): Deleted previously deprecated objects from the latest schema. Some of these objects are still supported with lower request versions. See Deprecated Objects.

This document was generated with a customized version of the apireferencedocs tool.

© 2005–2009 eBay, Inc. All rights reserved. This documentation and the API may only be used in accordance with the eBay Developers Program and API License Agreement.