Skip to content

Instantly share code, notes, and snippets.

@tboydar
Last active August 26, 2025 08:22
Show Gist options
  • Save tboydar/6ef81caf9d796c4ea83e03f5d969407a to your computer and use it in GitHub Desktop.
Save tboydar/6ef81caf9d796c4ea83e03f5d969407a to your computer and use it in GitHub Desktop.
n8n firecrawl/v2/extract

n8n firecrawl/v2/extract

{
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -1160,
        220
      ],
      "id": "61e458e6-9d0f-4753-bbf9-27245df4c57b",
      "name": "When clicking 'Execute workflow'"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.firecrawl.dev/v2/extract",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"urls\": [\"https://www.boc.cn/sourcedb/whpj/index.html\"],\n  \"prompt\": \"等待表格載入完成後再抽取;只抽取包含表頭「货币名称|现汇买入价|现钞买入价|现汇卖出价|现钞卖出价|中行折算价|发布日期|发布时间」的匯率表格,輸出 JSON 陣列 rates。每筆鍵名固定:currency_name, spot_buy, cash_buy, spot_sell, cash_sell, reference_rate, publish_date, publish_time。忽略頁首、側欄、底部與聲明,不要輸出文字敘述,只輸出 JSON。\",\n  \"scrapeOptions\": {\n    \"onlyMainContent\": true,\n    \"waitFor\": 30000,\n    \"timeout\": 200000\n  }\n}",
        "options": {}
      },
      "id": "b3e08c0d-16a4-4bd3-95a7-510238b6ef71",
      "name": "BOC Exchange Rates Extract",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -920,
        220
      ],
      "retryOnFail": true,
      "typeVersion": 4.2,
      "credentials": {
        "httpHeaderAuth": {
          "id": "FclQuBtkQHUTwqll",
          "name": "Header Auth account fc"
        }
      }
    },
    {
      "parameters": {
        "url": "=https://api.firecrawl.dev/v2/extract/{{ $json.id }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "id": "7b4a5108-57e1-4468-bc29-54ac0b1f9a46",
      "name": "Get Extract Results",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -460,
        220
      ],
      "retryOnFail": true,
      "typeVersion": 4.2,
      "credentials": {
        "httpHeaderAuth": {
          "id": "FclQuBtkQHUTwqll",
          "name": "Header Auth account fc"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 1
          },
          "conditions": [
            {
              "id": "c1a2b3c4-d5e6-f7a8-b9c0-d1e2f3a4b5c6",
              "leftValue": "={{ $json.status }}",
              "rightValue": "completed",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "21d845a4-2126-4ad8-b9b9-ecebb6b8a8a3",
      "name": "Check If Completed",
      "type": "n8n-nodes-base.if",
      "position": [
        -220,
        220
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "amount": 15
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -700,
        220
      ],
      "id": "30f642bf-ef7c-44d9-900b-9c881943d127",
      "name": "Wait",
      "webhookId": "2563cdb3-eb81-4280-92c3-63b822739c73"
    }
  ],
  "connections": {
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "BOC Exchange Rates Extract",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BOC Exchange Rates Extract": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Extract Results": {
      "main": [
        [
          {
            "node": "Check If Completed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get Extract Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "dd0e6f7c32fa78d2d7d95a565582a485000ae520f830c01e46a3a71dff4ef6b4"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment