WebExtrator インテリジェント抽出 API 統合ガイド

POST https://api.acedata.cloud/webextrator/extract

WebExtrator インテリジェント抽出 API は、URL を型付きの構造化結果に変換します。記事、商品、 レシピ、動画、ディスカッション、求人などに対応し、クリーンアップされた Markdown とプレーンテキストも付属します。生の HTML ではなく「クリーンな構造化データ」が必要な場合に使用するインターフェースです。

申請手順

WebExtrator サービスページを使用するには、まず Ace Data Cloud コンソール にアクセスして API Token を取得し、控えておきます。

まだログインまたは登録していない場合は、登録とログインを促すログインページに自動的にリダイレクトされ、完了後に現在のページへ自動的に戻ります。

汎用アプリケーションの API Key は、アカウントで利用可能になっているサービスに使用できます。専用アプリケーションの Key は、そのアプリケーションのサービス範囲に従って使用します。Key の権限、有効期限、上限を確認し、アプリケーションの残高が今回のリクエストの支払いに十分であることを確認してください。利用可能な試用クレジットはアカウントに表示される内容に従い、残高が不足している場合は「チャージ」ボタンをクリックしてください。

📘 完全なドキュメント:WebExtrator サービスページ →

認証

Authorization: Bearer YOUR_API_KEY
Content-Type:  application/json

リクエストパラメータ

Extract は Render API のすべてのパラメータ (url、user_agent、timeout、wait_until、delay、wait_for_selector、 block_resources、headers、cookies、callback_url、bypass_cache、 cache_ttl_seconds、async)に加え、Extract 専用の 2 つのフィールドを受け付けます。

フィールド 型 必須 デフォルト 説明
expected_type enum ❌ 自動判定 ページタイプのヒント:product / article / general。期待する結果のタイプを指定します。
enable_llm boolean ❌ false schema.org が見つからない場合に LLM による抽出を許可します。Amazon / HN / Greenhouse のような JSON-LD のないページでは、型付き結果を取得するために有効にする必要があります。

同期レスポンス

{
  "success": true,
  "task_id": "550e8400-e29b-41d4-a716-446655440000",
  "trace_id": "550e8400-e29b-41d4-a716-446655440001",
  "started_at": 1777717800.123,
  "finished_at": 1777717802.535,
  "elapsed": 2.412,
  "data": {
    "kind": "extract",
    "url": "https://en.wikipedia.org/wiki/Diffbot",
    "finalUrl": "https://en.wikipedia.org/wiki/Diffbot",
    "contentType": "article",
    "title": "Diffbot",
    "description": "American machine learning and knowledge management company",
    "byline": "Contributors to Wikimedia projects",
    "language": "en",
    "siteName": "Wikipedia",
    "publishedAt": "2007-08-08T05:47:27Z",
    "images": ["https://en.wikipedia.org/static/images/icons/enwiki-25.svg"],
    "links": ["https://en.wikipedia.org/wiki/Machine_learning"],
    "markdown": "# Diffbot\n\nDiffbot is a developer of machine learning ...",
    "text": "Diffbot is a developer of machine learning algorithms ...",
    "structured": {
      "schemaOrg": { "primary": { /* 类型化实体 */ }, "breadcrumbs": [], "all": [] },
      "openGraph": { "title": "...", "description": "...", "image": "...", "type": "..." },
      "jsonLd": [ /* 原始 JSON-LD */ ]
    },
    "rawSignals": {
      "hasJsonLd": true,
      "title": "Diffbot - Wikipedia",
      "metaDescription": null,
      "pageStatus": 200,
      "textLength": 11473
    },
    "elapsedMs": 2412
  }
}

トップレベルフィールド

フィールド 型 説明
kind string 固定値 "extract"。
url string 送信した URL。
finalUrl string リダイレクト後の最終 URL。
contentType enum ページタイプ:product / article / general。
title string ページタイトル。
description string? ページの説明または要約。
byline string? 著者、チャンネルまたは会社。
language string? <html lang>。
siteName string? og:site_name。
publishedAt string? 公開日時。ISO 8601 形式を使用します。
images string[] 最大 50 件の <img src>。絶対 URL に解決され、重複が排除され、data: URI は破棄されます。
links string[] 最大 100 件の外部リンク。フラグメント / javascript: / mailto: / tel: は除外されます。
markdown string ページの Markdown コンテンツ。
text string ページのプレーンテキスト。
structured object 完全な構造化結果。以下を参照してください。
rawSignals object デバッグ用の診断情報。
cached boolean? キャッシュにヒットした場合は true。
cacheStoredAt number? キャッシュエントリが最初に書き込まれた Unix ミリ秒タイムスタンプ。

data.structured サブフィールド

サブフィールド 出現するタイミング 説明
schemaOrg 常時 { primary, breadcrumbs, all }。primary は最も優先度の高い型付きエンティティです。見つからない場合は null です。
openGraph 常時 { title, description, image, type }。<meta property="og:*"> に由来します。
jsonLd 常時 すべての <script type="application/ld+json"> ブロックの生の JSON 配列。
llm LLM が実行され、成功した場合 { kind, data, model, promptCharCount }。型付き結果。
llmError LLM が実行され、失敗した場合 { kind, error, model }。リクエストは他の抽出済みフィールドを引き続き返すことができます。
amazon URL が amazon.* の場合 旧版の Amazon 拡張結果。新しい統合では型付き結果を使用してください。

schema.org の結果タイプ

structured.schemaOrg.primary は以下の結果タイプをサポートします:

schema.org タイプ kind 出力フィールド
Product product name, sku, gtin, model, color, brand, url, images, offer.{price,currency,availability,condition,seller}, rating.{value,count}, reviews[], properties[]
Recipe recipe name, description, image, datePublished, author, cookTime, prepTime, totalTime, recipeYield, ingredients[], instructions[], nutrition, rating, keywords, recipeCategory, recipeCuisine
VideoObject video name, description, thumbnailUrl, uploadDate, duration, embedUrl, contentUrl, channel, interactionCount
JobPosting job title, description, datePosted, validThrough, hiringOrganization, jobLocation, baseSalary, employmentType
Event(*Event を含む) event name, description, startDate, endDate, location.{name,address}, organizer, offer.{url,price,currency}
Article / NewsArticle / BlogPosting / ScholarlyArticle / TechArticle / Report / *NewsArticle article subtype, headline, description, datePublished, dateModified, author, publisher, image[], url, sameAs[]
FAQPage faq questions[{question, answer}]
BreadcrumbList (sibling に配置) 常に structured.schemaOrg.breadcrumbs[] に出力され、primary にはなりません。

LLM の結果タイプ

enable_llm: true で、ページに利用可能な schema.org 構造化データがない場合、以下のタイプの抽出結果を返すことができます:

Kind 必須フィールド オプションフィールド
article headline description, byline, publishedAt, language, topics[], sections[{heading,summary}]
product name description, brand, sku, price, currency, availability, rating.{value,count}, bullets[], specifications[{name,value}]
discussion title author, postedAt, points, commentCount, body, url
recipe name description, author, cookTime, prepTime, totalTime, recipeYield, ingredients[], instructions[], nutrition, rating, keywords[]
video name description, channel, uploadDate, duration, viewCount, likeCount, thumbnailUrl, transcript
job title description, company, location, remote, employmentType, datePosted, validThrough, salaryMin, salaryMax, salaryCurrency, salaryPeriod, responsibilities[], qualifications[]

キャッシュ

同じ URL、リクエストパラメータ、cookies、headers ではキャッシュ結果を再利用できます。async、bypass_cache、cache_ttl_seconds は実行方法とキャッシュ動作の制御に使用します。

フィールド 効果
bypass_cache: true 読み取りをスキップします。今回の結果は引き続きキャッシュに書き戻され、次回の同じリクエストでヒットします。
cache_ttl_seconds: 0 今回のレスポンスはキャッシュされません。
cache_ttl_seconds: N このエントリの TTL をカスタマイズします(デフォルトは 3600 秒)。

キャッシュにヒットしたレスポンスには、data.cached: true と data.cacheStoredAt: <unix-ms> が付与されます。

非同期モードとコールバック

async: true を設定すると非同期モードになります(callback_url を指定した場合も自動的に移行します)。プラットフォームは直ちに返します(HTTP 200):

{
  "success": true,
  "task_id": "550e8400-...",
  "trace_id": "6ba7b810-...",
  "started_at": 1777717800.123
}

タスクの完了時に、完全な envelope をあなたの callback_url に POST します(設定されている場合)。後から /webextrator/tasks を通じて自分で照会することもできます。

例

1. Wikipedia の記事(schema.org にヒット、LLM は不要)

curl -X POST https://api.acedata.cloud/webextrator/extract \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://en.wikipedia.org/wiki/Diffbot",
    "expected_type": "article"
  }'

data.structured.schemaOrg.primary の主要フィールド:

{
  "kind": "article",
  "subtype": "Article",
  "headline": "American machine learning and knowledge management company",
  "datePublished": "2007-08-08T05:47:27Z",
  "dateModified": "2025-07-10T20:42:45Z",
  "author": { "name": "Contributors to Wikimedia projects", "type": "Organization" },
  "publisher": { "name": "Wikimedia Foundation, Inc." }
}

2. BestBuy の商品ページ(schema.org にヒット)

curl -X POST https://api.acedata.cloud/webextrator/extract \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.bestbuy.com/product/apple-airpods-pro-2nd-generation-white/JJ8ZH6TPSW",
    "expected_type": "product"
  }'

schema.org の抽出結果:

{
  "kind": "product",
  "name": "Apple - Refurbished Excellent - AirPods Pro (2nd generation) - White",
  "sku": "10845412",
  "model": "MQD83AM/A",
  "color": "White",
  "brand": "Apple",
  "offer": { "price": 159.99, "currency": "USD", "availability": "https://schema.org/InStock", "seller": "Best Buy" },
  "rating": { "value": 4.4, "count": 8 }
}

3. AllRecipes のレシピページ(栄養情報と手順を含む)

curl -X POST https://api.acedata.cloud/webextrator/extract \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.allrecipes.com/recipe/16354/easy-meatloaf/"
  }'

schema.org の抽出結果:

{
  "kind": "recipe",
  "name": "Easy Meatloaf",
  "cookTime": "PT60M",
  "totalTime": "PT75M",
  "recipeYield": "8 / 1 (9x5-inch) meatloaf",
  "ingredients": ["1 1/2 pounds ground beef", "..."],
  "instructions": [{ "text": "Preheat oven to 350°F ..." }, "..."],
  "rating": { "value": 4.7, "count": 9348 }
}

4. HN のディスカッションページ(JSON-LD なし —— LLM の有効化が必要)

curl -X POST https://api.acedata.cloud/webextrator/extract \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://news.ycombinator.com/item?id=37000000",
    "enable_llm": true
  }'

data.structured.llm.data:

{
  "kind": "discussion",
  "title": "Show HN: A new way to extract web pages",
  "author": "alice",
  "points": 173,
  "commentCount": 42,
  "body": "Hi HN, we built a self-hosted alternative to Diffbot's Analyze API ..."
}

トップレベルのフィールドにも値が補完されます:byline = "alice"、publishedAt = "..."。

5. Amazon の商品ページ(Amazon には JSON-LD なし —— LLM の有効化が必要)

curl -X POST https://api.acedata.cloud/webextrator/extract \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.amazon.com/dp/B0BSHF7WHW",
    "expected_type": "product",
    "enable_llm": true
  }'

data.structured.llm.data(型付き product):

{
  "kind": "product",
  "name": "Apple 2023 MacBook Pro M2 Pro 14-inch",
  "brand": "Apple",
  "price": 1799,
  "currency": "USD",
  "bullets": ["Apple M2 Pro chip with 10-core CPU", "..."],
  "specifications": [{ "name": "Display size", "value": "14.2 inches" }, "..."]
}

Python (requests)

import os, requests

API_KEY = os.environ["ACEDATA_API_KEY"]

resp = requests.post(
    "https://api.acedata.cloud/webextrator/extract",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json",
    },
    json={
        "url": "https://en.wikipedia.org/wiki/Diffbot",
        "expected_type": "article",
    },
    timeout=120,
)
resp.raise_for_status()
data = resp.json()["data"]

primary = (data.get("structured") or {}).get("schemaOrg", {}).get("primary")
print("contentType:", data["contentType"])
print("title:      ", data["title"])
print("byline:     ", data.get("byline"))
print("publishedAt:", data.get("publishedAt"))
if primary and primary["kind"] == "article":
    print("headline:    ", primary["headline"])
    print("dateModified:", primary.get("dateModified"))

Node.js (fetch)

const apiKey = process.env.ACEDATA_API_KEY;

const res = await fetch('https://api.acedata.cloud/webextrator/extract', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${apiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://www.allrecipes.com/recipe/16354/easy-meatloaf/',
  }),
});
const { data } = await res.json();
const recipe = data?.structured?.schemaOrg?.primary;
console.log(recipe.name, recipe.cookTime, recipe.ingredients.length, '种配料');

ヒントと注意点

  • ページの種類を指定する必要がある場合は expected_type を渡します。 例えば、記事ページには article、商品ページには product を使用します。
  • enable_llm: true は schema.org がヒットしたページでは無料です。 LLM は schema.org に primary がない場合にのみ呼び出されるため、デフォルトで有効にしておいても安全です。
  • デバッグ時にはまず rawSignals.hasJsonLd を確認します。 true なのに structured.schemaOrg.primary が null の場合、ページの @type は現在サポートされていませんので、フィードバックをお寄せください。
  • structured.llmError は情報提供用です。 リクエストは、抽出済みの他のフィールドを正常に返すことができます。 llmError.error を確認して原因(タイムアウト、JSON 解析の失敗、構造検証の失敗)を特定します。
  • 記事以外のページの links[] は関連性による並べ替えを行いません。 「上限 100 件+無効なプロトコルのフィルタリング」 によるクレンジングのみを可能な限り行います。
  • キャッシュヒット時も課金されます。