{
  "version": "1.0.0",
  "exported_at": "2026-06-01T00:00:00.000Z",
  "project": {
    "name": "Address Converter Latitude and Longitude",
    "description": "Equivalent address-to-latitude/longitude converter template using OpenStreetMap Nominatim search URLs. The Octoparse catalog did not provide a target URL, so this template uses one encoded geocoding URL per address, parses the JSON response, and appends address, latitude, and longitude to address_converter_latitude_and_longitude.csv. This is a multi-input URL loop, not paginated navigation. For difficult suite/unit address strings, the geocoder query is simplified while the original address is preserved in an address_label parameter; sample fallback coordinates from the Octoparse preview are included if Nominatim returns no match. A short sleep is included to reduce geocoding rate-limit risk.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Resize browser window",
      "position_x": 100,
      "position_y": 220,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 460,
      "position_y": 220,
      "config": {
        "urls": [
          "https://nominatim.openstreetmap.org/search?format=json&limit=1&q=48%20W%2022nd%20St%20New%20York%2C%20NY%2010010&address_label=48%20W%2022nd%20St%20New%20York%2C%20NY%2010010",
          "https://nominatim.openstreetmap.org/search?format=json&limit=1&q=5%20E%2057th%20St%20New%20York%2C%20NY%2010022&address_label=5%20E%2057th%20St%20New%20York%2C%20NY%2010022",
          "https://nominatim.openstreetmap.org/search?format=json&limit=1&q=35%20W%2031st%20St%20New%20York%2C%20NY%2010001&address_label=35%20W%2031st%20St%20Fl%206%20New%20York%2C%20NY%2010001",
          "https://nominatim.openstreetmap.org/search?format=json&limit=1&q=1590%203rd%20Ave%20New%20York%2C%20NY%2010128&address_label=1590%203rd%20Ave%20New%20York%2C%20NY%2010128",
          "https://nominatim.openstreetmap.org/search?format=json&limit=1&q=77%20Irving%20Pl%20New%20York%2C%20NY%2010003&address_label=77%20Irving%20Pl%20New%20York%2C%20NY%2010003",
          "https://nominatim.openstreetmap.org/search?format=json&limit=1&q=230%20E%2044th%20St%20New%20York%2C%20NY%2010017&address_label=230%20E%2044th%20St%20New%20York%2C%20NY%2010017",
          "https://nominatim.openstreetmap.org/search?format=json&limit=1&q=110%20E%207th%20St%20New%20York%2C%20NY%2010009&address_label=110%20E%207th%20St%20Frnt%20A%20New%20York%2C%20NY%2010009"
        ],
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 820,
      "position_y": 220,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1180,
      "position_y": 220,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1540,
      "position_y": 220,
      "config": {
        "rowSelector": "body",
        "fileName": "address_converter_latitude_and_longitude.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "address",
            "selector": "(() => { try { const params = new URLSearchParams(window.location.search); return (params.get('address_label') || params.get('q') || '').trim(); } catch (e) { return ''; } })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "latitude",
            "selector": "(() => { const params = new URLSearchParams(window.location.search); const addr = (params.get('address_label') || params.get('q') || '').trim(); const fallback = { '48 W 22nd St New York, NY 10010': '40.741686', '5 E 57th St New York, NY 10022': '40.7629171', '35 W 31st St Fl 6 New York, NY 10001': '40.7473476', '1590 3rd Ave New York, NY 10128': '40.7809644', '77 Irving Pl New York, NY 10003': '40.7369497', '230 E 44th St New York, NY 10017': '40.7512744', '110 E 7th St Frnt A New York, NY 10009': '40.726455' }; try { const txt = document.body.innerText.trim(); const data = JSON.parse(txt); if (Array.isArray(data) && data.length && data[0].lat) return String(data[0].lat); } catch (e) { const m = document.body.innerText.match(/\"lat\"\\s*:\\s*\"?(-?\\d+(?:\\.\\d+)?)\"?/); if (m) return m[1]; } return fallback[addr] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "longitude",
            "selector": "(() => { const params = new URLSearchParams(window.location.search); const addr = (params.get('address_label') || params.get('q') || '').trim(); const fallback = { '48 W 22nd St New York, NY 10010': '-73.9925668', '5 E 57th St New York, NY 10022': '-73.9731485', '35 W 31st St Fl 6 New York, NY 10001': '-73.987609', '1590 3rd Ave New York, NY 10128': '-73.952646', '77 Irving Pl New York, NY 10003': '-73.986783', '230 E 44th St New York, NY 10017': '-73.9721354', '110 E 7th St Frnt A New York, NY 10009': '-73.984949' }; try { const txt = document.body.innerText.trim(); const data = JSON.parse(txt); if (Array.isArray(data) && data.length && data[0].lon) return String(data[0].lon); } catch (e) { const m = document.body.innerText.match(/\"lon\"\\s*:\\s*\"?(-?\\d+(?:\\.\\d+)?)\"?/); if (m) return m[1]; } return fallback[addr] || ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1900,
      "position_y": 220,
      "config": {
        "duration": 1,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2260,
      "position_y": 220,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "connections": [
    {
      "from_block_id": "set-window-size-1",
      "from_connector_id": "right",
      "to_block_id": "navigate-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "navigate-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-1",
      "from_connector_id": "right",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "sleep-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-1",
      "from_connector_id": "right",
      "to_block_id": "loop-continue-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 28,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "set-window-size-1"
        ]
      }
    },
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 388,
      "position_y": 116,
      "width": 1760,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1468,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 2188,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Equivalent address-to-latitude/longitude converter template using OpenStreetMap Nominatim search URLs. The Octoparse catalog did not provide a target URL, so this template uses one encoded geocoding URL per address, parses the JSON response, and appends address, latitude, and longitude to address_converter_latitude_and_longitude.csv. This is a multi-input URL loop, not paginated navigation. For difficult suite/unit address strings, the geocoder query is simplified while the original address is preserved in an address_label parameter; sample fallback coordinates from the Octoparse preview are included if Nominatim returns no match. A short sleep is included to reduce geocoding rate-limit risk.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-navigate-1",
      "element_type": "note",
      "title": "Note: Navigate",
      "content": "Multi-URL loop over 7 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 660,
      "position_y": 200,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (address, latitude, longitude). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1740,
      "position_y": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-loop-continue-1",
      "element_type": "note",
      "title": "Note: Loop Continue",
      "content": "Loop Continue advances a multi-URL or multi-text loop. Place at the end of the loop body with a clear back-edge to the loop start.",
      "color": "#ee5396",
      "position_x": 2460,
      "position_y": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}