# app.bivri.search.searchArtworks

> Published by [lexicons.bivri.app](https://lexicon.garden/identity/did:plc:uqat5a7hrbww3snbbinxgwah)

✓ This is the authoritative definition for this NSID.

## Description

Search artworks by keyword, tag, or author name. A 'tag:' prefix enables boolean tag search.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:uqat5a7hrbww3snbbinxgwah/app.bivri.search.searchArtworks)
- [Documentation](https://lexicon.garden/lexicon/did:plc:uqat5a7hrbww3snbbinxgwah/app.bivri.search.searchArtworks/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:uqat5a7hrbww3snbbinxgwah/app.bivri.search.searchArtworks/examples)

## Definitions

### `app.bivri.search.searchArtworks`

**Type**: `query`

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `q` | `string` | Yes | Search query. Supports boolean tag search, with 'tag:xxx' terms combined by AND, OR and NOT. |
| `sort` | `string` | No | Ordering of the results. 'relevance' is by match score; 'latest' is reverse-chronological; 'popular' is by like count. |
| `limit` | `integer` | No | Maximum number of artworks to return. |
| `cursor` | `string` | No | Opaque pagination cursor. Valid only for the sort mode it was issued under; pass it back unchanged on the next request. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cursor` | `string` | No |  |
| `artworks` | `array` | Yes |  |
| `suggestedTags` | `array` | No | Popular tags suggested when the search matched no artworks. |

### `app.bivri.search.searchArtworks#tagSuggestion`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `tag` | `string` | Yes |  |
| `count` | `integer` | Yes |  |

## Raw Schema

```json
{
  "id": "app.bivri.search.searchArtworks",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "artworks"
          ],
          "properties": {
            "cursor": {
              "type": "string"
            },
            "artworks": {
              "type": "array",
              "items": {
                "ref": "app.bivri.feed.defs#artworkView",
                "type": "ref"
              }
            },
            "suggestedTags": {
              "type": "array",
              "items": {
                "ref": "#tagSuggestion",
                "type": "ref"
              },
              "description": "Popular tags suggested when the search matched no artworks."
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "q"
        ],
        "properties": {
          "q": {
            "type": "string",
            "description": "Search query. Supports boolean tag search, with 'tag:xxx' terms combined by AND, OR and NOT."
          },
          "sort": {
            "type": "string",
            "default": "relevance",
            "description": "Ordering of the results. 'relevance' is by match score; 'latest' is reverse-chronological; 'popular' is by like count.",
            "knownValues": [
              "relevance",
              "latest",
              "popular"
            ]
          },
          "limit": {
            "type": "integer",
            "default": 25,
            "maximum": 100,
            "minimum": 1,
            "description": "Maximum number of artworks to return."
          },
          "cursor": {
            "type": "string",
            "description": "Opaque pagination cursor. Valid only for the sort mode it was issued under; pass it back unchanged on the next request."
          }
        }
      }
    },
    "tagSuggestion": {
      "type": "object",
      "required": [
        "tag",
        "count"
      ],
      "properties": {
        "tag": {
          "type": "string"
        },
        "count": {
          "type": "integer"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "Search artworks by keyword, tag, or author name. A 'tag:' prefix enables boolean tag search."
}
```
