# DonanımHaber Forum API — search, read and monitor Turkey's largest technology forum (forum.donanimhaber.com, active since 2001, ~700 sections). Keyword search across every post, full topic detail (opening post, author, dates, view/reply counts and replies), paginated section listings, and the section directory — clean JSON, Turkish text intact, no login.

> Keyword-search every post on DonanımHaber Forum — the site's own search index, not a page scrape. Returns the matching post's title, excerpt, section, author-visible timestamp and a deep link to the exact message. Filter to opening posts only (topic search), to one section, or to one thread; sort by recency or relevance. Ideal for Turkish-market demand signals, product mentions and support chatter.
> ReefAPI engine `donanimhaber` · 4 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/donanimhaber/v1/<action>` with a JSON body.
- **Auth:** header `x-api-key: <YOUR_REEFAPI_KEY>` — create one free (1,000 credits, no card): https://reefapi.com/signup
- **Response (every call):** `{ ok: boolean, data: ..., meta: { record_count, credits, ... }, error: { code, message } }` — branch on `ok`. Failed or blocked calls are free.
- **One key + one shared credit pool** across every ReefAPI API. Per-call credits are listed on each endpoint below.
- **Use it from an AI agent (MCP):** connect `https://api.reefapi.com/mcp` (remote streamable-http, `Authorization: Bearer <key>`) and your assistant can call these actions directly.

## Endpoints

### POST /donanimhaber/v1/search — 1 credit
Keyword-search every post on DonanımHaber Forum — the site's own search index, not a page scrape. Returns the matching post's title, excerpt, section, author-visible timestamp and a deep link to the exact message. Filter to opening posts only (topic search), to one section, or to one thread; sort by recency or relevance. Ideal for Turkish-market demand signals, product mentions and support chatter.

**Parameters:**
- `query` (string, required) — Turkish (or English) keyword(s) to find in DonanımHaber Forum posts — e.g. 'veri çekme', 'ekran kartı', 'RTX 5090'. Turkish characters (ı ş ğ ç ö ü) are sent through unchanged.
- `search_in` (enum, optional, default "all") — Where to look. 'all' searches title AND body and is very broad (the site stems Turkish words, so 'veri' also matches 'verimli'). Use 'title' when you want precision — measured 204 title hits vs 19 541 all-field hits for the same query. [one of: all, title, body]
- `match` (enum, optional, default "both") — How the words are combined: 'both' = every word (any order), 'any' = at least one word, 'exact' = the phrase as typed. [one of: both, any, exact]
- `sort` (enum, optional, default "date") — Result order. 'date' (newest first) is the freshness feed; 'rank' is best-match first. [one of: date, date_asc, rank]
- `first_post_only` (boolean, optional, default false) — Match only the OPENING post of each thread instead of every reply. Turns a noisy message search into a topic search — good for lead/demand hunting ('who is ASKING for this?').
- `section` (string, optional) — A forum section: the numeric id (2770), 'f2770', the section URL, or the '<slug>--f2770' slug. Use the `sections` action to find ids by name, or read `section_id` off any `search` hit.
- `topic` (string, optional) — The topic: numeric topic id (163852334), the full topic URL, or the '<slug>--<id>' slug. All three resolve to the same thread.
- `posted_within` (enum, optional) — Keep only posts newer than this. NOTE: the upstream search's own date-range field is a no-op (measured: identical totals for every value), so this filter is applied by us over a newest-first result stream — `total_matches` still reports the unfiltered upstream total, and `returned` reports what survived. [one of: 1d, 3d, 7d, 30d, 90d, 365d]
- `limit` (integer, optional, default 20) — How many posts to return (1–100, default 20).
- `page` (integer, optional, default 1) — 1-based page number (1–1000).
- `search_offline` (boolean, optional, default false) — Skip the site's search host (which is crawler-disallowed by its own robots.txt) and keyword-filter a robots-ALLOWED section listing instead. Requires `section`. Narrower coverage, fully robots-clean.

**Returns:** results[]{message_id, topic_id, is_opening_post, title, excerpt, matched_words[], section, section_id, posted_at, posted_label, url, topic_url, other_matches_in_topic[]}, total_matches, returned, page, pages_available, did_you_mean

**Example request body:**
```json
{
  "query": "ekran kartı",
  "search_in": "title",
  "limit": 10
}
```

### POST /donanimhaber/v1/topic — 1 credit
Full detail for one DonanımHaber Forum thread: title, the complete opening post as clean text, the author (public handle, profile, staff title, lifetime post count), published/last-updated timestamps, the section it lives in, view / post / like counts, and the replies on the requested page with their own authors, timestamps and like counts.

**Parameters:**
- `topic` (string, required) — The topic: numeric topic id (163852334), the full topic URL, or the '<slug>--<id>' slug. All three resolve to the same thread.
- `page` (integer, optional, default 1) — 1-based page number (1–5000).

**Returns:** topic{topic_id, title, body, author{name,profile_url,title,total_posts}, posted_at, updated_at, section, section_id, breadcrumb[], view_count, post_count, reply_count, like_count, page, pages_available, language, url}, replies[]{message_id, author, posted_at, text, likes, url}

**Example request body:**
```json
{
  "topic": "163852334"
}
```

### POST /donanimhaber/v1/section — 1 credit
List the topics in one DonanımHaber Forum section, newest activity first, with pagination (65 topics per page). Each row carries the title, the site's own opening-post teaser, the thread starter, reply and view counts, and the last-post timestamp — enough to monitor a section without opening a single thread.

**Parameters:**
- `section` (string, required) — A forum section: the numeric id (2770), 'f2770', the section URL, or the '<slug>--f2770' slug. Use the `sections` action to find ids by name, or read `section_id` off any `search` hit.
- `page` (integer, optional, default 1) — 1-based page number (1–5000).
- `limit` (integer, optional, default 65) — How many topics to return (1–65, default 65).
- `query` (string, optional) — Optional client-side keyword filter over the titles/teasers on this page.
- `posted_within` (enum, optional) — Keep only posts newer than this. NOTE: the upstream search's own date-range field is a no-op (measured: identical totals for every value), so this filter is applied by us over a newest-first result stream — `total_matches` still reports the unfiltered upstream total, and `returned` reports what survived. [one of: 1d, 3d, 7d, 30d, 90d, 365d]
- `include_sticky` (boolean, optional, default true) — Include the section's pinned/announcement topics (they are not sorted by recency).

**Returns:** topics[]{topic_id, title, preview, author{name,profile_url}, reply_count, view_count, last_post_at, last_post_label, last_post_author, sticky, url}, section{id, name, description, breadcrumb[]}, returned, page, has_next_page

**Example request body:**
```json
{
  "section": "2770",
  "limit": 20
}
```

### POST /donanimhaber/v1/sections — 1 credit
The DonanımHaber Forum section directory — every public section with its numeric id, name and URL, optionally filtered by name. Use it to resolve a topic area ('SEO', 'yazılım', 'ekran kartı') to the `section` id that `search` and `section` take.

**Parameters:**
- `query` (string, optional) — Filter sections whose name or slug contains this text (accent/case-insensitive). Omit for the full directory.
- `limit` (integer, optional, default 120) — How many sections to return (1–800, default 120).

**Returns:** sections[]{id, name, slug, description, url}, returned, total_available

**Example request body:**
```json
{
  "query": "seo",
  "limit": 20
}
```

## More
- Try it live, no code: https://reefapi.com/playground?engine=donanimhaber
- Human docs page: https://reefapi.com/docs/donanimhaber
- Every ReefAPI API in one file (for your AI): https://reefapi.com/llms-full.txt
