WebExtrator 지능형 추출 API 연동 가이드

POST https://api.yxai-tech.top/webextrator/extract

WebExtrator 지능형 추출 API는 하나의 URL을 문서, 상품, 레시피, 동영상, 토론, 채용 등의 타입이 지정된 구조화 결과로 변환하고, 정리된 Markdown과 일반 텍스트도 함께 제공합니다. 원시 HTML이 아닌 "깔끔한 구조화 데이터"를 원할 때 사용하는 인터페이스입니다.

신청 절차

WebExtrator 서비스 페이지를 사용하려면 먼저 AI 聚合 콘솔에서 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 전용 필드를 추가로 받습니다.

필드 타입 필수 기본값 설명
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.yxai-tech.top/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.yxai-tech.top/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.yxai-tech.top/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.yxai-tech.top/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.yxai-tech.top/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.yxai-tech.top/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.yxai-tech.top/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개 + 유효하지 않은 프로토콜 필터링"에 따라 가능한 범위에서만 정리합니다.
  • 캐시에 적중한 경우에도 요금이 부과됩니다.