### Configuring Referrer Policy in Next.js
Source: https://docs.logo.dev/platform/api-keys
Provides an example of how to set the Referrer-Policy header globally in a Next.js application using the `next.config.js` file. This ensures consistent referrer data transmission for all requests.
```javascript
module.exports = {
async headers() {
return [
{
source: "/:path*",
headers: [
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
],
},
];
},
};
```
--------------------------------
### Example Crypto Logo URL (BTC)
Source: https://docs.logo.dev/logo-images/crypto
This example provides a direct URL for the Bitcoin (BTC) cryptocurrency logo, as served by the Logo.dev service. This URL can be used anywhere an image is accepted, provided you have a valid publishable key.
```html
https://img.logo.dev/crypto/btc?token=LOGO_DEV_PUBLISHABLE_KEY
```
--------------------------------
### Describe API - Example Fetch for sweetgreen.com (Bash)
Source: https://docs.logo.dev/describe/introduction
This bash command demonstrates how to use curl to fetch brand data specifically for 'sweetgreen.com' from the Describe API. It includes the necessary Authorization header. The expected output is a JSON object detailing the brand's information.
```bash
curl --header "Authorization: Bearer LOGO_DEV_SECRET_KEY" "http://api.logo.dev/describe/sweetgreen.com"
```
--------------------------------
### Logo.dev API - Code Examples
Source: https://docs.logo.dev/migrations/clearbit
Examples of how to use the Logo.dev API with your publishable key in various programming languages and frameworks.
```APIDOC
## Logo.dev API - Code Examples
### HTML
```html
```
### React
```jsx
function CompanyLogo({ domain }) {
return (
);
}
```
### Next.js
```tsx
// Add img.logo.dev to your next.config.js:
// module.exports = {
// images: {
// remotePatterns: [
// {
// protocol: 'https',
// hostname: 'img.logo.dev',
// },
// ],
// },
// };
import Image from 'next/image';
function CompanyLogo({ domain }: { domain: string }) {
return (
);
}
```
### Vue
```vue
```
### Python
```python
import requests
def get_company_logo(domain):
url = f"https://img.logo.dev/{domain}?token=LOGO_DEV_PUBLISHABLE_KEY"
response = requests.get(url)
return response.content
```
### Ruby
```ruby
require 'net/http'
def get_company_logo(domain)
uri = URI("https://img.logo.dev/#{domain}?token=LOGO_DEV_PUBLISHABLE_KEY")
Net::HTTP.get(uri)
end
```
### PHP
```php
function getCompanyLogo($domain) {
$url = "https://img.logo.dev/{$domain}?token=LOGO_DEV_PUBLISHABLE_KEY";
return file_get_contents($url);
}
```
### Android (Kotlin)
```kotlin
import com.squareup.picasso.Picasso
fun loadCompanyLogo(domain: String, imageView: ImageView) {
val url = "https://img.logo.dev/$domain?token=LOGO_DEV_PUBLISHABLE_KEY"
Picasso.get()
.load(url)
.placeholder(R.drawable.logo_placeholder)
.into(imageView)
}
// Using Coil (modern Android image loading)
imageView.load("https://img.logo.dev/$domain?token=LOGO_DEV_PUBLISHABLE_KEY") {
placeholder(R.drawable.logo_placeholder)
error(R.drawable.logo_error)
}
```
### Swift (iOS)
```swift
import SwiftUI
struct CompanyLogo: View {
let domain: String
var body: some View {
AsyncImage(url: URL(string: "https://img.logo.dev/(domain)?token=LOGO_DEV_PUBLISHABLE_KEY")) { image in
image
.resizable()
.aspectRatio(contentMode: .fit)
} placeholder: {
ProgressView()
}
.frame(width: 128, height: 128)
}
}
// Using URLSession for direct download
func downloadCompanyLogo(domain: String) async throws -> Data {
let url = URL(string: "https://img.logo.dev/(domain)?token=LOGO_DEV_PUBLISHABLE_KEY")!
let (data, _) = try await URLSession.shared.data(from: url)
return data
}
```
```
--------------------------------
### Display Company Logo for Light Backgrounds
Source: https://docs.logo.dev/logo-images/introduction
This example demonstrates how to adjust the logo's theme for optimal visibility on light backgrounds by setting `theme=light`. This feature requires images with transparency and inverts dark-colored logos.
```html
```
--------------------------------
### Customize Logo Appearance with Parameters
Source: https://docs.logo.dev/logo-images/name
This demonstrates how to customize the appearance of fetched logos using URL parameters. Examples show how to set custom sizes, specify image formats (like PNG), and optimize for different themes (like dark backgrounds). These parameters are appended to the base logo URL.
```html
```
```html
```
```html
```
--------------------------------
### Example Search for 'sweetgreen' (Bash)
Source: https://docs.logo.dev/brand-search/introduction
This bash command shows a practical example of searching for the company 'sweetgreen' using the Brand Search API. It includes the necessary authorization header and the query parameter for the specific brand name.
```bash
curl --header "Authorization: Bearer LOGO_DEV_SECRET_KEY" "https://api.logo.dev/search?q=sweetgreen"
```
--------------------------------
### HTML Example with Logo Grid and Attribution
Source: https://docs.logo.dev/platform/attribution
This example demonstrates how to integrate the Logo.dev attribution link within a typical web page structure. It includes a section for displaying logos and a paragraph for the attribution, ensuring visibility for users.
```html
Logos provided by Logo.dev
```
--------------------------------
### Display Company Logo with API Token
Source: https://docs.logo.dev/logo-images/introduction
This example demonstrates how to include your API token in the image URL to authenticate requests. This is necessary for using the endpoint publicly and to avoid rate-limiting.
```html
```
--------------------------------
### Stock Ticker Logo URL Examples (HTML)
Source: https://docs.logo.dev/logo-images/ticker
Provides direct URL examples for the stock ticker logo API, showcasing how to get a logo for a specific company (Etsy) and the general format for any ticker symbol. These URLs can be used in environments that support image URLs.
```html
https://img.logo.dev/ticker/etsy?token=LOGO_DEV_PUBLISHABLE_KEY
```
```html
https://img.logo.dev/ticker/:symbol?token=LOGO_DEV_PUBLISHABLE_KEY
```
--------------------------------
### URL Encode Brand Names for Logo Fetching
Source: https://docs.logo.dev/logo-images/name
This section demonstrates how to handle brand names that contain spaces or special characters by URL-encoding them. Examples are provided for spaces, special characters like '&', and multi-word names. It also includes a JavaScript example using `encodeURIComponent()` for automatic encoding.
```html
sweet green → sweet%20green
https://img.logo.dev/name/sweet%20green?token=LOGO_DEV_PUBLISHABLE_KEY
```
```html
AT&T → AT%26T https://img.logo.dev/name/AT%26T?token=LOGO_DEV_PUBLISHABLE_KEY
```
```html
The Home Depot → The%20Home%20Depot
https://img.logo.dev/name/The%20Home%20Depot?token=LOGO_DEV_PUBLISHABLE_KEY
```
--------------------------------
### Display Desaturated Company Logo
Source: https://docs.logo.dev/logo-images/introduction
This example shows how to display a desaturated (greyscale) company logo. This is useful for normalizing colors on landing pages. It also specifies PNG format for transparency.
```html
```
--------------------------------
### Setting Per-Image Referrer Policy
Source: https://docs.logo.dev/platform/api-keys
Demonstrates how to specify the referrer policy for an individual image using the `referrerpolicy` attribute. This allows for granular control over referrer data transmission on a per-element basis.
```html
```
--------------------------------
### Setting Referrer Policy via HTML Meta Tag
Source: https://docs.logo.dev/platform/api-keys
Shows how to configure the Referrer-Policy header using an HTML meta tag. This ensures that referrer information is sent with requests, which is crucial for enabling domain restrictions on publishable API keys.
```html
```
--------------------------------
### Logo.dev Image CDN Integration
Source: https://docs.logo.dev/introduction
Examples of how to use the Logo.dev image CDN in different environments. Append your publishable key using the `token` parameter.
```APIDOC
## GET /websites/logo_dev
### Description
Retrieve company logos using the image CDN by appending the company domain and a publishable key.
### Method
GET
### Endpoint
`https://img.logo.dev/{domain}?token=LOGO_DEV_PUBLISHABLE_KEY`
### Query Parameters
- **token** (string) - Required - Your Logo.dev publishable API key.
- **size** (integer) - Optional - The desired size of the logo image (e.g., 256).
- **format** (string) - Optional - The desired image format (e.g., png, jpg, webp).
### Request Example (HTML)
```html
```
### Request Example (React)
```jsx
function CompanyLogo({ domain }) {
return (
);
}
```
### Request Example (Next.js)
```tsx
// next.config.js configuration recommended in the description
import Image from "next/image";
function CompanyLogo({ domain }: { domain: string }) {
return (
);
}
```
### Request Example (Vue)
```vue
```
### Request Example (Python)
```python
logo_url = f"https://img.logo.dev/nike.com?token=LOGO_DEV_PUBLISHABLE_KEY&size=256&format=png"
```
### Request Example (Ruby)
```ruby
logo_url = "https://img.logo.dev/nike.com?token=LOGO_DEV_PUBLISHABLE_KEY&size=256&format=png"
```
### Request Example (PHP)
```php
$logoUrl = "https://img.logo.dev/nike.com?token=LOGO_DEV_PUBLISHABLE_KEY&size=256&format=png";
```
### Request Example (Android)
```java
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
public void loadCompanyLogo(String domain, ImageView imageView) {
String url = "https://img.logo.dev/" + domain + "?token=LOGO_DEV_PUBLISHABLE_KEY";
Picasso.get()
.load(url)
.placeholder(R.drawable.logo_placeholder)
.error(R.drawable.logo_error)
.into(imageView);
}
```
### Request Example (iOS)
```swift
import SwiftUI
struct CompanyLogo: View {
let domain: String
var body: some View {
AsyncImage(url: URL(string: "https://img.logo.dev/(domain)?token=LOGO_DEV_PUBLISHABLE_KEY")) {
image
.resizable()
.aspectRatio(contentMode: .fit)
} placeholder: {
ProgressView()
}
.frame(width: 128, height: 128)
}
}
```
### Response
#### Success Response (200)
The response is the image file itself.
#### Response Example
(Binary image data)
```
--------------------------------
### Describe API - Example JSON Response Structure
Source: https://docs.logo.dev/describe/introduction
This JSON object represents the typical response structure from the Describe API when querying for brand data. It includes fields for the company name, domain, description, indexing timestamp, social media links, logo URL, blurhash for placeholder images, and an array of prominent brand colors.
```json
{
"name": "sweetgreen",
"domain": "sweetgreen.com",
"description": "Simple, seasonal, healthy salads and grain bowls made in-house from scratch, using whole produce delivered that morning.",
"indexed_at": "2025-03-10T11:36:23.885238001Z",
"socials": {
"facebook": "http://facebook.com/sweetgreen",
"instagram": "https://www.instagram.com/sweetgreen/",
"twitter": "https://x.com/sweetgreen"
},
"logo": "https://img.logo.dev/sweetgreen.com?token=LOGO_DEV_PUBLISHABLE_KEY",
"blurhash": "UJPanPxr?Vj[oxazj@od_FWDDoodxrodagWD",
"colors": [
{ "r": 228, "g": 255, "b": 85, "hex": "#e4ff55" },
{ "r": 10, "g": 75, "b": 43, "hex": "#0a4b2b" },
{ "r": 125, "g": 173, "b": 80, "hex": "#7dad50" }
]
}
```
--------------------------------
### GET /websites/logo_dev
Source: https://docs.logo.dev/logo-images/introduction
Retrieves a logo for a given domain. Supports retina image optimization and custom fallback options.
```APIDOC
## GET /websites/logo_dev
### Description
Retrieves a logo for a given domain. Supports retina image optimization and custom fallback options.
### Method
GET
### Endpoint
https://img.logo.dev/{domain}
### Parameters
#### Query Parameters
- **token** (string) - Required - Your publishable API key.
- **size** (integer) - Optional - The desired size of the logo in pixels (e.g., 80).
- **retina** (boolean) - Optional - Set to `true` to double the source image resolution for sharp display on high-density screens. Defaults to `false`.
- **fallback** (string) - Optional - Set to `404` to suppress fallback monograms and receive a `404 Not Found` status code when no image is found. Defaults to returning a monogram.
### Request Example
```json
{
"example": "https://img.logo.dev/shopify.com?token=LOGO_DEV_PUBLISHABLE_KEY&size=80&retina=true"
}
```
### Response
#### Success Response (200)
- **image** (string) - URL to the requested logo image. If `fallback=404` is not used and no logo is found, this will be a URL to a monogram.
#### Response Example
```json
{
"example": "https://img.logo.dev/shopify.com?token=LOGO_DEV_PUBLISHABLE_KEY&size=80&retina=true"
}
```
#### Error Response (404)
Returned when `fallback=404` is set and no logo is found for the domain.
### Fallback Behavior
When an image is not found for a domain and the `fallback` parameter is not set to `404`, the API returns a black and white monogram of the first letter of the domain with a `200 OK` status code.
```
--------------------------------
### Default Typeahead Search Example (Bash)
Source: https://docs.logo.dev/brand-search/introduction
This bash command illustrates the default behavior of the Brand Search API, which is the 'typeahead' strategy. This strategy is optimized for autosuggest and favors popular prefix matches, useful for live search user experiences.
```bash
curl --header "Authorization: Bearer LOGO_DEV_SECRET_KEY"
"https://api.logo.dev/search?q=fa"
```
--------------------------------
### Authenticate Logo.dev API with Publishable Key
Source: https://docs.logo.dev/migrations/clearbit
To authenticate API requests with Logo.dev, you need to obtain a Publishable Key from your account dashboard. This key should be appended to your API URLs as a 'token' parameter. The examples demonstrate how to integrate this authentication across various web and mobile development platforms.
```bash
LOGO_DEV_PUBLISHABLE_KEY=pk_xxxxxxxxxxxx
```
```bash
https://img.logo.dev/:domain?token=LOGO_DEV_PUBLISHABLE_KEY
```
```html
```
```jsx
function CompanyLogo({ domain }) {
return (
);
}
```
```tsx
// Add img.logo.dev to your next.config.js:
// module.exports = {
// images: {
// remotePatterns: [
// {
// protocol: 'https',
// hostname: 'img.logo.dev',
// },
// ],
// },
// };
import Image from 'next/image';
function CompanyLogo({ domain }: { domain: string }) {
return (
);
}
```
```vue
```
```python
import requests
def get_company_logo(domain):
url = f"https://img.logo.dev/{domain}?token=LOGO_DEV_PUBLISHABLE_KEY"
response = requests.get(url)
return response.content
```
```ruby
require 'net/http'
def get_company_logo(domain)
uri = URI("https://img.logo.dev/#{domain}?token=LOGO_DEV_PUBLISHABLE_KEY")
Net::HTTP.get(uri)
end
```
```php
function getCompanyLogo($domain) {
$url = "https://img.logo.dev/{$domain}?token=LOGO_DEV_PUBLISHABLE_KEY";
return file_get_contents($url);
}
```
```kotlin
import com.squareup.picasso.Picasso
fun loadCompanyLogo(domain: String, imageView: ImageView) {
val url = "https://img.logo.dev/$domain?token=LOGO_DEV_PUBLISHABLE_KEY"
Picasso.get()
.load(url)
.placeholder(R.drawable.logo_placeholder)
.into(imageView)
}
// Using Coil (modern Android image loading)imageView.load("https://img.logo.dev/$domain?token=LOGO_DEV_PUBLISHABLE_KEY") {
placeholder(R.drawable.logo_placeholder)
error(R.drawable.logo_error)
}
```
```swift
import SwiftUI
struct CompanyLogo: View {
let domain: String
var body: some View {
AsyncImage(url: URL(string: "https://img.logo.dev/(domain)?token=LOGO_DEV_PUBLISHABLE_KEY")) {
image -> Image in
image
.resizable()
.aspectRatio(contentMode: .fit)
} placeholder: {
ProgressView()
}
.frame(width: 128, height: 128)
}
}
// Using URLSession for direct download
func downloadCompanyLogo(domain: String) async throws -> Data {
let url = URL(string: "https://img.logo.dev/(domain)?token=LOGO_DEV_PUBLISHABLE_KEY")!
let (data, _) = try await URLSession.shared.data(from: url)
return data
}
```
--------------------------------
### Get Company Logos by Domain
Source: https://docs.logo.dev/logo-images/get
Fetch company logos based on a domain name. You can customize the size, format, greyscale, theme, retina display support, and fallback options.
```APIDOC
## GET /websites/logo_dev
### Description
Retrieves company logos based on a domain name with various customization options.
### Method
GET
### Endpoint
/websites/logo_dev
### Parameters
#### Query Parameters
- **token** (string) - Required - Your publishable key. Get it from the [dashboard](https://www.logo.dev/dashboard/api-keys).
- **size** (integer) - Optional - The desired width and height of the logo in pixels. The image will maintain its aspect ratio. (default: 128)
- **format** (string) - Optional - The image format to return. Options: jpg (Smaller file size without transparency), png (Highest quality with transparency support), webp (Modern format with optimal compression). (default: jpg)
- **greyscale** (boolean) - Optional - Returns a black and white version of the logo. (default: false)
- **theme** (string) - Optional - Adjusts logo colors for light or dark backgrounds. Only works on images with transparency. Options: auto (No color adjustment applied), light (Inverts logos with dominant dark colors for light backgrounds), dark (Inverts logos with dominant light colors for dark backgrounds). (default: auto)
- **retina** (boolean) - Optional - Returns a high-density image at 2x the requested size for sharp display on retina screens. (default: false)
- **fallback** (string) - Optional - Returns a fallback image if the logo is not found. Options: monogram (Generates a monogram from the first letter of the domain), 404 (Returns a 404 error instead of an image). (default: monogram)
### Request Example
```json
{
"example": "/websites/logo_dev?token=YOUR_TOKEN&size=256&format=png&greyscale=true"
}
```
### Response
#### Success Response (200)
- The response will be an image file in the specified format.
#### Response Example
(Image data would be presented here in a real documentation scenario, not as JSON)
```
--------------------------------
### Specify Exchange for Stock Ticker Logos (HTML)
Source: https://docs.logo.dev/logo-images/ticker
Illustrates how to specify different stock exchanges when fetching a company's logo using the Logo.dev API. Examples include fetching Apple's logo from American markets (default), the London Stock Exchange, and Toyota's logo from the Tokyo Stock Exchange.
```html
```
```html
```
```html
```
--------------------------------
### Store Logo in Google Cloud Storage (JavaScript)
Source: https://docs.logo.dev/platform/self-hosting
Illustrates how to upload a logo to Google Cloud Storage using the `@google-cloud/storage` library. This example covers saving the logo file with the correct content type.
```javascript
import { Storage } from "@google-cloud/storage";
const storage = new Storage();
const bucket = storage.bucket("your-bucket");
async function storeInGCS(domain) {
const response = await fetch(
`https://img.logo.dev/${domain}?token=${LOGO_DEV_PUBLISHABLE_KEY}&format=webp`
);
const buffer = await response.arrayBuffer();
await bucket.file(`logos/${domain}.webp`).save(Buffer.from(buffer), {
contentType: "image/webp",
});
}
```
--------------------------------
### Using Secret API Key for Server-Side API Calls
Source: https://docs.logo.dev/platform/api-keys
Illustrates how to use a secret API key for server-side requests to Logo.dev API endpoints, such as search. This key requires traditional server-side protection and should never be exposed publicly.
```javascript
// Server-side only
const response = await fetch("https://api.logo.dev/search?q=nike", {
headers: {
Authorization: `Bearer LOGO_DEV_SECRET_KEY`,
},
});
```
--------------------------------
### GET /name/:brand
Source: https://docs.logo.dev/logo-images/name
Retrieve a brand logo by its name. The brand name should be URL-encoded if it contains spaces or special characters.
```APIDOC
## GET /name/:brand
### Description
Retrieves a brand logo by its name.
### Method
GET
### Endpoint
`/name/:brand`
### Parameters
#### Path Parameters
- **brand** (string) - Required - The name of the brand (e.g., "shopify"). Must be URL-encoded if it contains spaces or special characters.
#### Query Parameters
- **token** (string) - Required - Your Logo.dev publishable key.
- **size** (integer) - Optional - Resize logos (default: 128px).
- **format** (string) - Optional - Choose png, jpg, or webp.
- **theme** (string) - Optional - Optimize for light or dark backgrounds (e.g., "dark").
- **greyscale** (boolean) - Optional - Convert to greyscale.
- **fallback** (string) - Optional - Control fallback behavior (e.g., "404").
### Request Example
```html
```
### Response
#### Success Response (200)
The response will be an image file of the requested logo.
#### Response Example
(Image data)
#### Error Response
- **404** - If the brand is not found and fallback is set to "404".
```
--------------------------------
### Describe API - Fetch Brand Data by Domain (Bash)
Source: https://docs.logo.dev/describe/introduction
This bash command uses curl to query the Describe API for brand information associated with a specific domain. It requires an Authorization header with your secret key. The output is a JSON object containing details like name, description, social links, logo URL, blurhash, and prominent colors.
```bash
curl --header "Authorization: Bearer LOGO_DEV_SECRET_KEY" "http://api.logo.dev/describe/:domain"
```
--------------------------------
### Describe API - Get Company Logos & Brand Data
Source: https://docs.logo.dev/describe/introduction
This endpoint retrieves brand information, including logos, colors, and social links, for a specified domain.
```APIDOC
## GET /describe/:domain
### Description
Retrieves comprehensive brand data for a given domain, including name, description, logo URL, social media links, dominant colors, and blurhash representation of the logo.
### Method
GET
### Endpoint
`/describe/:domain`
### Parameters
#### Path Parameters
- **domain** (string) - Required - The domain name for which to retrieve brand data (e.g., `sweetgreen.com`).
#### Query Parameters
None
#### Request Body
None
### Request Example
```bash
curl --header "Authorization: Bearer LOGO_DEV_SECRET_KEY" "http://api.logo.dev/describe/sweetgreen.com"
```
### Response
#### Success Response (200)
- **name** (string) - The name of the brand.
- **domain** (string) - The domain name provided in the request.
- **description** (string) - A brief description of the brand.
- **indexed_at** (string) - The timestamp when the brand data was last indexed.
- **socials** (object) - Key-value pairs of social media platforms and their corresponding URLs.
- **facebook** (string) - URL for the brand's Facebook page.
- **instagram** (string) - URL for the brand's Instagram profile.
- **twitter** (string) - URL for the brand's Twitter profile.
- **logo** (string) - A URL to the brand's logo image.
- **blurhash** (string) - A blurhash string representing a placeholder for the logo.
- **colors** (array) - An array of objects, each representing a prominent color in the logo.
- **r** (integer) - Red component of the color.
- **g** (integer) - Green component of the color.
- **b** (integer) - Blue component of the color.
- **hex** (string) - Hexadecimal representation of the color.
#### Response Example
```json
{
"name": "sweetgreen",
"domain": "sweetgreen.com",
"description": "Simple, seasonal, healthy salads and grain bowls made in-house from scratch, using whole produce delivered that morning.",
"indexed_at": "2025-03-10T11:36:23.885238001Z",
"socials": {
"facebook": "http://facebook.com/sweetgreen",
"instagram": "https://www.instagram.com/sweetgreen/",
"twitter": "https://x.com/sweetgreen"
},
"logo": "https://img.logo.dev/sweetgreen.com?token=LOGO_DEV_PUBLISHABLE_KEY",
"blurhash": "UJPanPxr?Vj[oxazj@od_FWDDoodxrodagWD",
"colors": [
{ "r": 228, "g": 255, "b": 85, "hex": "#e4ff55" },
{ "r": 10, "g": 75, "b": 43, "hex": "#0a4b2b" },
{ "r": 125, "g": 173, "b": 80, "hex": "#7dad50" }
]
}
```
```
--------------------------------
### Store Logo in AWS S3 (JavaScript)
Source: https://docs.logo.dev/platform/self-hosting
Provides an example of storing a fetched logo directly into an AWS S3 bucket using the AWS SDK for JavaScript. It includes uploading the logo with appropriate content type and cache control settings.
```javascript
import AWS from "aws-sdk";
const s3 = new AWS.S3();
async function storeInS3(domain) {
const response = await fetch(
`https://img.logo.dev/${domain}?token=${LOGO_DEV_PUBLISHABLE_KEY}&format=webp`
);
const buffer = await response.arrayBuffer();
await s3
.putObject({
Bucket: "your-bucket",
Key: `logos/${domain}.webp`,
Body: Buffer.from(buffer),
ContentType: "image/webp",
CacheControl: "public, max-age=31536000",
})
.promise();
}
```
--------------------------------
### Search for Company Domains by Name (Bash)
Source: https://docs.logo.dev/brand-search/introduction
This example demonstrates how to use curl to query the Brand Search API for company domains. It requires a secret key for authentication and accepts a query parameter for the brand name. The API returns a JSON array of company objects.
```bash
curl --header "Authorization: Bearer LOGO_DEV_SECRET_KEY" "https://api.logo.dev/search?q=:query"
```
--------------------------------
### Get Crypto Logo
Source: https://docs.logo.dev/logo-images/crypto
Retrieve a cryptocurrency logo by its symbol. You need to include your publishable API key in the request.
```APIDOC
## GET /crypto/:symbol
### Description
This endpoint allows you to fetch the logo for a specific cryptocurrency based on its symbol.
### Method
GET
### Endpoint
`/crypto/:symbol`
### Parameters
#### Path Parameters
- **symbol** (string) - Required - The symbol of the cryptocurrency (e.g., `eth`, `btc`).
#### Query Parameters
- **token** (string) - Required - Your publishable API key (e.g., `LOGO_DEV_PUBLISHABLE_KEY`).
- **size** (integer) - Optional - The desired size of the logo in pixels (e.g., `200`).
### Request Example
```html
```
### Response
#### Success Response (200)
The response will be an image file of the cryptocurrency logo.
#### Response Example
(Image data)
```
--------------------------------
### Logo API - Get Company Logos Instantly
Source: https://docs.logo.dev/logo-images/introduction
This API allows you to retrieve company logos using different lookup modes such as domain, stock ticker, crypto symbol, ISIN, or company name. You can customize the output by specifying size, format, theme, greyscale, and fallback options.
```APIDOC
## Logo API Endpoints
### Get Company Logos by Domain
#### Description
Retrieves company logos when you have verified domains (e.g., `shopify.com`). This is the most reliable lookup method.
#### Method
GET
#### Endpoint
`/logo-images/get`
#### Query Parameters
- **token** (string) - Required - Your publishable API key.
- **size** (integer) - Optional - The desired size of the logo in pixels (default: 128).
- **format** (string) - Optional - The desired image format (e.g., `jpg`, `png`, `webp`) (default: `jpg`).
- **theme** (string) - Optional - Adjusts logo colors for light or dark backgrounds (`dark`, `light`, `auto`) (default: `auto`).
- **greyscale** (boolean) - Optional - Returns the logo in greyscale (default: `false`).
- **fallback** (string) - Optional - Fallback to use if the logo is not found (e.g., `monogram`) (default: `monogram`).
### Get Company Logos by Stock Ticker
#### Description
Retrieves company logos using stock ticker symbols (e.g., `AAPL`, `TSLA`). Ideal for financial applications.
#### Method
GET
#### Endpoint
`/logo-images/ticker`
#### Query Parameters
- **token** (string) - Required - Your publishable API key.
- **size** (integer) - Optional - The desired size of the logo in pixels (default: 128).
- **format** (string) - Optional - The desired image format (e.g., `jpg`, `png`, `webp`) (default: `jpg`).
- **theme** (string) - Optional - Adjusts logo colors for light or dark backgrounds (`dark`, `light`, `auto`) (default: `auto`).
- **greyscale** (boolean) - Optional - Returns the logo in greyscale (default: `false`).
- **fallback** (string) - Optional - Fallback to use if the logo is not found (e.g., `monogram`) (default: `monogram`).
### Get Company Logos by Crypto Symbol
#### Description
Retrieves cryptocurrency logos using their symbols (e.g., `BTC`, `ETH`).
#### Method
GET
#### Endpoint
`/logo-images/crypto`
#### Query Parameters
- **token** (string) - Required - Your publishable API key.
- **size** (integer) - Optional - The desired size of the logo in pixels (default: 128).
- **format** (string) - Optional - The desired image format (e.g., `jpg`, `png`, `webp`) (default: `jpg`).
- **theme** (string) - Optional - Adjusts logo colors for light or dark backgrounds (`dark`, `light`, `auto`) (default: `auto`).
- **greyscale** (boolean) - Optional - Returns the logo in greyscale (default: `false`).
- **fallback** (string) - Optional - Fallback to use if the logo is not found (e.g., `monogram`) (default: `monogram`).
### Get Company Logos by ISIN
#### Description
Retrieves company logos using the International Securities Identification Number (ISIN) (e.g., `US0378331005`).
#### Method
GET
#### Endpoint
`/logo-images/isin`
#### Query Parameters
- **token** (string) - Required - Your publishable API key.
- **size** (integer) - Optional - The desired size of the logo in pixels (default: 128).
- **format** (string) - Optional - The desired image format (e.g., `jpg`, `png`, `webp`) (default: `jpg`).
- **theme** (string) - Optional - Adjusts logo colors for light or dark backgrounds (`dark`, `light`, `auto`) (default: `auto`).
- **greyscale** (boolean) - Optional - Returns the logo in greyscale (default: `false`).
- **fallback** (string) - Optional - Fallback to use if the logo is not found (e.g., `monogram`) (default: `monogram`).
### Get Company Logos by Company Name
#### Description
Retrieves company logos when you only have the company's brand name (e.g., `Shopify`, `Tesla`).
#### Method
GET
#### Endpoint
`/logo-images/name`
#### Query Parameters
- **token** (string) - Required - Your publishable API key.
- **size** (integer) - Optional - The desired size of the logo in pixels (default: 128).
- **format** (string) - Optional - The desired image format (e.g., `jpg`, `png`, `webp`) (default: `jpg`).
- **theme** (string) - Optional - Adjusts logo colors for light or dark backgrounds (`dark`, `light`, `auto`) (default: `auto`).
- **greyscale** (boolean) - Optional - Returns the logo in greyscale (default: `false`).
- **fallback** (string) - Optional - Fallback to use if the logo is not found (e.g., `monogram`) (default: `monogram`).
### Request Example (using domain)
```html
```
### Response Example (Success)
```json
{
"url": "https://img.logo.dev/shopify.com?token=live_6a1a28fd-6420-4492-aeb0-b297461d9de2&size=256&format=png&theme=dark&greyscale=true"
}
```
### Rate Limiting
Public endpoints are subject to rate limits. To avoid limits, obtain an API key or upgrade your account. Refer to the [rate limiting policies](/platform/rate-limits) for more details.
### Error Handling
Specific error codes and messages will be provided in the response body for failed requests. Common errors include invalid tokens, incorrect parameters, or resource not found.
```
--------------------------------
### GET /isin/:isin
Source: https://docs.logo.dev/logo-images/isin
Retrieves the logo associated with a given ISIN code. The endpoint requires a publishable key for authentication.
```APIDOC
## GET /isin/:isin
### Description
This endpoint allows you to fetch a company logo by providing its International Securities Identification Number (ISIN). The API maps the ISIN to the company's domain to retrieve the official brand asset.
### Method
GET
### Endpoint
`https://img.logo.dev/isin/:isin`
### Parameters
#### Path Parameters
- **isin** (string) - Required - The 12-character ISIN code for the security.
#### Query Parameters
- **token** (string) - Required - Your publishable API key obtained from the Logo.dev dashboard.
- **size** (integer) - Optional - The desired size of the logo in pixels (e.g., 200).
### Request Example
```html
```
### Response
#### Success Response (200)
- **Image URL** (string) - The URL to the company's logo.
#### Response Example
```html
https://img.logo.dev/isin/US0378331005?token=YOUR_PUBLISHABLE_KEY&size=200
```
### Error Handling
- If an invalid ISIN is provided, the response may be a 404 or a default/error image.
- If the token is missing or invalid, the request will be unauthorized.
```
--------------------------------
### General Crypto Logo URL Format
Source: https://docs.logo.dev/logo-images/crypto
This snippet shows the general format for a cryptocurrency logo image URL from Logo.dev. You can use this pattern to dynamically generate URLs for various cryptocurrencies by replacing ':symbol' and using your publishable key.
```html
https://img.logo.dev/crypto/:symbol?token=LOGO_DEV_PUBLISHABLE_KEY
```
--------------------------------
### Generate Retina-Optimized Images with HTML
Source: https://docs.logo.dev/logo-images/introduction
This snippet demonstrates how to embed an image using an HTML `
` tag, leveraging the `retina=true` parameter from the Logo.dev API. This parameter ensures the image appears sharp on high-density displays by serving a higher resolution image at the specified display size. The `src` attribute includes the domain, API key, desired size, and the retina flag.
```html
```
--------------------------------
### Display Company Logo for Dark Backgrounds
Source: https://docs.logo.dev/logo-images/introduction
This snippet shows how to adjust the logo's theme for optimal visibility on dark backgrounds by setting `theme=dark`. This feature requires images with transparency and inverts light-colored logos.
```html
```
--------------------------------
### Display Company Logos with Logo.dev Image CDN
Source: https://docs.logo.dev/introduction
This snippet demonstrates how to embed company logos using the Logo.dev image CDN. It requires a publishable API key and supports various domains. The examples cover HTML, React, Next.js, Vue, Python, Ruby, PHP, Android, and iOS.
```html
```
```jsx
function CompanyLogo({ domain }) {
return (
);
}
```
```tsx
// Add img.logo.dev to your next.config.js:
// module.exports = {
// images: {
// remotePatterns: [
// {
// protocol: 'https',
// hostname: 'img.logo.dev',
// },
// ],
// },
// };
import Image from "next/image";
function CompanyLogo({ domain }: { domain: string }) {
return (
);
}
```
```vue
```
```python
logo_url = f"https://img.logo.dev/nike.com?token=LOGO_DEV_PUBLISHABLE_KEY&size=256&format=png"
```
```ruby
logo_url = "https://img.logo.dev/nike.com?token=LOGO_DEV_PUBLISHABLE_KEY&size=256&format=png"
```
```php
$logoUrl = "https://img.logo.dev/nike.com?token=LOGO_DEV_PUBLISHABLE_KEY&size=256&format=png";
```
```java
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
public void loadCompanyLogo(String domain, ImageView imageView) {
String url = "https://img.logo.dev/" + domain + "?token=LOGO_DEV_PUBLISHABLE_KEY";
Picasso.get()
.load(url)
.placeholder(R.drawable.logo_placeholder)
.error(R.drawable.logo_error)
.into(imageView);
}
```
```swift
import SwiftUI
struct CompanyLogo: View {
let domain: String
var body: some View {
AsyncImage(url: URL(string: "https://img.logo.dev/(domain)?token=LOGO_DEV_PUBLISHABLE_KEY")) { image in
image
.resizable()
.aspectRatio(contentMode: .fit)
} placeholder: {
ProgressView()
}
.frame(width: 128, height: 128)
}
}
```
--------------------------------
### General Crypto Logo Format (HTML)
Source: https://docs.logo.dev/logo-images/crypto
This snippet illustrates the general format for embedding any cryptocurrency logo using the Logo.dev service. Replace ':symbol' with the desired cryptocurrency's symbol and ensure your publishable key is included.
```html
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.