Skip to content

Python Logo API

Get the logo behind any URL with one HTTP request in Python — markup, BIMI and favicon detection merged, with format, dimensions and brand palette.

Get a logo in Python

No package and no scraping — the Microlink REST API detects the best logo for any URL and returns it with a single HTTP GET. Here it is with urllib and json from the Python standard library.
Step 01 · Extract any URL
A few lines with the standard library — no pip install to run. Point it at a domain and read the logo from the JSON response.
logo.py
import json
import urllib.parse
import urllib.request

params = urllib.parse.urlencode({'url': 'https://stripe.com'})

with urllib.request.urlopen(f'https://api.microlink.io?{params}') as res:
    data = json.load(res)['data']

print(data['logo']['url'])          # absolute, hotlink-ready
print(data['logo']['type'])         # 'png'
print(data['logo']['width'])        # 180
print(data['logo']['size_pretty'])  # '3.14 kB'
Step 02 · Read the logo fields
URL, format, dimensions and byte size come back in one call — everything an img tag or an avatar component needs.
palette.py
import json
import urllib.parse
import urllib.request

params = urllib.parse.urlencode({
    'url': 'https://stripe.com',
    'palette': 'true'  # add the brand palette to every detected image
})

with urllib.request.urlopen(f'https://api.microlink.io?{params}') as res:
    data = json.load(res)['data']

# Ordered from most dominant color to least
print(data['logo']['palette'])  # ['#543CFC', '#DEDAFC', ...]
Step 03 · Render JavaScript pages
Icons injected by client-side JavaScript only exist after the page renders — prerender in a real browser and they are detected too, still one request.
spa.py
import json
import urllib.parse
import urllib.request

params = urllib.parse.urlencode({
    'url': 'https://app.example.com',
    'prerender': 'true',          # render JS in a real browser first
    'waitForSelector': 'h1'       # detect only when the content exists
})

with urllib.request.urlopen(f'https://api.microlink.io?{params}') as res:
    data = json.load(res)['data']

# Icons injected by client-side JavaScript are found too
print(data['logo']['url'])
Step 04 · Hotlink the image directly
Add embed=logo.url and the API URL becomes the image itself — drop it into an img tag or a CSS background with no JSON parsing.
embed.py
import urllib.parse

params = urllib.parse.urlencode({
    'url': 'https://stripe.com',
    'embed': 'logo.url'  # the API URL becomes the image itself
})

logo_url = f'https://api.microlink.io?{params}'

# Drop it straight into an <img> tag — no JSON parsing
print(f'<img src="{logo_url}" alt="stripe logo" />')

Drop it into your framework

A FastAPI redirect, a Flask proxy, or an avatar payload — the same request becomes your own logo endpoint.
  • FastAPI
  • Flask
  • Brand Avatar
  • Plain Python
from flask import Flask, Response, request
import urllib.parse
import urllib.request

app = Flask(__name__)

@app.route('/logo')
def logo():
    params = urllib.parse.urlencode({
        'url': request.args['url'],
        'embed': 'logo.url'
    })
    with urllib.request.urlopen(f'https://api.microlink.io?{params}') as res:
        return Response(res.read(), mimetype=res.headers.get_content_type())

Skip the icon-hunting scrapers

Rolling your own means parsing apple-touch-icon, og:logo and JSON-LD per site, checking BIMI DNS records, probing image formats and building a palette pipeline. The API returns the best logo for any page without any of the moving parts.

DIY logo detection

  • Parse apple-touch-icon, og:logo and JSON-LD per site
  • Check BIMI DNS records and favicon fallbacks yourself
  • Probe image formats and dimensions with extra requests
  • JavaScript-injected icons need a headless browser
  • Extract brand palettes with your own image pipeline
  • You build the caching, retries and autoscaling

Microlink for Python

  • One HTTP request — urllib and json, no package to add
  • Markup, BIMI and favicon detection merged for you
  • Format, dimensions and byte size included
  • Brand palette with WCAG-friendly color pairs
  • Hotlink-ready with embed=logo.url
  • Autoscaled fleet with a 99.95% uptime SLA

Built for the way you write Python.

A REST API that feels native in Python — one call, JSON back, and at home in anything from a script to a web framework. Read the API overview to go deeper.

  • Three Detection Sources

    Page markup, the BIMI DNS record and the favicon as fallback — the best available asset wins, every time.
  • Standard Library Only

    urllib and json ship with Python — the examples run with no pip install and nothing to vendor.
  • Complete Image Metadata

    Format, byte size and exact dimensions come with every logo — no HEAD requests or image probing on your side.
  • Hotlink-Ready

    The logo comes back as an absolute URL — hotlink it directly, or use embed=logo.url and the API URL is the image.
  • Real Browser Detection

    Icons injected by client-side JavaScript are detected too, with prerender=true and waitForSelector.
  • Brand Palette

    Enable palette=true and every detected image gains a dominant-color palette with WCAG-friendly pairs — theme your UI straight from the response.
  • Framework Friendly

    Drop it into FastAPI, Flask, or an avatar component as a route or a few-line function.
  • Zero Infrastructure

    Managed Headless Chrome, autoscaled and load-balanced. No browser pool, no servers, no patching to maintain.
  • Generous Free Tier

    Start with 25 requests per day — no account, no credit card. Add an API key when you are ready to scale.
  • Three Detection Sources

    Page markup, the BIMI DNS record and the favicon as fallback — the best available asset wins, every time.
  • Standard Library Only

    urllib and json ship with Python — the examples run with no pip install and nothing to vendor.
  • Complete Image Metadata

    Format, byte size and exact dimensions come with every logo — no HEAD requests or image probing on your side.
  • Hotlink-Ready

    The logo comes back as an absolute URL — hotlink it directly, or use embed=logo.url and the API URL is the image.
  • Real Browser Detection

    Icons injected by client-side JavaScript are detected too, with prerender=true and waitForSelector.
  • Brand Palette

    Enable palette=true and every detected image gains a dominant-color palette with WCAG-friendly pairs — theme your UI straight from the response.
  • Framework Friendly

    Drop it into FastAPI, Flask, or an avatar component as a route or a few-line function.
  • Zero Infrastructure

    Managed Headless Chrome, autoscaled and load-balanced. No browser pool, no servers, no patching to maintain.
  • Generous Free Tier

    Start with 25 requests per day — no account, no credit card. Add an API key when you are ready to scale.

Try it live in the playground

Paste a URL and see the detected logo before you write a line of Python.

Python Logo API FAQ

Everything Python developers ask before integrating the Microlink logo API.

Where does the logo come from?

Microlink walks the page markup — apple-touch-icon, Open Graph and JSON-LD — checks the BIMI record in DNS, and falls back to the favicon. The best available asset wins, with its format and dimensions included.

Do I need to install a package?

No. The examples use urllib and json from the Python standard library. If you already use requests or httpx, the same call is one line shorter.

What about icons injected by JavaScript?

Pass prerender=true and the page is rendered in a real browser before detection, so icons injected by React, Vue or any client-side framework are found too. Combine it with waitForSelector to wait for specific content.
Yes. Add embed=logo.url and the API URL becomes the image itself — use it in an img tag or a CSS background with no JSON parsing and nothing to store on your side.

Is there a free tier or do I need an API key?

The free tier gives you 25 requests per day with no account, no credit card, and no API key. Just call the endpoint and start extracting.
When you need more throughput or caching control, add an apiKey header and requests route to the Pro tier. See pricing for the limits.
Responses are cached at the edge with a sane default TTL, and you control freshness per request — see the API overview for cache parameters.

Start extracting in Python

Get 25 requests/day with zero commitment — no account and no credit card. Send your first request and get logos back in minutes.
No login needed
25 reqs/day free
No credit card