- Show a logo. The Logo.dev CDN is a URL. Your app loads
https://img.logo.dev/{domain}with a publishable key, and no server is involved. - Call the API. Brand returns a company’s name, logo, colors, and more as JSON from
GET /v2/brands. Call it from your server with a secret key.
Keys
Get your API keys
Your dashboard has a publishable key for the Logo.dev CDN and a secret key for the Logo.dev API. Every plan includes both.
The samples use the placeholders
LOGO_DEV_PUBLISHABLE_KEY and LOGO_DEV_SECRET_KEY. Replace LOGO_DEV_PUBLISHABLE_KEY with your publishable key. The server samples read LOGO_DEV_SECRET_KEY from an environment variable, so set it to your secret key.
To stop other websites from using your publishable key, add domain restrictions. Restrictions check the Referer header that a web browser sends. Native Flutter, Swift, and Kotlin apps send no Referer, so with restrictions on, their logo requests return 401. Do not turn on restrictions for a key that a native app uses.
Show a logo
Each sample loads the logo for a domain at 64 pixels, withretina=true for dense screens. format=png keeps the background transparent. For the other parameters, see the CDN overview.
- Flutter
- Swift
- Kotlin
- Java
- PHP
- Apex
- Vue
company_logo.dart
Call the API
Each sample sendsGET https://api.logo.dev/v2/brands?domain=... with the secret key, waits up to 20 seconds, and reads the brand from data. Run it on your server. Never ship the secret key in a mobile app or a web page.
- Flutter
- Swift
- Kotlin
- Java
- PHP
- Apex
- Vue
This sample is Dart for a server, such as a Shelf app. Add the
http package.brand.dart
Handle each status
Only a200 carries a brand. The samples return no brand for 202 and 404 (Java throws), and throw for any other status.
data.logo.url is a signed download URL that stops working after about 24 hours. Download the file if you need to keep it. See images. For the full response, see Brand.
Next steps
CDN parameters
Size, format, theme, and lookups by name, ticker, or ISIN.
Brand
Every identifier, field, and status the API returns.
Keys and restrictions
Create keys and limit a publishable key to your domains.
Rate limits
Check the limits before you ship.