# pub.chive.actor.autocompleteKeyword

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.actor.autocompleteKeyword)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.actor.autocompleteKeyword/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.actor.autocompleteKeyword/examples)

## Definitions

### `pub.chive.actor.autocompleteKeyword`

**Type**: `query`

Autocomplete research keywords using FAST subject headings and Wikidata entities

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `limit` | `integer` | No | Maximum number of suggestions to return |
| `query` | `string` | Yes | Search query for keyword |
| `sources` | `array` | No | Data sources to query (defaults to both) |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `suggestions` | `array` | Yes |  |

### `pub.chive.actor.autocompleteKeyword#keywordSuggestion`

**Type**: `object`

A keyword suggestion from FAST or Wikidata

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | Identifier from the source system (FAST ID or Wikidata Q-number) |
| `label` | `string` | Yes | Display label for the keyword |
| `source` | `string` | Yes | Source of the keyword suggestion |
| `usageCount` | `integer` | No | Usage count from FAST database |
| `description` | `string` | No | Description of the keyword (Wikidata only) |

## Raw Schema

```json
{
  "id": "pub.chive.actor.autocompleteKeyword",
  "defs": {
    "main": {
      "type": "query",
      "errors": [],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "suggestions"
          ],
          "properties": {
            "suggestions": {
              "type": "array",
              "items": {
                "ref": "#keywordSuggestion",
                "type": "ref"
              }
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "query"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "default": 8,
            "maximum": 50,
            "minimum": 1,
            "description": "Maximum number of suggestions to return"
          },
          "query": {
            "type": "string",
            "minLength": 1,
            "description": "Search query for keyword"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string",
              "knownValues": [
                "fast",
                "wikidata"
              ]
            },
            "description": "Data sources to query (defaults to both)"
          }
        }
      },
      "description": "Autocomplete research keywords using FAST subject headings and Wikidata entities"
    },
    "keywordSuggestion": {
      "type": "object",
      "required": [
        "id",
        "label",
        "source"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Identifier from the source system (FAST ID or Wikidata Q-number)"
        },
        "label": {
          "type": "string",
          "description": "Display label for the keyword"
        },
        "source": {
          "type": "string",
          "description": "Source of the keyword suggestion",
          "knownValues": [
            "fast",
            "wikidata",
            "freetext"
          ]
        },
        "usageCount": {
          "type": "integer",
          "description": "Usage count from FAST database"
        },
        "description": {
          "type": "string",
          "description": "Description of the keyword (Wikidata only)"
        }
      },
      "description": "A keyword suggestion from FAST or Wikidata"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
