{
  "openapi": "3.1.0",
  "info": {
    "title": "Icon Horse API",
    "version": "2.0.0",
    "summary": "Logos and favicons for any domain or product name.",
    "description": "Free logo and favicon API. Get any company's or product's logo as PNG, WebP, ICO or SVG (16 to 256px) from a domain or a product name. No API key. Image responses carry X-Icon-Fallback, X-Icon-Source-Size, X-Icon-Source and X-Icon-Confidence headers so callers can tell a real logo from a placeholder. Full docs: https://icon.horse/docs.html",
    "contact": {
      "email": "hi@icon.horse",
      "url": "https://icon.horse/docs.html"
    }
  },
  "servers": [
    {
      "url": "https://icon.horse"
    }
  ],
  "security": [],
  "externalDocs": {
    "url": "https://icon.horse/docs.html"
  },
  "tags": [
    {
      "name": "images",
      "description": "Image URLs you can put straight into an img tag, a slide or a document"
    },
    {
      "name": "json",
      "description": "JSON endpoints for scripts and agents"
    },
    {
      "name": "new",
      "description": "New endpoints. Exact shapes may still change"
    }
  ],
  "paths": {
    "/icon/{domain}": {
      "get": {
        "operationId": "getIconByDomain",
        "tags": [
          "images"
        ],
        "summary": "Icon for a domain as PNG, up to 256px",
        "description": "Returns the best icon the site has, as a PNG master up to 256px. Pasted URLs work: scheme, www., path, port and case are dropped and the request redirects (301) to /icon/<hostname>. ?size= and ?format= redirect to the path forms below.",
        "parameters": [
          {
            "$ref": "#/components/parameters/domain"
          },
          {
            "$ref": "#/components/parameters/trim"
          },
          {
            "$ref": "#/components/parameters/pad"
          },
          {
            "$ref": "#/components/parameters/bg"
          },
          {
            "$ref": "#/components/parameters/fallback"
          },
          {
            "$ref": "#/components/parameters/weight"
          },
          {
            "$ref": "#/components/parameters/tone"
          },
          {
            "$ref": "#/components/parameters/color"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Image"
          },
          "301": {
            "$ref": "#/components/responses/Canonical"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NoIcon"
          }
        }
      }
    },
    "/icon/{domain}/{sizeOrFormat}": {
      "get": {
        "operationId": "getIconByDomainSizeOrFormat",
        "tags": [
          "images"
        ],
        "summary": "Icon for a domain at a fixed PNG size, or as ICO, SVG or WebP",
        "parameters": [
          {
            "$ref": "#/components/parameters/domain"
          },
          {
            "name": "sizeOrFormat",
            "in": "path",
            "required": true,
            "schema": {
              "oneOf": [
                {
                  "type": "integer",
                  "enum": [
                    16,
                    32,
                    48,
                    64,
                    128,
                    256
                  ]
                },
                {
                  "type": "string",
                  "enum": [
                    "png",
                    "webp",
                    "ico",
                    "svg"
                  ]
                }
              ]
            },
            "examples": {
              "size": {
                "value": 64
              },
              "format": {
                "value": "svg"
              }
            }
          },
          {
            "$ref": "#/components/parameters/trim"
          },
          {
            "$ref": "#/components/parameters/pad"
          },
          {
            "$ref": "#/components/parameters/bg"
          },
          {
            "$ref": "#/components/parameters/fallback"
          },
          {
            "$ref": "#/components/parameters/weight"
          },
          {
            "$ref": "#/components/parameters/tone"
          },
          {
            "$ref": "#/components/parameters/color"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Image"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NoIcon"
          }
        },
        "description": "A number (16 to 256) is a PNG size. A format name returns that format at full size: ico has 16, 32 and 48px frames; svg is the site's own vector, or 404 when it has none."
      }
    },
    "/icon/{domain}/{size}/{format}": {
      "get": {
        "operationId": "getIconByDomainSizedFormat",
        "tags": [
          "images"
        ],
        "summary": "Icon for a domain at a fixed size and raster format",
        "parameters": [
          {
            "$ref": "#/components/parameters/domain"
          },
          {
            "$ref": "#/components/parameters/size"
          },
          {
            "name": "format",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "png",
                "webp"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/trim"
          },
          {
            "$ref": "#/components/parameters/pad"
          },
          {
            "$ref": "#/components/parameters/bg"
          },
          {
            "$ref": "#/components/parameters/fallback"
          },
          {
            "$ref": "#/components/parameters/weight"
          },
          {
            "$ref": "#/components/parameters/tone"
          },
          {
            "$ref": "#/components/parameters/color"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Image"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NoIcon"
          }
        }
      }
    },
    "/icon": {
      "get": {
        "operationId": "searchIconByName",
        "tags": [
          "images"
        ],
        "summary": "Redirect a product name query to /name/<slug>",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Product name, such as Microsoft Entra ID",
            "schema": {
              "type": "string"
            },
            "example": "Microsoft Entra ID"
          }
        ],
        "responses": {
          "301": {
            "$ref": "#/components/responses/Canonical"
          }
        }
      }
    },
    "/name/{product}": {
      "get": {
        "operationId": "getIconByName",
        "tags": [
          "images"
        ],
        "summary": "Icon for a product name",
        "description": "Resolves a product name through a curated catalog, then Wikidata (whole-word label or alias match; entity must have an icon, logo or official website). No match means not found, never a guess. Sizes, formats and variants work as on /icon: /name/{product}/{size}, /name/{product}/{size}/{format}, /name/{product}/{format}.",
        "parameters": [
          {
            "name": "product",
            "in": "path",
            "required": true,
            "description": "Product name or slug. Non-slug input redirects to the slug form.",
            "schema": {
              "type": "string"
            },
            "example": "microsoft-entra-id"
          },
          {
            "$ref": "#/components/parameters/trim"
          },
          {
            "$ref": "#/components/parameters/pad"
          },
          {
            "$ref": "#/components/parameters/bg"
          },
          {
            "$ref": "#/components/parameters/fallback"
          },
          {
            "$ref": "#/components/parameters/weight"
          },
          {
            "$ref": "#/components/parameters/tone"
          },
          {
            "$ref": "#/components/parameters/color"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Image"
          },
          "301": {
            "$ref": "#/components/responses/Canonical"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NoIcon"
          }
        }
      }
    },
    "/site/{domain}": {
      "get": {
        "operationId": "getSitePage",
        "tags": [
          "images"
        ],
        "summary": "HTML page with the icon, site name, description, downloads and embed code",
        "parameters": [
          {
            "$ref": "#/components/parameters/domain"
          }
        ],
        "responses": {
          "200": {
            "description": "HTML page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "301": {
            "$ref": "#/components/responses/Canonical"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/api/icons": {
      "get": {
        "operationId": "lookupIcons",
        "tags": [
          "json"
        ],
        "summary": "Look up to 20 domains or product names in one call",
        "description": "A query with a space or with no dot is a product name; anything else is a domain. GET responses are cached for 5 minutes.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Domain or product name. Repeat for more, up to 20.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "maxItems": 20
            },
            "example": [
              "stripe.com",
              "Microsoft Entra ID"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "One result per query, in order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IconResults"
                }
              }
            }
          },
          "400": {
            "description": "No queries, or more than 20",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "lookupIconsPost",
        "tags": [
          "json"
        ],
        "summary": "Look up to 20 domains or product names in one call (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "q"
                ],
                "properties": {
                  "q": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 20
                  }
                }
              },
              "example": {
                "q": [
                  "stripe.com",
                  "Microsoft Entra ID",
                  "CoCounsel"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per query, in order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IconResults"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, no queries, or more than 20",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/refresh/{domain}": {
      "get": {
        "operationId": "refreshIcon",
        "tags": [
          "json"
        ],
        "summary": "Refetch a site's icon now and purge the edge cache if it changed",
        "description": "Rate-limited to about 5 requests per minute per IP.",
        "parameters": [
          {
            "$ref": "#/components/parameters/domain"
          }
        ],
        "responses": {
          "200": {
            "description": "Refetched",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "refreshed": {
                      "type": "boolean"
                    },
                    "changed": {
                      "type": "boolean"
                    },
                    "purged": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "502": {
            "description": "Could not fetch the icon from the site; the cached icon is unchanged"
          }
        }
      }
    },
    "/api/stack": {
      "get": {
        "operationId": "companyStack",
        "tags": [
          "json",
          "new"
        ],
        "summary": "Which tools a company uses, with evidence",
        "description": "New endpoint. The response shape may still change.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "stripe.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Tools found for the company, each with evidence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/set": {
      "get": {
        "operationId": "logoSet",
        "tags": [
          "json",
          "new"
        ],
        "summary": "A matched logo set for a background color and size, with contrast warnings",
        "description": "New endpoint. Parameters and response shape may still change.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Domain or product name, repeatable",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "bg",
            "in": "query",
            "description": "Background color: white, black or hex",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                16,
                32,
                48,
                64,
                128,
                256
              ]
            }
          },
          {
            "name": "pad",
            "in": "query",
            "required": false,
            "description": "Padding, percent of each side (0-40).",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 40
            }
          },
          {
            "name": "tone",
            "in": "query",
            "required": false,
            "description": "color (default) or mono.",
            "schema": {
              "type": "string",
              "enum": [
                "color",
                "mono"
              ]
            }
          },
          {
            "name": "color",
            "in": "query",
            "required": false,
            "description": "Hex color for tone=mono.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "gap",
            "in": "query",
            "required": false,
            "description": "Pixels between and around tiles in row_url.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Logo set with per-logo contrast warnings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Matched logo set (JSON body)",
        "operationId": "postSet",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "q"
                ],
                "properties": {
                  "q": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 20
                  },
                  "size": {
                    "type": "integer"
                  },
                  "bg": {
                    "type": "string"
                  },
                  "pad": {
                    "type": "integer"
                  },
                  "tone": {
                    "type": "string",
                    "enum": [
                      "color",
                      "mono"
                    ]
                  },
                  "color": {
                    "type": "string"
                  },
                  "gap": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Logo set with per-logo contrast warnings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/set/row.png": {
      "get": {
        "summary": "The matched set rendered as one PNG row",
        "operationId": "getSetRow",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Domain or product name, repeatable",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "bg",
            "in": "query",
            "description": "Background color: white, black or hex",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                16,
                32,
                48,
                64,
                128,
                256
              ]
            }
          },
          {
            "name": "pad",
            "in": "query",
            "required": false,
            "description": "Padding, percent of each side (0-40).",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 40
            }
          },
          {
            "name": "tone",
            "in": "query",
            "required": false,
            "description": "color (default) or mono.",
            "schema": {
              "type": "string",
              "enum": [
                "color",
                "mono"
              ]
            }
          },
          {
            "name": "color",
            "in": "query",
            "required": false,
            "description": "Hex color for tone=mono.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "gap",
            "in": "query",
            "required": false,
            "description": "Pixels between and around tiles in row_url.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PNG strip",
            "content": {
              "image/png": {}
            }
          },
          "301": {
            "description": "Redirect to the canonical parameter order"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "domain": {
        "name": "domain",
        "in": "path",
        "required": true,
        "description": "Hostname, or any pasted URL",
        "schema": {
          "type": "string"
        },
        "example": "stripe.com"
      },
      "size": {
        "name": "size",
        "in": "path",
        "required": true,
        "schema": {
          "type": "integer",
          "enum": [
            16,
            32,
            48,
            64,
            128,
            256
          ]
        }
      },
      "trim": {
        "name": "trim",
        "in": "query",
        "description": "Cut empty border so the mark fills the frame",
        "schema": {
          "type": "string",
          "enum": [
            "1",
            "true"
          ]
        }
      },
      "pad": {
        "name": "pad",
        "in": "query",
        "description": "Padding, percent of each side",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 40
        }
      },
      "bg": {
        "name": "bg",
        "in": "query",
        "description": "Background color: white, black, or a 3 or 6 digit hex without #. Default transparent",
        "schema": {
          "type": "string"
        },
        "example": "white"
      },
      "fallback": {
        "name": "fallback",
        "in": "query",
        "description": "404 returns a 404 instead of a letter tile when no icon is found",
        "schema": {
          "type": "string",
          "enum": [
            "404"
          ]
        }
      },
      "weight": {
        "name": "weight",
        "in": "query",
        "required": false,
        "description": "1 = scale by visual mass so a row of logos looks evenly weighted. Implies trim.",
        "schema": {
          "type": "string",
          "enum": [
            "1"
          ]
        }
      },
      "tone": {
        "name": "tone",
        "in": "query",
        "required": false,
        "description": "mono = recolor the mark to one color.",
        "schema": {
          "type": "string",
          "enum": [
            "mono"
          ]
        }
      },
      "color": {
        "name": "color",
        "in": "query",
        "required": false,
        "description": "Hex color for tone=mono. Default: black or white, whichever reads on bg.",
        "schema": {
          "type": "string",
          "pattern": "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"
        }
      }
    },
    "headers": {
      "X-Icon-Fallback": {
        "description": "true when the image is a placeholder letter tile",
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ]
        }
      },
      "X-Icon-Source-Size": {
        "description": "Original size, such as 48x48, or vector",
        "schema": {
          "type": "string"
        }
      },
      "X-Icon-Source": {
        "description": "URL the icon came from",
        "schema": {
          "type": "string"
        }
      },
      "X-Icon-Confidence": {
        "description": "0 to 1. 0 means placeholder",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Image": {
        "description": "The icon, or a letter tile when none was found (check X-Icon-Fallback)",
        "headers": {
          "X-Icon-Fallback": {
            "$ref": "#/components/headers/X-Icon-Fallback"
          },
          "X-Icon-Source-Size": {
            "$ref": "#/components/headers/X-Icon-Source-Size"
          },
          "X-Icon-Source": {
            "$ref": "#/components/headers/X-Icon-Source"
          },
          "X-Icon-Confidence": {
            "$ref": "#/components/headers/X-Icon-Confidence"
          }
        },
        "content": {
          "image/png": {
            "schema": {
              "type": "string",
              "contentMediaType": "image/png"
            }
          },
          "image/webp": {
            "schema": {
              "type": "string",
              "contentMediaType": "image/webp"
            }
          },
          "image/x-icon": {
            "schema": {
              "type": "string",
              "contentMediaType": "image/x-icon"
            }
          },
          "image/svg+xml": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "Canonical": {
        "description": "Redirect to the canonical URL",
        "headers": {
          "Location": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "BadRequest": {
        "description": "Invalid hostname, size, format or option, or a rejected host",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            },
            "example": "invalid size: must be one of 16, 32, 48, 64, 128, 256"
          }
        }
      },
      "NoIcon": {
        "description": "No icon found and fallback=404 was set, or no SVG exists for an /svg request",
        "headers": {
          "X-Icon-Fallback": {
            "$ref": "#/components/headers/X-Icon-Fallback"
          }
        },
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "IconResults": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IconResult"
            }
          }
        }
      },
      "IconResult": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "error": {
            "type": "string",
            "description": "Set instead of the other fields when the query is empty or the host is rejected"
          },
          "kind": {
            "type": "string",
            "enum": [
              "domain",
              "name"
            ]
          },
          "found": {
            "type": "boolean"
          },
          "fallback": {
            "type": "boolean"
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "hostname": {
            "type": [
              "string",
              "null"
            ]
          },
          "via": {
            "type": [
              "string",
              "null"
            ],
            "description": "website, catalog, or a Wikidata source such as wikidata-logo"
          },
          "source": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "format": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "size": {
                "type": "string",
                "description": "WIDTHxHEIGHT or vector"
              }
            }
          },
          "urls": {
            "type": [
              "object",
              "null"
            ],
            "description": "Null when found is false",
            "properties": {
              "png": {
                "type": "string"
              },
              "png_64": {
                "type": "string"
              },
              "webp": {
                "type": "string"
              },
              "ico": {
                "type": "string"
              },
              "svg": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "page": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "candidates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
