{
  "name": "SocialCrawl: How people reacted to a brand and its competitors last month",
  "nodes": [
    {
      "id": "node-1",
      "position": [
        260,
        0
      ],
      "name": "Run recipe",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "parameters": {}
    },
    {
      "id": "node-2",
      "position": [
        520,
        0
      ],
      "name": "reactions",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "parameters": {
        "method": "GET",
        "url": "https://www.socialcrawl.dev/v1/prism/discover?brands=patagonia%2Carcteryx%2Ccolumbia&period=last_month&exclude_terms=argentina%2Cchile&max_credits=150",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 300000
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "SocialCrawl API key"
        }
      },
      "executeOnce": true,
      "retryOnFail": true,
      "maxTries": 4,
      "waitBetweenTries": 2000
    },
    {
      "id": "node-3",
      "position": [
        780,
        0
      ],
      "name": "reactions: finished?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "reactions-finished",
              "leftValue": "={{ !['queued','running','pending'].includes($json.data.run.status) }}",
              "rightValue": true,
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "node-4",
      "position": [
        1040,
        0
      ],
      "name": "reactions: wait",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "parameters": {
        "resume": "timeInterval",
        "amount": 5,
        "unit": "seconds"
      }
    },
    {
      "id": "node-5",
      "position": [
        1300,
        0
      ],
      "name": "reactions: follow the run",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "parameters": {
        "method": "GET",
        "url": "={{ $json.data.next.status_url }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {
          "timeout": 300000
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "SocialCrawl API key"
        }
      },
      "executeOnce": true,
      "retryOnFail": true,
      "maxTries": 4,
      "waitBetweenTries": 2000
    },
    {
      "id": "node-6",
      "position": [
        1560,
        0
      ],
      "name": "reactions: result",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "parameters": {
        "jsCode": "// The finished answer.\nreturn $input.all();"
      }
    },
    {
      "id": "note",
      "name": "How this recipe works",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -460
      ],
      "parameters": {
        "content": "## How people reacted to a brand and its competitors last month\n\nPrice for a brand and its competitors, one month: at most 150 credits (max_credits caps the whole run; each search bills at its platform's price only when it returns rows, so it settles 0-150; nothing beyond the judging bound is held up front).\n\nMeasured on 18/11/2026: 40 credits in 4 calls (the quote held 150). The TypeScript and Python programs both ran.\n\nFRESH=1 skips the cache and bills every call; a cache hit is free.\n\nInputs, set to a working example (change them to yours):\n\n  brands: The brand and its competitors, comma-separated\n\n  exclude_terms: Words that mark another meaning of a brand name, comma-separated\n\n**Key:** create a Header Auth credential named SocialCrawl API key, with Name x-api-key and your API key as Value, and pick it on every request node.\n\n**Rows:** a step that runs once per row takes the first 1 rows (change the number in its rows node).\n\n**Errors:** a request node stops the workflow on an API error. Read error.type in its output; retry only when error.retryable is true.",
        "width": 520,
        "height": 420
      }
    }
  ],
  "connections": {
    "Run recipe": {
      "main": [
        [
          {
            "node": "reactions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "reactions": {
      "main": [
        [
          {
            "node": "reactions: finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "reactions: finished?": {
      "main": [
        [
          {
            "node": "reactions: result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "reactions: wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "reactions: wait": {
      "main": [
        [
          {
            "node": "reactions: follow the run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "reactions: follow the run": {
      "main": [
        [
          {
            "node": "reactions: finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {}
}
