Go Logo API
Get the logo behind any URL with one HTTP request in Go — markup, BIMI and favicon detection merged, with format, dimensions and brand palette.
GET api.microlink.io?url=microlink.io → data
{
"logo": {
"url": "https://images.stripeassets.com/fzn2n1nzq965/4vVgZi0ZMoEzOhkcv7EVwK/favicon.png?w=180&h=180",
"type": "png",
"size": 3143,
"width": 180,
"height": 180,
"size_pretty": "3.14 kB",
"palette": ["#543CFC", "#DEDAFC", "#4C33FB", "#3D0AFC"]
}
}Get a logo in Go
No module 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 net/http and encoding/json from the Go standard library.
Step 01 · Extract any URL
A few lines with the standard library — no module to add. Point it at a domain and read the logo from the JSON response.
main.go
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
type Logo struct {
URL string `json:"url"`
Type string `json:"type"`
Width int `json:"width"`
SizePretty string `json:"size_pretty"`
}
func main() {
params := url.Values{"url": {"https://stripe.com"}}
res, _ := http.Get("https://api.microlink.io?" + params.Encode())
defer res.Body.Close()
var payload struct {
Data struct {
Logo Logo `json:"logo"`
} `json:"data"`
}
json.NewDecoder(res.Body).Decode(&payload)
fmt.Println(payload.Data.Logo.URL) // absolute, hotlink-ready
fmt.Println(payload.Data.Logo.SizePretty) // '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.go
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
params := url.Values{
"url": {"https://stripe.com"},
"palette": {"true"}, // add the brand palette to every detected image
}
res, _ := http.Get("https://api.microlink.io?" + params.Encode())
defer res.Body.Close()
var payload struct {
Data struct {
Logo struct {
URL string `json:"url"`
Palette []string `json:"palette"`
} `json:"logo"`
} `json:"data"`
}
json.NewDecoder(res.Body).Decode(&payload)
// Ordered from most dominant color to least
fmt.Println(payload.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.go
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
params := url.Values{
"url": {"https://app.example.com"},
"prerender": {"true"}, // render JS in a real browser first
"waitForSelector": {"h1"}, // detect only when the content exists
}
res, _ := http.Get("https://api.microlink.io?" + params.Encode())
defer res.Body.Close()
var payload struct {
Data struct {
Logo struct {
URL string `json:"url"`
} `json:"logo"`
} `json:"data"`
}
json.NewDecoder(res.Body).Decode(&payload)
// Icons injected by client-side JavaScript are found too
fmt.Println(payload.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.go
package main
import (
"fmt"
"net/url"
)
func main() {
params := url.Values{
"url": {"https://stripe.com"},
"embed": {"logo.url"}, // the API URL becomes the image itself
}
logoURL := "https://api.microlink.io?" + params.Encode()
// Drop it straight into an <img> tag — no JSON parsing
fmt.Printf(`<img src="%s" alt="stripe logo" />`, logoURL)
}Drop it into your framework
A Gin redirect, an Echo proxy, or an avatar worker — the same request becomes your own logo endpoint.
- Gin
- Echo
- Avatar Worker
- Plain Go
package main
import (
"io"
"net/http"
"net/url"
"github.com/labstack/echo/v4"
)
func main() {
e := echo.New()
// GET /logo?url=https://stripe.com — proxy the image bytes
e.GET("/logo", func(c echo.Context) error {
params := url.Values{
"url": {c.QueryParam("url")},
"embed": {"logo.url"},
}
res, err := http.Get("https://api.microlink.io?" + params.Encode())
if err != nil {
return err
}
defer res.Body.Close()
return c.Stream(http.StatusOK, res.Header.Get("Content-Type"), res.Body.(io.Reader))
})
e.Logger.Fatal(e.Start(":1323"))
}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 Go
- One HTTP request — net/http, no module 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.9% uptime SLA
Built for the way you write Go.
A REST API that feels native in Go — one call, JSON back, and at home in anything from a CLI to a logo proxy. 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
net/http and encoding/json ship with Go — the examples compile with zero external dependencies.
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 Gin, Echo, or an avatar worker as a handler in a few lines.
Zero Infrastructure
Managed Headless Chrome, autoscaled and load-balanced. No browser pool, no servers, no patching to maintain.
Generous Free Tier
Sign up for a free API key: 100 requests per month with every Pro feature, no credit card.
Three Detection Sources
Page markup, the BIMI DNS record and the favicon as fallback — the best available asset wins, every time.Standard Library Only
net/http and encoding/json ship with Go — the examples compile with zero external dependencies.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 Gin, Echo, or an avatar worker as a handler in a few lines.Zero Infrastructure
Managed Headless Chrome, autoscaled and load-balanced. No browser pool, no servers, no patching to maintain.Generous Free Tier
Sign up for a free API key: 100 requests per month with every Pro feature, no credit card.
Try it live in the playground
Paste a URL and see the detected logo before you write a line of Go.
Go Logo API FAQ
Everything Go 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 module?
No. The examples use net/http and encoding/json from the Go standard library — they compile with zero external dependencies.
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.Can I hotlink the logo directly?
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?
Yes, and it is free: sign up for an API key and you get 100 requests per month with every Pro feature, no credit card. Add it as x-api-key and start extracting.
When you need more volume, pick a paid plan: same key, bigger quota. See pricing for the limits.
How fresh is the logo?
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 Go
Sign up for a free API key: 100 requests per month with every Pro feature, no credit card. Send your first request and get logos back in minutes.
Free API key
100 requests/month
No credit card