structured-extraction

โดย firecrawl

แยกข้อมูลที่มีโครงสร้างตาม JSON schema จากเว็บไซต์ รองรับ schema ที่ซับซ้อนแบบซ้อนกัน อาร์เรย์ การแบ่งหน้า และการตรวจสอบความถูกต้อง ส่งออกผ่าน...

npx skills add https://github.com/firecrawl/web-agent --skill structured-extraction

Structured Extraction

Use this skill when extracting data that must match a specific JSON schema.

Strategy by task type

Simple query (single fact or small object)

  1. Search for relevant results.
  2. Scrape promising results with a targeted query.
  3. Build the result object and call formatOutput immediately.

Single target research (one entity, multiple fields)

  1. Search for relevant URLs.
  2. Scrape to extract data — stay in the orchestrator unless you have many independent sources (roughly 5+) where parallel workers clearly help.
  3. Compile findings and call formatOutput.

List of items (array in schema)

  1. Search/scrape to get the list of items.
  2. Are all requested details included in the list?
    • Yes: Build the result and call formatOutput.
    • No: If there are many items (roughly 5+), use spawnAgents so each worker gets the item and fields; otherwise fetch details sequentially in the orchestrator.
  3. Aggregate all results and call formatOutput.

All items from a website

  1. Check sitemaps (sitemap.xml, robots.txt) for an easy route to all pages.
  2. Scrape the entry page. Determine: pagination? Categories? Subcategories?
  3. For pagination, use interact to click through every page.
  4. For categories, scrape each category — use spawnAgents only when many independent categories warrant parallel fan-out.
  5. Aggregate and call formatOutput.

Scraping for structured data

  • PREFER scrape with a targeted query over raw page dumps. It keeps context lean.
  • When scraping lists, ALWAYS ask about pagination in your query: "How many total results? Is there a next page?"
  • For many independent URLs (roughly 5+), spawnAgents can help — each worker gets specific URLs and fields. Fewer URLs: handle in the orchestrator.
  • If a scrape returns a 404 or bot-check, do NOT retry. Move on to alternative sources.

Building the output

  • Match the schema EXACTLY. Every required field must be present.
  • Use null for missing fields — never omit keys.
  • Arrays must be arrays even for single items.
  • Numbers must be actual numbers, not strings (10.99 not "$10.99").
  • Use bashExec with jq to merge data from multiple sources:
    jq -s '.[0] * .[1]' /data/part1.json /data/part2.json > /data/merged.json
    

Validation before output

Before calling formatOutput, verify:

  1. All required fields from the schema are present.
  2. Types match (numbers are numbers, arrays are arrays).
  3. No duplicate entries in arrays.
  4. Source URLs are included where the schema has citation fields.

CRITICAL: Always call formatOutput

When you have gathered ALL data, call formatOutput with format "json" and the structured data. Do NOT stream data inline as markdown tables or JSON code blocks. Do NOT skip formatOutput — downstream systems depend on the structured output.

Skills เพิ่มเติมจาก firecrawl

oracle
firecrawl
แนวทางปฏิบัติที่ดีที่สุดสำหรับการใช้ oracle CLI (การรวม prompt และไฟล์, เอ็นจิน, เซสชัน, และรูปแบบการแนบไฟล์)
official
pinecone
firecrawl
ฐานข้อมูลเวกเตอร์ที่จัดการแล้วสำหรับแอปพลิเคชัน AI ในระบบผลิต จัดการเต็มรูปแบบ ปรับขนาดอัตโนมัติ พร้อมการค้นหาแบบไฮบริด (dense + sparse) การกรองเมตาดาต้า และเนมสเปซ…
official
sentence-transformers
firecrawl
เฟรมเวิร์กสำหรับการฝังประโยค ข้อความ และรูปภาพที่ทันสมัยที่สุด มีโมเดลที่ผ่านการฝึกอบรมล่วงหน้ามากกว่า 5000 โมเดลสำหรับความคล้ายคลึงทางความหมาย การจัดกลุ่ม และการดึงข้อมูล
official
wp-playground
firecrawl
ใช้สำหรับเวิร์กโฟลว์ของ WordPress Playground: อินสแตนซ์ WP แบบใช้แล้วทิ้งที่รวดเร็วในเบราว์เซอร์หรือในเครื่องผ่าน @wp-playground/cli (server, run-blueprint, build-snapshot),…
official
wp-plugin-development
firecrawl
ใช้เมื่อพัฒนา WordPress plugins: สถาปัตยกรรมและ hooks, การเปิดใช้งาน/ปิดใช้งาน/ถอนการติดตั้ง, UI สำหรับผู้ดูแลระบบและ Settings API, การจัดเก็บข้อมูล, cron/งาน, ความปลอดภัย…
official
wp-project-triage
firecrawl
ใช้เมื่อคุณต้องการตรวจสอบที่เก็บ WordPress (ปลั๊กอิน/ธีม/ธีมบล็อก/WP core/Gutenberg/ทั้งไซต์) อย่างแน่นอน รวมถึงเครื่องมือ/การทดสอบ/เวอร์ชัน…
official
wp-rest-api
firecrawl
ใช้เมื่อสร้าง ขยาย หรือดีบักเอนด์พอยต์/เส้นทางของ WordPress REST API: register_rest_route, คลาส WP_REST_Controller/controller, schema/argument…
official
wp-wpcli-and-ops
firecrawl
ใช้เมื่อทำงานกับ WP-CLI (wp) สำหรับการดำเนินการ WordPress: การค้นหาและแทนที่อย่างปลอดภัย, การส่งออก/นำเข้าฐานข้อมูล, การจัดการปลั๊กอิน/ธีม/ผู้ใช้/เนื้อหา, cron, การล้างแคช,…
official