# DramaDash Pagination Notes

Last updated: 2025-11-15

These notes summarize the observed behavior of the public DramaDash API while investigating paging for the `home`, `popular`, `new`, and `search` experiences. All calls require a valid token from `/api/landing` and include the usual Android headers (`app-version`, `lang`, `platform`, etc.).

## Home & Tabs

- Endpoint: `GET https://www.dramadash.app/api/home`
- Supported query parameters:
  - `page` (1-based, defaults to `1`). Works for the default "Popular" feed and any tab request.
  - `tab_id` (optional). Known IDs from the public web client as of 2025-11-15:
    - `null` → Popular (default feed)
    - `2` → New
    - `3` → Trending
    - `4` → Romance
    - `5` → CEO
- The API ignores additional paging parameters such as `page_size`, `limit`, or `cursor`.
- For tab calls (`tab_id` present) the payload includes a top-level `list` array instead of nested `dramaList` sections. Transformations should treat this list as the full set of dramas for the response page.
- Each response currently contains 35–37 dramas per page. There is no explicit `nextPage` field, but some payloads expose a boolean `hasNext` flag.

## Search

- Endpoint: `POST https://www.dramadash.app/api/search/text`
- Required body fields:
  - `search`: the localized keyword. (Indonesian queries such as `"cinta"` return the most results.)
  - `page`: 1-based integer. When omitted it defaults to the first page; explicitly setting `page` returns the corresponding slice.
- The API responds with `result` (array of dramas) plus optional `hasNext`. Parameters such as `page_size` or `limit` are ignored.

## Practical Tips

1. Always request a landing token before hitting `/api/home` or `/api/search/text`.
2. Include `page` in cache keys; different pages are independent payloads.
3. Be ready to flatten top-level `list` payloads when `dramaList` is missing.
4. Treat `hasNext` as advisory—if it is missing, fall back to the page count (e.g., if the current page returns fewer than ~35 results, you are likely at the end).
