---
title: "Taxonomy"
description: "Taxonomy"
url: "https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/android/reference/taxonomy"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-22"
---

# Taxonomy

## Taxonomy

[Taxonomy](/docs/headless-cms/about-taxonomy) helps you categorize pieces of content within your stack to facilitate easy navigation and retrieval of information.

**Example:**

```
import com.contentstack.sdk.*;Stack stack = Contentstack.stack(apiKey, deliveryToken, environment);Taxonomy taxonomy = stack.taxonomy();
```

## in

The in method retrieves all entries for a specific taxonomy that satisfy the given conditions provided in the $in query.

```
Example:
Taxonomy taxonomy = stack.taxonomy();
List<string> listOfItems = new ArrayList<>();
listOfItems.add("maroon");
listOfItems.add("red");
taxonomy.in(taxonomy,listOfItems).find(new TaxonomyCallback() {
   @Override
   public void onResponse(JSONObject response, Error error) {
       Log.d("RESULT:",response.toString());
   }
});
```

Enter the UID of the taxonomy

Enter the list of taxonomy fields

## or

The or method retrieves all entries for a specific taxonomy that satisfy at lease one of the given conditions provided in the $or query.

```
Example:
Taxonomy taxonomy = stack.taxonomy();
List<jsonobject> listOfItems = new ArrayList<>();
JSONObject item1 = new JSONObject();
item1.put("taxonomies.color", "orange");
JSONObject item2 = new JSONObject();
item2.put("taxonomies.country", "zambia");
listOfItems.add(item1);
listOfItems.add(item2);
taxonomy.or(listOfItems).find(new TaxonomyCallback() {
   @Override
   public void onResponse(JSONObject response, Error error) {
       Log.d("RESULT:",response.toString());
   }
});
```

Enter the list of taxonomy fields

## and

The and method retrieves all entries for a specific taxonomy that satisfy all the given conditions provided in the $and query.

```
Example:
Taxonomy taxonomy = stack.taxonomy();
List<JSONObject> listOfItems = new ArrayList<>();
JSONObject items1 = new JSONObject();
items1.put("taxonomies.color", "green");
JSONObject items2 = new JSONObject();
items2.put("taxonomies.country", "india");
listOfItems.add(items1);
listOfItems.add(items2);
taxonomy.and(listOfItems).find(new TaxonomyCallback() {
   @Override
   public void onResponse(JSONObject response, Error error) {
       Log.d("RESULT:",response.toString());
   }
});
```

Enter the list of taxonomy fields

## exists

The exists method retrieves all entries for a specific taxonomy if the value of the field, mentioned in the condition, exists.

```
Example:
Taxonomy taxonomy = stack.taxonomy().exists(taxonomy, Value);
taxonomy.find(new TaxonomyCallback() {
   @Override
   public void onResponse(JSONObject response, Error error) {
       Log.d("RESULT:",response.toString());
   }
});
```

Enter the UID of the taxonomy

Enter true/false

## equalAndBelow

The equalAndBelow method retrieves all entries for a specific taxonomy that match a specific term and all its descendant terms, requiring only the target term.

```
Example:
Taxonomy taxonomy = stack.taxonomy().equalAndBelow(taxonomy, termsUid);
taxonomy.find(new TaxonomyCallback() {
   @Override
   public void onResponse(JSONObject response, Error error) {
       Log.d("RESULT:",response.toString());
   }
});
```

Enter the UID of the taxonomy

Enter the UID of the term

## below

The below method retrieves all entries for a specific taxonomy that match all of their descendant terms by specifying only the target term and a specific level.

**Note:** If you don't specify the level, the default behavior is to retrieve terms up to level 10.

```
Example:
Taxonomy taxonomy = stack.taxonomy().below(taxonomy, termsUid);
taxonomy.find(new TaxonomyCallback() {
   @Override
   public void onResponse(JSONObject response, Error error) {
       Log.d("RESULT:",response.toString());
   }
});
```

Enter the UID of the taxonomy

Enter the UID of the term

## equalAbove

The equalAbove method retrieves all entries for a specific taxonomy that match a specific term and all its ancestor terms, requiring only the target term and a specified level.

**Note:** If you don't specify the level, the default behavior is to retrieve terms up to level 10.

```
Example:
Taxonomy taxonomy = stack.taxonomy().equalAbove(taxonomy, termsUid);
taxonomy.find(new TaxonomyCallback() {
   @Override
   public void onResponse(JSONObject response, Error error) {
       Log.d("RESULT:",response.toString());
   }
});
```

Enter the UID of the taxonomy

Enter the UID of the term

## above

The above method retrieves all entries for a specific taxonomy that match only the parent term(s) of a specified target term, excluding the target term itself and a specified level.

**Note:** If you don't specify the level, the default behavior is to retrieve terms up to level 10.

```
Example:
Taxonomy taxonomy = stack.taxonomy().above(taxonomy, termsUid);
taxonomy.find(new TaxonomyCallback() {
   @Override
   public void onResponse(JSONObject response, Error error) {
       Log.d("RESULT:",response.toString());
   }
});
```

Enter the UID of the taxonomy

Enter the UID of the term

## find

The find method is used to get API response.

```
Example:
taxonomy.find(new TaxonomyCallback() {
   @Override
   public void onResponse(JSONObject response, Error error) {
       Log.d("Result:",response.toString());
   }
});
```

The callback class that contains the API response

## Taxonomy | Android Delivery SDK | Contentstack

Taxonomy lets you categorize stack content in the Android Delivery SDK, enabling easy navigation and retrieval through hierarchical classification.