モジュール - ベストウェブサイトのアイコンの取得

上級

これはDocument Extraction, AI Summarization分野の自動化ワークフローで、16個のノードを含みます。主にSet, Code, Merge, Filter, Aggregateなどのノードを使用。 複数のソースから最適なウェブサイトのアイコンをGPT-4の視覚分析を通じて見つける

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
  • OpenAI API Key

カテゴリー

ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "avK3DkrjbyTrhqdg",
  "meta": {
    "instanceId": "06e5009344f682419c20ccd4ecdcb5223bbb91761882af93ac6d468dbc2cbf8d",
    "templateCredsSetupCompleted": true
  },
  "name": "Module - Get Best Favicon",
  "tags": [
    {
      "id": "IPgYZQUa5S80tGVk",
      "name": "Tool Listing Agent",
      "createdAt": "2025-02-25T02:55:31.909Z",
      "updatedAt": "2025-02-25T02:55:31.909Z"
    }
  ],
  "nodes": [
    {
      "id": "bd2411e4-555c-4d27-bc70-3e977bb5f83a",
      "name": "workflow_trigger",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "url"
            },
            {
              "name": "domain"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "16ca4bff-0871-4cba-bf58-cdc110059f6f",
      "name": "logo_dev",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        580,
        0
      ],
      "parameters": {
        "url": "=https://img.logo.dev/{{ $json.domain }}?format=png&size=512",
        "options": {
          "response": {
            "response": {
              "fullResponse": true,
              "responseFormat": "file"
            }
          },
          "allowUnauthorizedCerts": true
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "5dqFKvC44DJBQMOn",
          "name": "Logo.dev API"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f8603300-93c6-4771-a8c7-6cf898020d72",
      "name": "google",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        580,
        -180
      ],
      "parameters": {
        "url": "=https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url={{ $('workflow_trigger').item.json.url }}&size=256",
        "options": {
          "response": {
            "response": {
              "fullResponse": true,
              "responseFormat": "file"
            }
          },
          "allowUnauthorizedCerts": true
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "3bc983e4-b152-485a-a6ec-1938250f33ee",
      "name": "merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        880,
        0
      ],
      "parameters": {
        "numberInputs": 3
      },
      "typeVersion": 3
    },
    {
      "id": "ff5aff24-360e-42a8-ba3f-d7136a6d739d",
      "name": "analyze_each_icon",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1720,
        0
      ],
      "parameters": {
        "text": "I want you to give me a quality on a floating point range of 0 to 1.0\n\n- A score of 0.0 is not a good fit to be used as a featured icon\n- A score of 1.0 is a great fit to be used as a featured icon\n\nI want the best quality icon to display on this listing page with at least 256x256 resolution. It should not be blurry or contain artifacts. It should be a true brand icon or favicon of the brand. Transparency and solid colored background colors are good. I want to avoid any icons that already have rounded containers or other shapes that are featuring the icon/favicon.\n\nA high quality icon should NOT be a default icon that is used by javascript framework templates and other defaults. For example, the Vercel triangle icon would not be a high quality icon since it is not actually the true icon for the tool on the directory page.\n\nThis should be in the context of using the given image icon on as the main icon on a directory of AI tools.\n\nDon't take the actual design of the logo, icon, or favicon into consideration. It should be how cleanly it is presented within the image.",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "id": "7ecUbyMBJInZM14n",
          "name": "Open AI"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "fcbfc5f7-0909-47b4-a306-0d6431f8a9ac",
      "name": "extract_best_icon",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        2260,
        0
      ],
      "parameters": {
        "text": "={{ $json.results.map((item, index) => {\n  let result = \"\";\n  result += \"Image Number \" + index + \":\";\n  result += \"\\n\";\n  result += item;\n  return result;\n}).join(\"\\n\\n-----\\n\\n\") }}",
        "options": {
          "systemPromptTemplate": "You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value."
        },
        "attributes": {
          "attributes": [
            {
              "name": "best_image_index",
              "type": "number",
              "required": true,
              "description": "This is the image number that has the best quality score associated with it. The quality score is a floating point number on a scale of 0.0 through 1.0. The image number you return should be the image that has the greatest score and best feedback."
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c7727f10-dd2a-4cb2-8145-c9931bcdaeec",
      "name": "clearbit",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        580,
        180
      ],
      "parameters": {
        "url": "=https://logo.clearbit.com/{{ $json.domain }}?size=256&format=png",
        "options": {
          "response": {
            "response": {
              "fullResponse": true,
              "responseFormat": "file"
            }
          },
          "allowUnauthorizedCerts": true
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "125b7434-258b-4071-b49c-f20fd670077d",
      "name": "filter_errors",
      "type": "n8n-nodes-base.filter",
      "position": [
        1140,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "08448b34-04ca-4429-b0e0-c9855d123904",
              "operator": {
                "type": "object",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $('merge')?.item?.json?.error }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "569cd049-711d-47a2-9753-5b0d74fb2842",
      "name": "set_common_fields",
      "type": "n8n-nodes-base.set",
      "position": [
        280,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "418bd8cc-479c-47f4-8809-c2efcb835727",
              "name": "url",
              "type": "string",
              "value": "={{ $json.url }}"
            },
            {
              "id": "da80fa55-5c68-415f-ac95-7fadb22e685a",
              "name": "domain",
              "type": "string",
              "value": "={{ $json.domain }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "8ca9921d-5992-4d68-ae4c-feb4b066c452",
      "name": "filter_mime_type",
      "type": "n8n-nodes-base.filter",
      "position": [
        1420,
        0
      ],
      "parameters": {
        "options": {
          "ignoreCase": true
        },
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "0f380a0c-05d4-42e1-a606-33d09e35554c",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.headers['content-type'] }}",
              "rightValue": "image/png"
            },
            {
              "id": "fbc9d748-06ea-40e1-a547-bb524e548f99",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "{{ $json.headers['content-type'] }}",
              "rightValue": "image/jpeg"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "630e82ee-9f1e-4984-af0c-2a7e13408b2a",
      "name": "return_final_image_url",
      "type": "n8n-nodes-base.code",
      "position": [
        2660,
        0
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "let idx = Number($json.output.best_image_index);\nlet url = $('set_common_fields').item.json.tool_url;\nlet domain = $('set_common_fields').item.json.domain;\nlet icon_url = \"\";\n\nswitch (idx) {\n  // google\n  case 0:\n    icon_url = `https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=${url}&size=256`;\n    break;\n\n  // logo.dev\n  case 1:\n    icon_url = `https://img.logo.dev/${domain}?token=pk_b6ax6oVTTlSLqCezmTitOg&format=png&size=512`;\n    break;\n\n  // clearbit\n  case 2:\n    icon_url = `https://logo.clearbit.com/${domain}?size=256&format=png`;\n    break;\n\n  default:\n    throw new Error(\"Unknown image index\");\n}\n\nreturn { icon_url };"
      },
      "typeVersion": 2
    },
    {
      "id": "095b9170-dcc5-4947-8405-fb8046511c0a",
      "name": "gpt-4o-mini",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2360,
        220
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {
          "temperature": 0
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "7ecUbyMBJInZM14n",
          "name": "Open AI"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "bfdb05c0-1103-4fc6-ab4a-c499aea954e1",
      "name": "付箋",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -340
      ],
      "parameters": {
        "color": 4,
        "width": 1140,
        "height": 740,
        "content": "## 1. Fetch Favicon Images \n\nAttempts to fetch favicon images from multiple providers by using the website's `url` and `domain` inputs."
      },
      "typeVersion": 1
    },
    {
      "id": "af0b3b5c-0e17-48d0-bd44-8b2a9f32322b",
      "name": "付箋1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1080,
        -340
      ],
      "parameters": {
        "width": 1080,
        "height": 740,
        "content": "## 2. Analyze Each Image\n\nUse OpenAI's vision API to analyze each image and assign a \"Quality Score\" for each favicon previously fetched."
      },
      "typeVersion": 1
    },
    {
      "id": "f8499d0f-69e8-45dd-9777-259c0e5318c9",
      "name": "aggregate_results",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1980,
        0
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "renameField": true,
              "outputFieldName": "results",
              "fieldToAggregate": "content"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9e2213b3-a204-4dbc-ac7c-b8d363f7f8e3",
      "name": "付箋2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2180,
        -340
      ],
      "parameters": {
        "color": 6,
        "width": 700,
        "height": 740,
        "content": "## 3. Build Result\n\nThe final step here picks out the best score from the previous analysis and returns the url for the highest quality favicon image."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {
    "workflow_trigger": [
      {
        "json": {
          "tool_url": "http://fyxer.ai",
          "tool_name": "Fyxer AI"
        }
      }
    ]
  },
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "db484788-16f9-4f1f-a6ef-54f18035e1c8",
  "connections": {
    "3bc983e4-b152-485a-a6ec-1938250f33ee": {
      "main": [
        [
          {
            "node": "125b7434-258b-4071-b49c-f20fd670077d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f8603300-93c6-4771-a8c7-6cf898020d72": {
      "main": [
        [
          {
            "node": "3bc983e4-b152-485a-a6ec-1938250f33ee",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c7727f10-dd2a-4cb2-8145-c9931bcdaeec": {
      "main": [
        [
          {
            "node": "3bc983e4-b152-485a-a6ec-1938250f33ee",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "16ca4bff-0871-4cba-bf58-cdc110059f6f": {
      "main": [
        [
          {
            "node": "3bc983e4-b152-485a-a6ec-1938250f33ee",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "095b9170-dcc5-4947-8405-fb8046511c0a": {
      "ai_languageModel": [
        [
          {
            "node": "fcbfc5f7-0909-47b4-a306-0d6431f8a9ac",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "125b7434-258b-4071-b49c-f20fd670077d": {
      "main": [
        [
          {
            "node": "8ca9921d-5992-4d68-ae4c-feb4b066c452",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8ca9921d-5992-4d68-ae4c-feb4b066c452": {
      "main": [
        [
          {
            "node": "ff5aff24-360e-42a8-ba3f-d7136a6d739d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bd2411e4-555c-4d27-bc70-3e977bb5f83a": {
      "main": [
        [
          {
            "node": "569cd049-711d-47a2-9753-5b0d74fb2842",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f8499d0f-69e8-45dd-9777-259c0e5318c9": {
      "main": [
        [
          {
            "node": "fcbfc5f7-0909-47b4-a306-0d6431f8a9ac",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ff5aff24-360e-42a8-ba3f-d7136a6d739d": {
      "main": [
        [
          {
            "node": "f8499d0f-69e8-45dd-9777-259c0e5318c9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fcbfc5f7-0909-47b4-a306-0d6431f8a9ac": {
      "main": [
        [
          {
            "node": "630e82ee-9f1e-4984-af0c-2a7e13408b2a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "569cd049-711d-47a2-9753-5b0d74fb2842": {
      "main": [
        [
          {
            "node": "f8603300-93c6-4771-a8c7-6cf898020d72",
            "type": "main",
            "index": 0
          },
          {
            "node": "16ca4bff-0871-4cba-bf58-cdc110059f6f",
            "type": "main",
            "index": 0
          },
          {
            "node": "c7727f10-dd2a-4cb2-8145-c9931bcdaeec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

上級 - 文書抽出, AI要約

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
上級
ノード数16
カテゴリー2
ノードタイプ11
難易度説明

上級者向け、16ノード以上の複雑なワークフロー

作成者
Lucas Walter

Lucas Walter

@lucaswalter

I build the systems behind The Recap AI, where we teach and help people implement AI in ways that make the most sense for their businesses.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34