# parts.page.mention.search

> Search a mention service for matching results. A single XRPC host can serve multiple mention services, distinguished by the service AT URI.

- Kind: query
- Authority: mention.page.parts
- Lexicon: 1
- Published by [page.parts](https://lexicon.garden/identity/did:plc:de2gzyliybvjo4bfvu4i54de), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:de2gzyliybvjo4bfvu4i54de/parts.page.mention.search)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:de2gzyliybvjo4bfvu4i54de/parts.page.mention.search/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:de2gzyliybvjo4bfvu4i54de/parts.page.mention.search/analytics)

## Query (`parts.page.mention.search`)

Type: query · GET

### Parameters (query string)

- `limit` (integer): Maximum number of results to return
  - Constraints: minimum: 1, maximum: 50, default: 20
- `scope` (string): Optional scope identifier to narrow results within a service, as returned by a previous result's subscope.scope field
- `search` (string, required): Search query string
- `service` (string · at-uri, required): AT URI of the parts.page.mention.service record identifying which service to query

### Output (application/json)

- `results` (array, required)
  - Constraints: maxLength: 50
  - `items` (ref)
    - Reference: `#result`

## #aspectRatio (`parts.page.mention.search#aspectRatio`)

Type: object

### Properties

- `height` (integer, required)
- `width` (integer, required)

## #embedInfo (`parts.page.mention.search#embedInfo`)

Type: object

### Properties

- `aspectRatio` (ref): Aspect ratio of the embed. If provided, takes precedence over width/height for sizing.
  - Reference: `#aspectRatio`
- `height` (integer): Default height of the embed in pixels
  - Constraints: minimum: 16, maximum: 3200
- `src` (string · uri, required): Source URL for the iframe embed
- `width` (integer): Default width of the embed in pixels
  - Constraints: minimum: 16, maximum: 3200

## #mentionLabel (`parts.page.mention.search#mentionLabel`)

Type: object

### Properties

- `text` (string)

## #result (`parts.page.mention.search#result`)

Type: object

### Properties

- `description` (string): A description for the mentioned entity
- `embed` (ref): Optional embed info for creating an embed block instead of an inline mention
  - Reference: `#embedInfo`
- `href` (string · uri): Optional web URL for the mentioned entity
- `icon` (string · uri): Optional icon URL for the mentioned entity, displayed next to the mention
- `labels` (array): A set of labels to be rendered with the mentionedEntity
  - `items` (ref)
    - Reference: `#mentionLabel`
- `name` (string, required): Display name for the mentioned entity
- `subscope` (ref): Optional subscope info indicating this result can be scoped into for further searching
  - Reference: `#subscopeInfo`
- `uri` (string, required): Identifier for the mentioned entity

## #subscopeInfo (`parts.page.mention.search#subscopeInfo`)

Type: object

### Properties

- `label` (string, required): Display label for the scope-down button (e.g. 'Posts', 'Tracks')
  - Constraints: maxLength: 100
- `scope` (string, required): Scope identifier passed back to the service in subsequent search queries

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "aspectRatio": {
      "properties": {
        "height": {
          "type": "integer"
        },
        "width": {
          "type": "integer"
        }
      },
      "required": [
        "width",
        "height"
      ],
      "type": "object"
    },
    "embedInfo": {
      "properties": {
        "aspectRatio": {
          "description": "Aspect ratio of the embed. If provided, takes precedence over width/height for sizing.",
          "ref": "#aspectRatio",
          "type": "ref"
        },
        "height": {
          "description": "Default height of the embed in pixels",
          "maximum": 3200,
          "minimum": 16,
          "type": "integer"
        },
        "src": {
          "description": "Source URL for the iframe embed",
          "format": "uri",
          "type": "string"
        },
        "width": {
          "description": "Default width of the embed in pixels",
          "maximum": 3200,
          "minimum": 16,
          "type": "integer"
        }
      },
      "required": [
        "src"
      ],
      "type": "object"
    },
    "main": {
      "description": "Search a mention service for matching results. A single XRPC host can serve multiple mention services, distinguished by the service AT URI.",
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "results": {
              "items": {
                "ref": "#result",
                "type": "ref"
              },
              "maxLength": 50,
              "type": "array"
            }
          },
          "required": [
            "results"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "limit": {
            "default": 20,
            "description": "Maximum number of results to return",
            "maximum": 50,
            "minimum": 1,
            "type": "integer"
          },
          "scope": {
            "description": "Optional scope identifier to narrow results within a service, as returned by a previous result's subscope.scope field",
            "type": "string"
          },
          "search": {
            "description": "Search query string",
            "type": "string"
          },
          "service": {
            "description": "AT URI of the parts.page.mention.service record identifying which service to query",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "service",
          "search"
        ],
        "type": "params"
      },
      "type": "query"
    },
    "mentionLabel": {
      "properties": {
        "text": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "result": {
      "properties": {
        "description": {
          "description": "A description for the mentioned entity",
          "type": "string"
        },
        "embed": {
          "description": "Optional embed info for creating an embed block instead of an inline mention",
          "ref": "#embedInfo",
          "type": "ref"
        },
        "href": {
          "description": "Optional web URL for the mentioned entity",
          "format": "uri",
          "type": "string"
        },
        "icon": {
          "description": "Optional icon URL for the mentioned entity, displayed next to the mention",
          "format": "uri",
          "type": "string"
        },
        "labels": {
          "description": "A set of labels to be rendered with the mentionedEntity",
          "items": {
            "ref": "#mentionLabel",
            "type": "ref"
          },
          "type": "array"
        },
        "name": {
          "description": "Display name for the mentioned entity",
          "type": "string"
        },
        "subscope": {
          "description": "Optional subscope info indicating this result can be scoped into for further searching",
          "ref": "#subscopeInfo",
          "type": "ref"
        },
        "uri": {
          "description": "Identifier for the mentioned entity",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "name"
      ],
      "type": "object"
    },
    "subscopeInfo": {
      "properties": {
        "label": {
          "description": "Display label for the scope-down button (e.g. 'Posts', 'Tracks')",
          "maxLength": 100,
          "type": "string"
        },
        "scope": {
          "description": "Scope identifier passed back to the service in subsequent search queries",
          "type": "string"
        }
      },
      "required": [
        "scope",
        "label"
      ],
      "type": "object"
    }
  },
  "id": "parts.page.mention.search",
  "lexicon": 1
}
```
