## Searching Casts

You can search for casts using [keywords and operators](https://docs.neynar.com/reference/search-casts#parameter-q) in the search query.

## Node.js SDK

🔗 **SDK Method:** [searchCasts](https://docs.neynar.com/nodejs-sdk/cast-apis/searchCasts) Use this API endpoint with the Neynar Node.js SDK for typed responses and better developer experience.

#### Authorizations

**x-api-key**  
string  
header  
default: NEYNAR_API_DOCS  
required  
API key to authorize requests

#### Headers

**x-neynar-experimental**  
boolean  
default: false  
Enables experimental features including filtering based on the Neynar score. See [docs](https://neynar.notion.site/Experimental-Features-1d2655195a8b80eb98b4d4ae7b76ae4a) for more details.

#### Query Parameters

**q**  
string  
required  
Query string to search for casts. Supported operators:

| Operator | Description |
| --- | --- |
| `+` | Acts as the AND operator. This is the default operator between terms and can usually be omitted. |
| `|` | Acts as the OR operator. |
| `*` | When used at the end of a term, signifies a prefix query. |
| `"` | Wraps several terms into a phrase (for example, "star wars"). |
| `(`, `)` | Wrap a clause for precedence (for example, `star + (wars | trek)`). |
| `~n` | When used after a term (for example, `satr~3`), sets `fuzziness`. When used after a phrase, sets `slop`. |
| `-` | Negates the term. |
| `before:` | Search for casts before a specific date. (e.g. `before:2025-04-20` or `before:2025-04-20T23:59:59`) |
| `after:` | Search for casts after a specific date. (e.g. `after:2025-04-20` or `after:2025-04-20T00:00:00`) |

Example:

`"star (wars | trek) \"space battle\" after:2024-05-04`

**mode**  
enum<string>  
Choices are:

- `literal` - Searches for the words in the query string (default)
- `semantic` - Searches for the meaning of the query string
- `hybrid` - Combines both literal and semantic results

Available options:

`literal`, `semantic`, `hybrid`

Example:

`"literal`

**sort_type**  
enum<string>  
Choices are:

- `desc_chron` - All casts sorted by time in a descending order (default)
- `chron` - All casts sorted by time in ascending order
- `algorithmic` - Casts sorted by engagement and time

Available options:

`desc_chron`, `chron`, `algorithmic`

Example:

`"desc_chron`

**author_fid**  
integer  
Fid of the user whose casts you want to search  
Required range: `x >= 1`

**viewer_fid**  
integer  
Providing this will return search results that respects this user's mutes and blocks and includes `viewer_context`.  
Required range: `x >= 1`

**parent_url**  
string  
Parent URL of the casts you want to search

**channel_id**  
string  
Channel ID of the casts you want to search

**limit**  
integer<int32>  
default: 25  
Number of results to fetch  
Required range: `1 <= x <= 100`

Example:

`25`

**cursor**  
string  
Pagination cursor.
