{
  "name": "Image-based data extraction API using Gemini AI",
  "nodes": [
    {
      "id": "e3448003-5c62-4da6-8fcc-6817915dcbb8",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        40,
        40
      ]
    },
    {
      "id": "3682c6bf-3442-4fba-ab6c-ae29e361ef93",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1180,
        40
      ]
    },
    {
      "id": "bfa352d0-68a9-4f33-be54-254a5df22664",
      "name": "Get image from URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        280,
        40
      ]
    },
    {
      "id": "c6c8de12-08dc-42e8-9c0e-86e04c7cacc0",
      "name": "Call Gemini API (Flash Lite) with Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        760,
        40
      ]
    },
    {
      "id": "06b0f807-aeba-44d6-bb1d-dfa1d50e1082",
      "name": "Edit fields to output required data alone",
      "type": "n8n-nodes-base.set",
      "position": [
        980,
        40
      ]
    },
    {
      "id": "8c69dba2-f67c-4f8b-be18-02a414fd2ead",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        280
      ],
      "parameters": {
        "width": 820,
        "height": 420,
        "content": "## Sample API Call (cURL) \n```\ncurl --request GET \\\n  --url https://your_domain.com/webhook/data-extractor \\\n  --data '{\n  \"image_url\":\"https://www.immihelp.com/nri/images/sample-pan-card-front.jpg\",\n"
      }
    },
    {
      "id": "8839f0d7-306f-4dc2-aca5-6ca529e1a2ff",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        740
      ],
      "parameters": {
        "width": 1240,
        "height": 140,
        "content": "## Sample Output\n```\n{\n  \"result\": \"{\\\"Date of Birth\\\":\\\"23/11/1974\\\",\\\"Name\\\":\\\"RAHUL GUPTA\\\",\\\"PAN Number\\\":\\\"ABCDE1234F\\\",\\\"Valid\\\":true}\"\n}\n```"
      }
    },
    {
      "id": "df733e11-f194-4878-a514-47ddc9811281",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        -520
      ],
      "parameters": {
        "width": 940,
        "height": 440,
        "content": "## Convert the workflow into an Endpoint\n\nThis n8n workflow provides a ready-to-use API endpoint for extracting structured data from images. The API takes an image URL as input, processes it using an "
      }
    },
    {
      "id": "aecf7331-6341-411e-8906-e42fc0ef264a",
      "name": "Transform image to base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        520,
        40
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Get image from URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get image from URL": {
      "main": [
        [
          {
            "node": "Transform image to base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transform image to base64": {
      "main": [
        [
          {
            "node": "Call Gemini API (Flash Lite) with Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Call Gemini API (Flash Lite) with Image": {
      "main": [
        [
          {
            "node": "Edit fields to output required data alone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit fields to output required data alone": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}