Ruby Logo API
Get the logo behind any URL with one HTTP request in Ruby — 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 Ruby
No gem 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 JSON from the Ruby standard library.
Step 01 · Extract any URL
A few lines with the standard library — no gem to add. Point it at a domain and read the logo from the JSON response.
logo.rb
require 'json'
require 'net/http'
require 'uri'
uri = URI('https://api.microlink.io')
uri.query = URI.encode_www_form(url: 'https://stripe.com')
logo = JSON.parse(Net::HTTP.get(uri)).dig('data', 'logo')
puts logo['url'] # absolute, hotlink-ready
puts logo['type'] # 'png'
puts logo['width'] # 180
puts 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.rb
require 'json'
require 'net/http'
require 'uri'
uri = URI('https://api.microlink.io')
uri.query = URI.encode_www_form(
url: 'https://stripe.com',
palette: 'true' # add the brand palette to every detected image
)
logo = JSON.parse(Net::HTTP.get(uri)).dig('data', 'logo')
# Ordered from most dominant color to least
puts 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.rb
require 'json'
require 'net/http'
require 'uri'
uri = URI('https://api.microlink.io')
uri.query = URI.encode_www_form(
url: 'https://app.example.com',
prerender: 'true', # render JS in a real browser first
waitForSelector: 'h1' # detect only when the content exists
)
logo = JSON.parse(Net::HTTP.get(uri)).dig('data', 'logo')
# Icons injected by client-side JavaScript are found too
puts 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.rb
require 'uri'
uri = URI('https://api.microlink.io')
uri.query = URI.encode_www_form(
url: 'https://stripe.com',
embed: 'logo.url' # the API URL becomes the image itself
)
# Drop it straight into an <img> tag — no JSON parsing
puts %(<img src="#{uri}" alt="stripe logo" />)Drop it into your framework
A Rails redirect, a Sinatra proxy, or a brand-avatar job — the same request becomes your own logo endpoint.
- Rails
- Sinatra
- Brand Avatar
- Plain Ruby
require 'sinatra'
require 'net/http'
require 'uri'
# GET /logo?url=https://stripe.com
get '/logo' do
uri = URI('https://api.microlink.io')
uri.query = URI.encode_www_form(url: params[:url], embed: 'logo.url')
upstream = Net::HTTP.get_response(uri)
content_type upstream.content_type
upstream.body
endSkip 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 Ruby
- One HTTP request — Net::HTTP, no gem 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 Ruby.
A REST API that feels native in Ruby — one call, JSON back, and at home in anything from a script to a background job. 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 JSON ship with Ruby — the examples work with zero gems to install.
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 Rails, Sinatra, or a Sidekiq job as a controller action or a few-line worker.
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
Net::HTTP and JSON ship with Ruby — the examples work with zero gems to install.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 Rails, Sinatra, or a Sidekiq job as a controller action or a few-line worker.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 Ruby.
Ruby Logo API FAQ
Everything Ruby 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 gem?
No. Net::HTTP and JSON are part of the Ruby standard library, so the examples work with zero dependencies. If you already use faraday or httparty, the same request translates directly.
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?
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.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 Ruby
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