{
  "version": "1.0.0",
  "exported_at": "2026-06-01T00:00:00.000Z",
  "project": {
    "name": "OpenSea NFT Scraper",
    "description": "Scrapes NFT listing data from OpenSea collection pages. Extracts NFT name, owner/owned_by when visible, price, views, favorites, image URL, item URL, and source collection URL. Uses a multi-URL loop for multiple OpenSea collection inputs and an infinite-scroll style auto-scroll step to load additional NFTs before appending results to opensea-nft-scraper.csv. OpenSea is highly dynamic and may hide owner/views/favorites on listing cards; those fields are best-effort and may require detail-page scraping or selector updates if OpenSea changes its DOM.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 220,
      "config": {
        "urls": [
          "https://opensea.io/collection/yeetard-nfts",
          "https://opensea.io/collection/azukielementals",
          "https://opensea.io/collection/mutant-ape-yacht-club"
        ],
        "color": "bg-[#4589ff]",
        "tags": [
          "opensea",
          "nft",
          "collection-input"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 480,
      "position_y": 220,
      "config": {
        "timeout": 45
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 840,
      "position_y": 220,
      "config": {
        "jsCode": "Array.from(document.querySelectorAll('button,[role=\"button\"]')).find(el => /^(accept|agree|allow all|accept all|got it)$/i.test((el.textContent || '').trim()))?.click();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 220,
      "config": {
        "selector": "a[href*=\"/assets/\"], a[href*=\"/item/\"]",
        "timeout": 45,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "rowSelector": "a[href*=\"/assets/\"], a[href*=\"/item/\"]",
        "fileName": "opensea-nft-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "name",
            "selector": "(() => { const aria = ROW.getAttribute('aria-label') || ROW.getAttribute('title') || ''; if (aria && !/^view/i.test(aria)) return aria.replace(/^view\\s+/i, '').trim(); const imgAlt = ROW.querySelector('img[alt]')?.getAttribute('alt') || ''; if (imgAlt && !/^image$/i.test(imgAlt)) return imgAlt.trim(); const lines = (ROW.innerText || '').split('\\n').map(s => s.trim()).filter(Boolean); return lines.find(s => !/(ETH|WETH|MATIC|SOL|USD|\\$|floor|last sale|buy now|owned by)/i.test(s)) || lines[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "owned_by",
            "selector": "(() => { const t = ROW.innerText || ''; const m = t.match(/(?:Owned by|Owner)[:\\s\\n]+([^\\n]+)/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(() => { const t = ROW.innerText || ''; const m = t.match(/(?:Price|Buy now|Current price)?\\s*([0-9]+(?:\\.[0-9]+)?\\s*(?:ETH|WETH|MATIC|SOL|APE|USDC)|Ξ\\s*[0-9.]+)/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "views",
            "selector": "(() => { const t = ROW.innerText || ROW.getAttribute('aria-label') || ''; const m = t.match(/([0-9][0-9,.]*)\\s*(?:views?|viewed)/i); return m ? m[1].replace(/,/g, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "favorites",
            "selector": "(() => { const t = ROW.innerText || ROW.getAttribute('aria-label') || ''; const m = t.match(/([0-9][0-9,.]*)\\s*(?:favorites?|likes?)/i); return m ? m[1].replace(/,/g, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url",
            "selector": "ROW.querySelector('img')?.currentSrc || ROW.querySelector('img')?.src || ROW.querySelector('img')?.getAttribute('src') || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "item_url",
            "selector": "ROW.href || ROW.querySelector('a[href*=\"/assets/\"], a[href*=\"/item/\"]')?.href || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "collection_url",
            "selector": "location.href.split('?')[0]",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "inject-javascript-2",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "jsCode": "clearInterval(window.__USCRAPER_OPENSEA_SCROLL_TIMER); window.__USCRAPER_OPENSEA_SCROLL_DONE = false; window.__USCRAPER_OPENSEA_SCROLL_STEPS = 0; window.__USCRAPER_OPENSEA_LAST_HEIGHT = 0; window.__USCRAPER_OPENSEA_STABLE = 0; window.__USCRAPER_OPENSEA_SCROLL_TIMER = setInterval(() => { const h = Math.max(document.body.scrollHeight || 0, document.documentElement.scrollHeight || 0); window.scrollTo(0, h); window.__USCRAPER_OPENSEA_SCROLL_STEPS += 1; if (h === window.__USCRAPER_OPENSEA_LAST_HEIGHT) { window.__USCRAPER_OPENSEA_STABLE += 1; } else { window.__USCRAPER_OPENSEA_STABLE = 0; } window.__USCRAPER_OPENSEA_LAST_HEIGHT = h; if (window.__USCRAPER_OPENSEA_STABLE >= 8 || window.__USCRAPER_OPENSEA_SCROLL_STEPS >= 80) { clearInterval(window.__USCRAPER_OPENSEA_SCROLL_TIMER); window.__USCRAPER_OPENSEA_SCROLL_DONE = true; } }, 800);",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2280,
      "position_y": 220,
      "config": {
        "duration": 70
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 2640,
      "position_y": 220,
      "config": {
        "selector": "a[href*=\"/assets/\"], a[href*=\"/item/\"]",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-2",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 3000,
      "position_y": 220,
      "config": {
        "rowSelector": "a[href*=\"/assets/\"], a[href*=\"/item/\"]",
        "fileName": "opensea-nft-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": false,
        "fileMode": "append",
        "columns": [
          {
            "name": "name",
            "selector": "(() => { const aria = ROW.getAttribute('aria-label') || ROW.getAttribute('title') || ''; if (aria && !/^view/i.test(aria)) return aria.replace(/^view\\s+/i, '').trim(); const imgAlt = ROW.querySelector('img[alt]')?.getAttribute('alt') || ''; if (imgAlt && !/^image$/i.test(imgAlt)) return imgAlt.trim(); const lines = (ROW.innerText || '').split('\\n').map(s => s.trim()).filter(Boolean); return lines.find(s => !/(ETH|WETH|MATIC|SOL|USD|\\$|floor|last sale|buy now|owned by)/i.test(s)) || lines[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "owned_by",
            "selector": "(() => { const t = ROW.innerText || ''; const m = t.match(/(?:Owned by|Owner)[:\\s\\n]+([^\\n]+)/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(() => { const t = ROW.innerText || ''; const m = t.match(/(?:Price|Buy now|Current price)?\\s*([0-9]+(?:\\.[0-9]+)?\\s*(?:ETH|WETH|MATIC|SOL|APE|USDC)|Ξ\\s*[0-9.]+)/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "views",
            "selector": "(() => { const t = ROW.innerText || ROW.getAttribute('aria-label') || ''; const m = t.match(/([0-9][0-9,.]*)\\s*(?:views?|viewed)/i); return m ? m[1].replace(/,/g, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "favorites",
            "selector": "(() => { const t = ROW.innerText || ROW.getAttribute('aria-label') || ''; const m = t.match(/([0-9][0-9,.]*)\\s*(?:favorites?|likes?)/i); return m ? m[1].replace(/,/g, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url",
            "selector": "ROW.querySelector('img')?.currentSrc || ROW.querySelector('img')?.src || ROW.querySelector('img')?.getAttribute('src') || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "item_url",
            "selector": "ROW.href || ROW.querySelector('a[href*=\"/assets/\"], a[href*=\"/item/\"]')?.href || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "collection_url",
            "selector": "location.href.split('?')[0]",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 3360,
      "position_y": 220,
      "config": {}
    }
  ],
  "connections": [
    {
      "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": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-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": "inject-javascript-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-2",
      "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": "wait-for-element-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-2",
      "from_connector_id": "right",
      "to_block_id": "structured-export-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-2",
      "from_connector_id": "right",
      "to_block_id": "loop-continue-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 116,
      "width": 2840,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1",
          "wait-for-element-2"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 768,
      "position_y": 116,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "inject-javascript-1",
          "inject-javascript-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1488,
      "position_y": 116,
      "width": 1760,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1",
          "structured-export-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 3288,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes NFT listing data from OpenSea collection pages. Extracts NFT name, owner/owned_by when visible, price, views, favorites, image URL, item URL, and source collection URL. Uses a multi-URL loop for multiple OpenSea collection inputs and an infinite-scroll style auto-scroll step to load additional NFTs before appending results to opensea-nft-scraper.csv. OpenSea is highly dynamic and may hide owner/views/favorites on listing cards; those fields are best-effort and may require detail-page scraping or selector updates if OpenSea changes its DOM.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `Array.from(document.querySelectorAll('button,[role=\"button\"]')).find(el => /^(accept|agree|allow all...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1040,
      "position_y": 200,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (name, owned_by, price, views, favorites). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 200,
      "width": 340,
      "height": 127,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-inject-javascript-2",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `clearInterval(window.__USCRAPER_OPENSEA_SCROLL_TIMER); window.__USCRAPER_OPENSEA_SCROLL_DONE = false...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 200,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-2"
      }
    },
    {
      "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": 3560,
      "position_y": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}