Source: https://eventregistry.org/documentation?tab=suggCategories

# Suggest categories

Retrieve the category URI for a given category label/prefix.

POST `https://eventregistry.org/api/v1/suggestCategoriesFast`

**Body:** JSON, with `Content-Type: application/json`. GET with query parameters also works.

## How it works

Use this API endpoint to map the category label into the category URI that can be used when specifying the `categoryUri` filter in various API calls. The label can also be a partial name.

The returned value will contain an array of candidates that match the input label. The returned list is sorted based on how frequently the category occurs in Event Registry data.

## Parameters

Send them in the JSON body; the same names work as GET query parameters.

### Core

#### `apiKey`

Required

string

Your API key

#### `prefix`

string

 Partial or full name of the category.

## Request examples

### Example 1: Categories whose label contains Business

Find the list of categories whose label matches the term "Business". The matching is case-insensitive and the term can appear anywhere inside the category name.

Request body:

```json
{
  "prefix": "Business",
  "page": 1,
  "count": 20,
  "articleBodyLen": -1,
  "apiKey": "YOUR_API_KEY"
}
```

```python
from eventregistry import *
er = EventRegistry(apiKey = YOUR_API_KEY)

conceptUrisMatchingObama = er.suggestCategories("Business")
```

```javascript
var er = new erBase.EventRegistry();
                    er.suggestCategories("Business").then((response) => {
                        console.info(response);
                    });
```

```typescript
const er = new EventRegistry();
                    er.suggestCategories("Business").then((response) => {
                        console.info(response);
                    });
```

## Example output

```json
[
  {
    "uri": "dmoz/Arts",
    "label": "dmoz/Arts",
    "parentUri": "dmoz"
  },
  {
    "uri": "news/Arts_and_Entertainment",
    "label": "news/Arts and Entertainment",
    "parentUri": "news"
  },
  {
    "#META ITEM": "other categories..."
  }
]
```

## Output schema

```json
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "uri": {
        "type": "string"
      },
      "label": {
        "type": "string"
      }
    }
  }
}
```
