Hoppa till huvudinnehåll
POST https://api.acedata.cloud/webextrator/extract Utför innehållsextraktion baserat på /webextrator/render. Förutom alla parametrar från render-gränssnittet stöds även:
FältTypObligatoriskStandardBeskrivning
expected_typestringmarkdownFörväntad extraktionsprodukt: markdown / article / text / links / structured
enable_llmbooleanfalseAktivera LLM efterbehandling (passar för article / structured)
instructionstring-LLM-extraktionsinstruktion, t.ex. “extrahera produktnamn, pris, specifikationer”

Synkront svar

{
  "success": true,
  "task_id": "550e8400-...",
  "trace_id": "550e8400-...",
  "started_at": "2026-05-02T10:30:00.123Z",
  "finished_at": "2026-05-02T10:30:08.789Z",
  "elapsed": 8.666,
  "data": {
    "kind": "extract",
    "expected_type": "article",
    "url": "https://example.com/post/1",
    "title": "Exempelartikel",
    "author": "Zhang San",
    "published_at": "2026-05-01",
    "content": "# Exempelartikel\n\nBrödtext ...",
    "summary": "Denna artikel introducerar ..."
  }
}
Asynkront läge, felkoder och prissättningsregler är helt samma som för /webextrator/render.

Exempel: Extrahera artikelinnehåll (med LLM aktiverat)

curl -X POST https://api.acedata.cloud/webextrator/extract \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/news/1",
    "expected_type": "article",
    "enable_llm": true
  }'

Exempel: Asynkront + anpassad strukturerad extraktion

curl -X POST https://api.acedata.cloud/webextrator/extract \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://shop.example.com/item/123",
    "expected_type": "structured",
    "enable_llm": true,
    "instruction": "extrahera produktnamn, pris, lagerstatus, 3 huvudbild-URL:er",
    "callback_url": "https://your-domain.com/wbx-callback"
  }'