Skip to main content
Internal Service β€” This is not an HTTP endpoint. It’s called by the competitor research service.

Purpose

Adds favicon URLs to each competitor using Google’s favicon service. Filters out generic globe icons.

Function Signature

async def add_favicon_urls_to_competitors(competitors: list) -> None

Parameters

ParameterTypeDescription
competitorslistList of competitor dicts (modified in place)

How It Works

  1. For each competitor, construct Google favicon URL
  2. Download the favicon and compute MD5 hash
  3. Compare against known β€œgeneric globe” hash
  4. If generic, set favicon_url to empty string
  5. If real favicon, keep the URL

Google Favicon Service

https://www.google.com/s2/favicons?domain={domain}&sz=64

Generic Globe Detection

Google returns a generic globe icon for domains without favicons. We detect this by comparing MD5 hashes:
GOOGLE_GENERIC_GLOBE_HASH = "b8a0bf372c762e966cc99ede8682bc71"

Code Location

src/website/competitor_research/service.py
# Lines 168-178: add_favicon_urls_to_competitors()
# Lines 31-48: is_generic_google_favicon()