# Article Extraction API — extract a clean, readable article from any news or blog URL, plus news search

> Extract a clean article from any news or blog URL: returns title, full text, author, publication date, top image, all images, language, site name, and canonical URL. Automatically follows Google News and Bing News redirect links to the original publisher page.
> ReefAPI engine `news-article` · 2 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/news-article/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 /news-article/v1/extract — 2 credits
Extract a clean article from any news or blog URL: returns title, full text, author, publication date, top image, all images, language, site name, and canonical URL. Automatically follows Google News and Bing News redirect links to the original publisher page.

**Parameters:**
- `url` (string, required) — Article URL to extract. Google-News / Bing-News redirect URLs are auto-resolved to the real publisher URL first.
- `render` (enum, optional, default "auto") — Browser-render policy. NOTE: this image ships without a browser, so render is a graceful no-op (meta.rendered=false); recon proved it recovers ~0. [one of: auto, never, force]
- `include_markdown` (boolean, optional, default true) — Also return the article body as Markdown (default true).

**Returns:** article{} — title, text, author, date, top_image, images[], language, site_name, canonical (+ markdown if include_markdown); meta.rendered/resolved_from

**Example request body:**
```json
{
  "url": "https://en.wikipedia.org/wiki/Web_scraping"
}
```

### POST /news-article/v1/news_search — 1 credit
recent-news list from source=google|bing|gdelt|rss|all (unified schema title/url/source/published/lang); resolve=true → Google-News URLs become real publisher URLs

**Parameters:**
- `query` (string, optional) — Search keywords. Required for source=google|bing|gdelt|all (not for source=rss).
- `source` (enum, optional, default "google") — News backend. Unknown values are rejected. source=rss requires rss_url. [one of: google, bing, gdelt, rss, all]
- `lang` (string, optional, default "en") — UI/content language hint (e.g. en, tr, de). Default en.
- `country` (string, optional, default "US") — Edition country, ISO 3166 alpha-2 (e.g. US, GB, TR). Default US.
- `limit` (integer, optional, default 20) — Max results (1-100, default 20); clamped.
- `rss_url` (string, optional) — Custom RSS/Atom feed URL — required when source=rss.
- `resolve` (boolean, optional, default false) — If true, resolve Google-News result URLs to the real publisher URL (extra requests).

**Returns:** results[] (title, url, source, published, lang), count; meta.sources/resolved/errors/stop_reason

**Example request body:**
```json
{
  "query": "artificial intelligence",
  "limit": 10
}
```

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