{
  "apiVersion": 1,
  "generatedAt": "2026-09-14T00:00:00+00:00",
  "slug": "redirect-checker",
  "botId": "redirect-checker",
  "configEncoding": "plain",
  "configDigest": "e1406a349457b08595d37c635806675ee467e834b66b20ad77e627bf740b0a3f",
  "configBytes": 9295,
  "project": {
    "name": "Redirect Checker",
    "settings": {
      "urls": [
        "about:blank"
      ],
      "headless": false,
      "max_concurrent_workers": 3,
      "humanoidEnabled": false,
      "proxyEnabled": false,
      "captchaEnabled": false,
      "matchTimezoneAndLocale": false,
      "block_resources": false,
      "get_urls_from_sitemap": false,
      "respect_robots_txt": false,
      "skip_initial_navigation": true,
      "variables": [
        {
          "name": "urls_to_check",
          "value": "https://httpbin.org/redirect/1\nhttps://httpbin.org/redirect/3\nhttps://httpbin.org/status/301\nhttps://httpbin.org/status/302\nhttps://www.google.com\nhttps://this-domain-does-not-exist-9x7q.com",
          "required": true,
          "is_list": true
        }
      ]
    },
    "datasets": {
      "Redirect_Report": {
        "item_selector": "css=html",
        "properties": [
          {
            "name": "Source_URL",
            "type": "text",
            "selector": "variable=normalized_url"
          },
          {
            "name": "Final_URL",
            "type": "text",
            "selector": "variable=last_final_url"
          },
          {
            "name": "Status_Code",
            "type": "text",
            "selector": "variable=last_http_status"
          },
          {
            "name": "Status_Text",
            "type": "text",
            "selector": "variable=last_http_status_text"
          },
          {
            "name": "Redirect_Count",
            "type": "text",
            "selector": "variable=last_redirect_count"
          },
          {
            "name": "Navigation_OK",
            "type": "text",
            "selector": "variable=last_navigation_ok"
          },
          {
            "name": "Error",
            "type": "text",
            "selector": "variable=last_navigation_error"
          },
          {
            "name": "Content_Type",
            "type": "text",
            "selector": "variable=last_content_type"
          },
          {
            "name": "Server",
            "type": "text",
            "selector": "variable=last_server"
          },
          {
            "name": "Protocol",
            "type": "text",
            "selector": "variable=last_protocol"
          },
          {
            "name": "Response_Time_ms",
            "type": "text",
            "selector": "variable=last_response_time_ms"
          },
          {
            "name": "X_Robots_Tag",
            "type": "text",
            "selector": "variable=last_x_robots_tag"
          },
          {
            "name": "Cache_Control",
            "type": "text",
            "selector": "variable=last_cache_control"
          },
          {
            "name": "Chain_Status_Codes",
            "type": "text",
            "selector": "variable=last_redirect_chain",
            "transformations": [
              {
                "type": "script",
                "code": "if(!Array.isArray(value)||value.length===0)return '';return value.map(function(h){return h.status||'?';}).join(' -> ');",
                "default_value": ""
              }
            ]
          },
          {
            "name": "Chain_Details",
            "type": "text",
            "selector": "variable=last_redirect_chain",
            "transformations": [
              {
                "type": "script",
                "code": "if(!Array.isArray(value)||value.length===0)return '';return value.map(function(h,i){return 'Hop '+(i+1)+': '+((h.status)||'?')+' '+(h.location||h.url||'');}).join(' | ');",
                "default_value": ""
              }
            ]
          },
          {
            "name": "Chain_Visual",
            "type": "text",
            "selector": "variable=last_redirect_chain",
            "transformations": [
              {
                "type": "script",
                "code": "if(!Array.isArray(value)||value.length===0)return '';var p=[];for(var i=0;i<value.length;i++){var h=value[i];p.push((h.url||'')+' --['+(h.status||'?')+']--> '+(h.location||''));}return p.join('\\n');",
                "default_value": ""
              }
            ]
          },
          {
            "name": "Has_301",
            "type": "text",
            "selector": "variable=last_redirect_chain",
            "transformations": [
              {
                "type": "script",
                "code": "return String(Array.isArray(value)&&value.some(function(h){return h.status===301;}));",
                "default_value": "false"
              }
            ]
          },
          {
            "name": "Has_302",
            "type": "text",
            "selector": "variable=last_redirect_chain",
            "transformations": [
              {
                "type": "script",
                "code": "return String(Array.isArray(value)&&value.some(function(h){return h.status===302;}));",
                "default_value": "false"
              }
            ]
          },
          {
            "name": "Has_303",
            "type": "text",
            "selector": "variable=last_redirect_chain",
            "transformations": [
              {
                "type": "script",
                "code": "return String(Array.isArray(value)&&value.some(function(h){return h.status===303;}));",
                "default_value": "false"
              }
            ]
          },
          {
            "name": "Has_307",
            "type": "text",
            "selector": "variable=last_redirect_chain",
            "transformations": [
              {
                "type": "script",
                "code": "return String(Array.isArray(value)&&value.some(function(h){return h.status===307;}));",
                "default_value": "false"
              }
            ]
          },
          {
            "name": "Has_308",
            "type": "text",
            "selector": "variable=last_redirect_chain",
            "transformations": [
              {
                "type": "script",
                "code": "return String(Array.isArray(value)&&value.some(function(h){return h.status===308;}));",
                "default_value": "false"
              }
            ]
          },
          {
            "name": "Redirect_Type",
            "type": "text",
            "selector": "variable=last_redirect_chain",
            "transformations": [
              {
                "type": "script",
                "code": "var c=Array.isArray(value)?value:[];if(c.length===0)return 'No HTTP Redirect';var s=c.map(function(h){return h.status;});if(s.indexOf(301)!==-1)return '301 Permanent';if(s.indexOf(308)!==-1)return '308 Permanent';if(s.indexOf(302)!==-1)return '302 Temporary';if(s.indexOf(303)!==-1)return '303 See Other';if(s.indexOf(307)!==-1)return '307 Temporary';return 'Redirect ('+s.join(',')+')';",
                "default_value": "Unknown"
              }
            ]
          },
          {
            "name": "Chain_Length_Verdict",
            "type": "text",
            "selector": "variable=last_redirect_count",
            "transformations": [
              {
                "type": "script",
                "code": "var n=Number(value);if(!isFinite(n)||n===0)return 'No Redirect';if(n<=2)return 'OK';if(n<=5)return 'Long Chain';return 'Redirect Loop Risk';",
                "default_value": "Unknown"
              }
            ]
          }
        ],
        "required_fields": [
          "Source_URL"
        ]
      },
      "Errors": {
        "item_selector": "css=html",
        "properties": [
          {
            "name": "Source_URL",
            "type": "text",
            "selector": "variable=normalized_url"
          },
          {
            "name": "Status_Code",
            "type": "text",
            "selector": "variable=last_http_status"
          },
          {
            "name": "Error",
            "type": "text",
            "selector": "variable=last_navigation_error"
          }
        ],
        "required_fields": [
          "Source_URL"
        ]
      },
      "Destination_URLs": {
        "item_selector": "css=html",
        "properties": [
          {
            "name": "Destination_URL",
            "type": "text",
            "selector": "variable=last_final_url"
          }
        ],
        "required_fields": [
          "Destination_URL"
        ]
      }
    },
    "commands": [
      {
        "command": "for_each",
        "params": {
          "source_type": "variable",
          "variable": "urls_to_check",
          "as": "target_url",
          "do": [
            {
              "command": "try_catch",
              "params": {
                "try": [
                  {
                    "command": "goto",
                    "params": {
                      "url": "${target_url}"
                    }
                  }
                ],
                "catch": [
                  {
                    "command": "comment",
                    "params": {
                      "text": "Navigation failed: ${last_error}"
                    }
                  }
                ]
              }
            },
            {
              "command": "extract_data",
              "params": {
                "dataset": "Redirect_Report"
              }
            },
            {
              "command": "extract_data",
              "params": {
                "dataset": "Errors",
                "filter_condition": "item.Navigation_OK === false || item.Status_Code === null || item.Status_Code === ''"
              }
            },
            {
              "command": "extract_data",
              "params": {
                "dataset": "Destination_URLs",
                "filter_condition": "item.Destination_URL && item.Destination_URL !== ''"
              }
            }
          ]
        }
      }
    ],
    "authors": []
  }
}