NIP-50: Search
NIP-50 defines a generalized search capability for Nostr relays, allowing clients to perform full-text searches beyond structured queries by tags or IDs.
How It Works
The protocol adds a search field to filter objects in REQ messages:
- Clients submit human-readable search queries (e.g., “best nostr apps”)
- Relays interpret and match queries against event data, primarily the
contentfield - Results are ranked by relevance rather than chronological order
- The
limitfilter applies after relevance sorting
Search filters can be combined with other constraints like kinds and ids for more specific queries.
Search Extensions
Relays may optionally support these extension parameters:
include:spam- Disables default spam filteringdomain:<domain>- Filters by verified NIP-05 domainlanguage:<code>- Filters by ISO language codesentiment:<value>- Filters by negative/neutral/positive sentimentnsfw:<true/false>- Includes or excludes NSFW content
Client Considerations
- Clients should check relay capabilities via the
supported_nipsfield - Client-side verification of results is recommended
- Not all relays implement search; it remains an optional feature
Primary sources:
Mentioned in:
See also: