PHP Logo API
Get the logo behind any URL with one HTTP request in PHP — 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 PHP
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 the file_get_contents and cURL that ship with PHP.
Step 01 · Extract any URL
A few lines of plain PHP — no Composer package to add. Point it at a domain and read the logo from the JSON response.
logo.php
<?php
$query = http_build_query(['url' => 'https://stripe.com']);
$res = json_decode(file_get_contents("https://api.microlink.io?$query"), true);
$logo = $res['data']['logo'];
echo $logo['url']; // absolute, hotlink-ready
echo $logo['type']; // 'png'
echo $logo['width']; // 180
echo $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.php
<?php
$query = http_build_query([
'url' => 'https://stripe.com',
'palette' => 'true' // add the brand palette to every detected image
]);
$res = json_decode(file_get_contents("https://api.microlink.io?$query"), true);
// Ordered from most dominant color to least
print_r($res['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.php
<?php
$query = http_build_query([
'url' => 'https://app.example.com',
'prerender' => 'true', // render JS in a real browser first
'waitForSelector' => 'h1' // detect only when the content exists
]);
$res = json_decode(file_get_contents("https://api.microlink.io?$query"), true);
// Icons injected by client-side JavaScript are found too
echo $res['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.php
<?php
$query = http_build_query([
'url' => 'https://stripe.com',
'embed' => 'logo.url' // the API URL becomes the image itself
]);
$logoUrl = "https://api.microlink.io?$query";
// Drop it straight into an <img> tag — no JSON parsing
echo '<img src="' . $logoUrl . '" alt="stripe logo" />';Drop it into your framework
A Laravel redirect, a Symfony proxy, or a WordPress shortcode — the same request becomes your own logo endpoint.
- Laravel
- Symfony
- WordPress
- Plain PHP
<?php
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Contracts\HttpClient\HttpClientInterface;
class LogoController
{
#[Route('/logo')]
public function show(HttpClientInterface $http): Response
{
$res = $http->request('GET', 'https://api.microlink.io', [
'query' => [
'url' => 'https://stripe.com',
'embed' => 'logo.url',
],
]);
return new Response($res->getContent(), 200, [
'Content-Type' => $res->getHeaders()['content-type'][0],
]);
}
}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 PHP
- One HTTP request — file_get_contents, 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 PHP.
A REST API that feels native in PHP — one call, JSON back, and at home in anything from a script to a WordPress theme. 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.
No Composer Package
file_get_contents and cURL ship with PHP — the examples work with nothing 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 Laravel, Symfony, or WordPress as a route, controller or shortcode.
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.No Composer Package
file_get_contents and cURL ship with PHP — the examples work with nothing 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 Laravel, Symfony, or WordPress as a route, controller or shortcode.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 PHP.
PHP Logo API FAQ
Everything PHP 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 file_get_contents and the cURL extension that ship with PHP. If you already use Guzzle or Laravel’s HTTP client, 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 PHP
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