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

# Taxonomy

## Taxonomy

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

**Note**: All methods in the Query section are applicable for taxonomy-based filtering as well.

## equalAndBelow

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

```
Example:
const data = await stack
                   .taxonomy()
                   .where(
                       'taxonomies.one',
                       TaxonomyQueryOperation.EQ_BELOW,
                       'term_one',
                       {"levels": 1}  // optional
                   )
                   .find<TEntries>()
```

Enter the UID of the taxonomy

Enter the UID of the term

Enter the level

## below

The below operation 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:const data = await stack
                   .taxonomy()
                   .where(
                       'taxonomies.one',
                       TaxonomyQueryOperation.BELOW,
                       'term_one',
                       {"levels": 1}  // optional
                   )
                   .find<TEntries>()
```

Enter the UID of the taxonomy

Enter the UID of the term

Enter the level

## equalAndAbove

The equalAndAbove operation 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:const data = await stack
                   .taxonomy()
                   .where(
                       'taxonomies.one',
                       TaxonomyQueryOperation.EQ_ABOVE,
                       'term_one',
                       {"levels": 1}  // optional
                   )
                   .find<TEntries>()
```

Enter the UID of the taxonomy

Enter the UID of the term

Enter the level

## above

The equalAndAbove operation retrieves all entries for a specific The above operation retrieves all entries for a specific taxonomy that match only the parent terms 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:const data = await stack
                   .taxonomy()
                   .where(
                       'taxonomies.one',
                       TaxonomyQueryOperation.ABOVE,
                       'term_one',
                       {"levels": 1}  // optional
                   )
                   .find<TEntries>()
```

Enter the UID of the taxonomy

Enter the UID of the term

Enter the level

## fetch

The fetch method retrieves the details of a specific published taxonomy by UID.

```
Validationlocale is an optional positional argument, not a chained setter. It must be passed directly to fetch(locale). There is no client-side validation of the locale code. An invalid or unpublished locale is rejected by the API. See Delivery API Errors.
BehaviorMaps to a single GET request to /taxonomies/&#123;taxonomy_uid&#125;. The response is unwrapped from response.taxonomy. If that key is absent, the raw response is returned as-is.
Exampleimport contentstack, &#123;BaseTaxonomy&#125; from '@contentstack/delivery-sdk'

interface BlogTaxonomy extends BaseTaxonomy &#123;
  uid: string
  name: string
&#125;

const stack = contentstack.stack(&#123; apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" &#125;)

// Master locale
const result = await stack
    .taxonomy(taxonomy_uid)
    .fetch<BlogTaxonomy>()

// Localized
const localized = await stack
    .taxonomy(taxonomy_uid)
    .fetch<BlogTaxonomy>('hi-in')
```

Locale code (for example, hi-in), passed positionally. Omit to retrieve the master locale.

## term

The term method returns either a Term instance or a TermQuery instance, depending on whether a term UID is passed. Pass a UID to fetch a single term. Omit the UID to build a query across all terms in the taxonomy.

```
Instance StateThe TypeScript SDK exposes a single overloaded term() method for both call shapes. This differs from the .NET SDK, which splits the same behavior into two separate methods, Term(termUid) and Terms(). Calling term('term_uid') in TypeScript is equivalent to Term(termUid) in .NET. Calling term() with no argument is equivalent to Terms() in .NET.
ValidationThere is no client-side validation of uid. An empty string is treated the same as an omitted argument because the method checks if (uid), so passing term('') returns a TermQuery, not a Term. An invalid or nonexistent term UID does not throw at this step. The API rejects it on the subsequent fetch() call. See Delivery API Errors.
BehaviorClient-side only. Constructs a Term or TermQuery instance. No HTTP call is made until a terminal method (fetch(), locales(), ancestors(), descendants(), or find()) is called on the returned object.
Exampleimport contentstack from '@contentstack/delivery-sdk'

const stack = contentstack.stack(&#123; apiKey: "apiKey", deliveryToken: "deliveryToken", environment: "environment" &#125;)

// Get a specific term (returns a Term)
const term = stack.taxonomy('taxonomy_uid').term('term_uid')

// Get all terms (returns a TermQuery)
const termQuery = stack.taxonomy('taxonomy_uid').term()
```

UID of the term. When passed, returns a Term. When omitted, returns a TermQuery.

## Taxonomy | TypeScript Delivery SDK | Contentstack

The Taxonomy class in the TypeScript Delivery SDK helps you categorize content within your stack for easy navigation, search, and retrieval of information.