from firecrawl import FirecrawlApp
app = FirecrawlApp(api_key="fc-YOUR_API_KEY")
# ウェブサイトからデータを抽出:
extract_result = app.extract(['firecrawl.dev'],
prompt="このフォーラムスレッドから全ユーザーのコメントを抽出してください。",
schema={
"type": "object",
"properties": {
"comments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"author": {"type": "string"},
"comment_text": {"type": "string"}
},
"required": ["author", "comment_text"]
}
}
},
"required": ["comments"]
},
agent={
"model": "FIRE-1"
}
)
print(extract_result)