API Documentation
Simple, powerful, and designed for developers
React component
RecommendedThe official drop-in component. Renders an <img>, polls the x-brandicons-state header, and auto-upgrades the placeholder once the real icon arrives — no reload needed.
Live <BrandIcon /> — same component, same API key
import { BrandIcon } from "react-brandicons";export function CompanyLogo() {return (<BrandIcondomain="stripe.com"apiKey="YOUR_API_KEY"size="medium"loadingPlaceholder="@loader-spin"placeholder="@image-off"/>);}
bun add react-brandiconsnpm i react-brandiconspnpm add react-brandiconsQuick Start
Use the following URL pattern to fetch brand icons:
https://cdn.brandicons.dev/icons/{domain}/{size}?key=YOUR_API_KEYSize (path segment):
small— 32×32medium— 64×64 (default)large— 128×128vector— SVG when available
Optional placeholders:
?p=— shown when the icon is definitively not found?pl=— shown while we're still searching
Reference a built-in (e.g. @image-off, @loader-spin, @globe) or one of your own uploaded names. Twelve built-ins are available by default.
Example:
<img src="https://cdn.brandicons.dev/icons/spotify.com/medium?key=YOUR_API_KEY&p=@image-off&pl=@loader-spin" alt="Spotify" />
How Icon Discovery Works
Brandicons uses an intelligent discovery system to find and cache brand icons:
Loading state
On the first request for a new domain we serve your ?pl= placeholder and trigger a background search. Response carries x-brandicons-state: loading with a 10-second TTL.
Found — icon cached
The worker stores the icon globally on our CDN. Subsequent requests return the real icon (no state header) — typically within seconds.
Not found — graceful fallback
If we can't discover an icon, we serve your ?p= placeholder with x-brandicons-state: not-found and a 24-hour TTL.
Auto-upgrade with react-brandicons
The official component reads x-brandicons-state from a HEAD request and refreshes the image when the real icon arrives — no reload needed.
Usage & Caching
API Keys:
Each key is locked to a single domain (e.g. example.com + www.example.com). Keys are public by design — safe to use in <img> tags and client-side code.
Monthly Quota:
Each plan includes a monthly request quota. All requests (cache hits and misses) count toward it. No per-second rate limiting — icons are served directly from CDN edge nodes.
Caching:
Icons are cached globally on the CDN after first discovery. Subsequent requests for the same domain resolve in ~20ms in the browser from the nearest edge.
Frequently Asked Questions
Everything you need to know about BrandIcons and how it simplifies brand icon integration