Two lightweight endpoints: one for fetching and cleaning article content, and one for extracting only the featured image (OGImage). By design, JSON is protected, while RAW / HTML preview remain open for quick inspection.
Fetch article HTML, extract meta, clean content, and return JSON / RAW source / HTML preview.
mode is
missing.
All params are passed as query string.
| Param | Required | Values / Default | Notes |
|---|---|---|---|
url |
required | http/https URL | Target article URL. |
mode |
optional |
json | raw | htmlDefault: json |
json returns data (requires auth). raw shows upstream HTML source. html renders a preview UI. |
thumb |
optional |
1 | true | yes |
add
|
When enabled, prepend OGImage as thumbnail if first image is not identical. |
Requests
// JSON (default; requires auth)
GET /api/fetch-content?url=https://example.com/post
// JSON (explicit; requires auth)
GET /api/fetch-content?mode=json&url=https://example.com/post
// RAW (public)
GET /api/fetch-content?mode=raw&url=https://example.com/post
// HTML preview (public)
GET /api/fetch-content?mode=html&url=https://example.com/post
// HTML preview + thumbnail prepend
GET /api/fetch-content?mode=html&url=https://example.com/post&thumb=1
| Param | Required | Values / Default | Notes |
|---|---|---|---|
url |
required | http/https URL | Target article URL. |
format |
optional |
json | textDefault: json |
text returns only the OGImage URL as plain text. |
redirect |
optional |
1 | true | yes
|
Return HTTP 302 to the OGImage URL (handy to open the image directly). |
Requests
// JSON (default)
GET /api/fetch-image?url=https://example.com/post
// Text-only OGImage URL
GET /api/fetch-image?url=https://example.com/post&format=text
// Redirect to OGImage
GET /api/fetch-image?url=https://example.com/post&redirect=1