{
  "name": "Yahoo Finance Market Data & Fundamentals Scraper (long runs)",
  "nodes": [
    {
      "id": "8072d52e-b396-4157-a743-7ccaaf6bfe83",
      "name": "Run by hand",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {}
    },
    {
      "id": "b52b5476-125b-467d-adbd-80fcb7cd3f33",
      "name": "Every day",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "notes": "Activate the workflow to run on this schedule."
    },
    {
      "id": "ce654d42-de7f-4478-a1e2-9d55116a49db",
      "name": "Start Apify run",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        260,
        100
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/actors/nimbryxo-studio~yahoo-finance-market-data-and-fundamentals-scraper/runs?waitForFinish=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"mode\": \"tickers\",\n  \"tickers\": [\n    \"AAPL\"\n  ],\n  \"searchQuery\": \"Apple\",\n  \"maxSearchResults\": 10,\n  \"screenerId\": \"day_gainers\",\n  \"screenerSort\": \"intradaymarketcap\",\n  \"region\": \"US\",\n  \"language\": \"en-US\",\n  \"range\": \"5d\",\n  \"interval\": \"1d\",\n  \"includePrePost\": false,\n  \"includeHistory\": false,\n  \"includeDividends\": false,\n  \"includeSplits\": false,\n  \"includeNews\": false,\n  \"maxNews\": 10,\n  \"includeFinancials\": false,\n  \"includeQuarterlyFinancials\": false,\n  \"includeHolders\": false,\n  \"includeInsiders\": false,\n  \"includeOptions\": false,\n  \"optionExpirations\": 1,\n  \"maxOptionContracts\": 50,\n  \"optionContractType\": \"both\",\n  \"includeRecommendations\": false,\n  \"includeUpgradesDowngrades\": false,\n  \"includeAnalystPriceTargets\": false,\n  \"includeEarningsHistory\": false,\n  \"includeEarningsEstimates\": false,\n  \"includeEarningsCalendar\": false,\n  \"includeFundData\": false,\n  \"includeSecFilings\": false,\n  \"includeInsights\": false,\n  \"includeRelatedSymbols\": false,\n  \"maxResults\": 1,\n  \"concurrency\": 1\n}",
        "options": {
          "timeout": 90000
        }
      },
      "notes": "Actor: nimbryxo-studio/yahoo-finance-market-data-and-fundamentals-scraper. Starts the run and waits up to 60 s for it. Header Auth credential: name Authorization, value Bearer + your Apify token."
    },
    {
      "id": "bdc242de-0f5d-48d1-a591-ad2cf22dc293",
      "name": "Run finished?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        520,
        100
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "3b583886-1542-48b7-a822-4a3642a6b8f3",
              "leftValue": "={{ ['SUCCEEDED', 'FAILED', 'ABORTED', 'TIMED-OUT'].includes($json.data.status) }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "b2ecd332-249b-4c44-a277-04e569dd8797",
      "name": "Check the run again",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        520,
        320
      ],
      "parameters": {
        "method": "GET",
        "url": "=https://api.apify.com/v2/actor-runs/{{ $json.data.id }}?waitForFinish=60",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 90000
        }
      },
      "notes": "Waits up to 60 s per check, then loops back."
    },
    {
      "id": "0afcdbfe-7a80-4e2b-a515-25522a0ab41b",
      "name": "Run succeeded?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        780,
        0
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "1d45d9b6-9ff3-4ea5-ae09-7180c21afed3",
              "leftValue": "={{ $json.data.status === 'SUCCEEDED' }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "1c052a42-9e15-4ab0-aed2-6d9ddd7babf7",
      "name": "Get the results",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1040,
        -100
      ],
      "parameters": {
        "method": "GET",
        "url": "=https://api.apify.com/v2/datasets/{{ $json.data.defaultDatasetId }}/items?clean=true",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 120000
        }
      },
      "notes": "Each record of the run's dataset becomes one n8n item. Connect your destination after this node."
    },
    {
      "id": "c4df37b6-bd61-4081-ae21-b8406a9f1a53",
      "name": "Run did not succeed",
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        1040,
        100
      ],
      "parameters": {
        "errorMessage": "={{ 'Apify run ' + $json.data.id + ' ended with status ' + $json.data.status }}"
      }
    },
    {
      "id": "d07e62e6-1913-4b91-ab0b-30d43b114a2b",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -400
      ],
      "parameters": {
        "content": "## Yahoo Finance Market Data & Fundamentals Scraper: long runs\n\nSource: [nimbryxo-studio/yahoo-finance-market-data-and-fundamentals-scraper](https://apify.com/nimbryxo-studio/yahoo-finance-market-data-and-fundamentals-scraper) on Apify.\n\nFor runs that need more than 5 minutes (the synchronous endpoint answers HTTP 408 after 300 s).\n1. Select the same Header Auth credential (name `Authorization`, value `Bearer YOUR_APIFY_TOKEN`) in the three HTTP Request nodes.\n2. Edit the JSON body of **Start Apify run** to change the input.\n3. Connect your destination after **Get the results**.\n\nGenerated by recipeforagents.com. Validated, not executed: runs are billed to your Apify account.",
        "height": 360,
        "width": 500,
        "color": 6
      }
    }
  ],
  "connections": {
    "Run by hand": {
      "main": [
        [
          {
            "node": "Start Apify run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every day": {
      "main": [
        [
          {
            "node": "Start Apify run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Apify run": {
      "main": [
        [
          {
            "node": "Run finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run finished?": {
      "main": [
        [
          {
            "node": "Run succeeded?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check the run again",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check the run again": {
      "main": [
        [
          {
            "node": "Run finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run succeeded?": {
      "main": [
        [
          {
            "node": "Get the results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run did not succeed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}
