> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sdk.anghami.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search & Browse

> Full-text search plus editorial browsing — featured sections, new releases, charts, genres.

`DiscoveryService` combines two complementary discovery surfaces:

* **Search** — full-text query across the catalog.
* **Browse** — curated editorial entry points (featured, new releases, charts, genres).

## Search

```ts theme={null}
const res = await discovery.search({
  q: "Fairouz",
  types: [ContentType.CONTENT_TYPE_SONG, ContentType.CONTENT_TYPE_ARTIST],
  market: "LB",
  pageSize: 20,
});
```

| Parameter                  | Notes                                                                       |
| -------------------------- | --------------------------------------------------------------------------- |
| `q`                        | The search string. Required (min length 1).                                 |
| `types`                    | Filter to specific entity kinds. Omit for "everything".                     |
| `market`                   | Two-letter country code (e.g. `LB`, `SA`). Defaults to the caller's market. |
| `page_size` / `page_token` | Standard cursor pagination, top-level fields.                               |

Results are returned as a list of [`Content`](/content-model#the-content-wrapper) wrappers — branch on the `oneof id` arm to act on each match.

## Browse

| RPC                 | What it returns                                                                                                  |
| ------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `BrowseFeatured`    | Editorially curated sections (e.g. "Made For You", "Trending Now"). Each section is a labeled list of `Content`. |
| `BrowseNewReleases` | Recently released items across the catalog.                                                                      |
| `BrowseCharts`      | Available popularity charts with preview entries. Use `GetChartEntries` for the full chart.                      |
| `GetChartEntries`   | Paginated entries for a specific chart.                                                                          |
| `BrowseGenres`      | List of available genres.                                                                                        |
| `GetGenreContent`   | Items tagged with a genre — paginated and content-type filterable.                                               |

Editorial output varies by market — pass `market` where the RPC accepts it.

## When to use which

* **Specific known query?** `Search`. The user typed it.
* **Discovery / open-ended UX?** `BrowseFeatured` for the home screen, `BrowseCharts` for "what's hot", `BrowseGenres` → `GetGenreContent` for filter-driven browsing.
* **"What's new?" UX?** `BrowseNewReleases`.

## Performance tips

* Large `page_size` (up to 100) reduces round-trips for paginated browse output.
* Search ranking is not stable across queries — don't paginate deep beyond what your UI actually shows.
* Charts are recomputed periodically; treat chart entries as a snapshot rather than real-time.
