# Find

## Find

<mark style="color:blue;">`GET`</mark> `https://api.codemash.io/:version/db/taxonomies/:taxonomyName/terms`

Gets many terms by using a filter. This endpoint accepts GET and POST methods.

#### Path Parameters

| Name         | Type   | Description                               |
| ------------ | ------ | ----------------------------------------- |
| version      | string | A version of the API endpoint.            |
| taxonomyName | string | The name of taxonomy to get records from. |

#### Query Parameters

| Name            | Type    | Description                                                                                                                                                                                           |
| --------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filter          | string  | Filter document. This allows you to find records by a custom filter. More about filters follow the link below.                                                                                        |
| cultureCode     | string  | Language code. If your terms have translatable fields, those fields will only include this specified language. If not provided, will take language from the Accept-Language header.                   |
| sort            | string  | Sort document. This allows you to sort your records. More about sorting follow the link below.                                                                                                        |
| projection      | string  | Projection document. This allows you to specify what fields to return decreasing the amount of data transferred. This is applied to the **Meta** field. More about projections follow the link below. |
| pageSize        | integer | Amount of terms to return.                                                                                                                                                                            |
| pageNumber      | integer | The page to return. More about paging follow the link below.                                                                                                                                          |
| includeTaxonomy | boolean | Includes taxonomy to the response.                                                                                                                                                                    |
| excludeCulture  | boolean | Culture code or Accept-Language header will be used for translatable fields. If you want to get values in all languages, set this as true.                                                            |

#### Headers

| Name           | Type   | Description                                                                                            |
| -------------- | ------ | ------------------------------------------------------------------------------------------------------ |
| Authorization  | string | Secret API key which belongs to your project or user. Not required if using cookies with a session ID. |
| x-cm-projectid | string | Your project's ID. Can be passed as a query parameter.                                                 |

{% tabs %}
{% tab title="200 Returns a list of terms." %}

```javascript
{
    "result": [
        {
            "_id" : ObjectId("5e4faae1eda13b4b9c4b5ab9"),
            "createdOn" : ISODate("2020-01-01T12:00:00.000Z"),
            "modifiedOn" : ISODate("2020-01-01T12:00:00.000Z"),
            "taxonomyId" : ObjectId("5e4faaa5eda13b4b9c4b5ab8"),
            "taxonomyName" : "countries",
            "name" : {
                "en" : "Eswatini",
            },
            "description" : {
                "en" : "Country in Africa",
            },
            "order" : 1,
            "parentId" : ObjectId("5e4faae1eda13b4b9c4b5ab2"),
            "dependencies" : {
                "5e4faae1eda13b4b9c4b5ab2": [
                    ObjectId("5e4faae1eda13b4b9c4b5ab3"),
                    ObjectId("5e4faae1eda13b4b9c4b5ab4"),
                ]
            },
            "meta" : "{ \"text\" : \"Meta_Text\" }"
        }
    ],
    "totalCount": 1,
    "taxonomy": null,
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title=".NET" %}

```csharp
var client = new CodeMashClient(apiKey, projectId);
var service = new CodeMashRepository<Person>(client);

var persons = await service.FindAsync(
    x => true,
    new DatabaseFindOptions()
);
```

{% hint style="info" %}
Check the docs about [entities](broken://pages/-M-6_vT8PDXfwQxGKlF9) on how the response records are deserialized into your class objects.
{% endhint %}
{% endtab %}

{% tab title="Node" %}

```javascript
import { db } from 'codemash';

export async function getCountries() {
    return await db.getTaxonomyTerms('countries');
}

export async function getCities() {
    return await db.getTaxonomyTerms('cities');
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Check the docs on how to form [projections](/other-topics/list-parameters/projection.md), [filters](/other-topics/list-parameters/filter.md), [sorting](/other-topics/list-parameters/sort.md), [paging](/other-topics/list-parameters/paging.md). Check the docs on how to use [references](/api/database/collections/references.md).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codemash.io/api/database/taxonomies/find.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
