Craw Server

API Docs

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.

/api/fetch-content JSON requires auth
/api/fetch-content RAW/HTML are public
/api/fetch-image returns OGImage only
Tip Use format=text or redirect=1 when you only need the image.

Endpoints

GET

Fetch article HTML, extract meta, clean content, and return JSON / RAW source / HTML preview.

Auth json only Public raw/html
GET

Extract featuredImage (OGImage) only. Output JSON, text-only URL, or redirect.

Fast OGImage Modes json/text/redirect

Quick rules

  • Default mode is json when mode is missing.
  • JSON returns data for automation; HTML is for human preview; RAW shows upstream source.
  • fetch-image is the fastest way to get OGImage without fetching/cleaning full content.

All params are passed as query string.

/api/fetch-content

Parameters
Param Required Values / Default Notes
url required http/https URL Target article URL.
mode optional json | raw | html
Default: 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.
Examples

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

/api/fetch-image

Parameters
Param Required Values / Default Notes
url required http/https URL Target article URL.
format optional json | text
Default: 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).
Examples

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