> ## Documentation Index
> Fetch the complete documentation index at: https://devshine-cbff6863.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Best Practices

> Optimize your Logo API integration for reliability, speed, accessibility, and SEO.

Optimize your Logo API integration for reliability, speed, accessibility, and SEO.
Follow these best practices to make sure brand logos load quickly, display correctly, and provide a better user experience inside your application.

## 1. Use the Client ID

Always include your Client ID using the `?c=` query parameter in every Logo API request.
This helps track your usage accurately and ensures your requests are handled reliably without unnecessary throttling.

**Correct**

```html theme={null}
<img src="https://cdn.brandapi.io/github.com?c=MY_CLIENT_ID" />
```

**Incorrect**

```html theme={null}
<img src="https://cdn.brandapi.io/github.com" />
```

## 2. Set Alt Text

For accessibility and SEO, always provide meaningful alt text for logo images.
In most cases, the alt text should identify the brand name clearly. If the logo is purely decorative, you can use an empty `alt=""`.

```html theme={null}
<img
  src="https://cdn.brandapi.io/github.com?c=ID"
  alt="GitHub logo"
/>
```

## 3. Specify Dimensions

Always define the image width and height to prevent layout shifts and improve page experience.
You can use Logo API sizing parameters to request the exact logo size you need from the CDN.

```html theme={null}
<img
  src="https://cdn.brandapi.io/github.com/h/64/w/64?c=ID"
  width="64"
  height="64"
  alt="GitHub logo"
/>
```

Specifying dimensions helps reduce Cumulative Layout Shift (CLS) and keeps your interface stable while images load.

## 4. Implement Smart Fallbacks

Logo API supports millions of brands, but some logos may occasionally be unavailable.
Use built-in fallback options to keep your UI clean even when a logo cannot be found.

### Built-in Fallback

```html theme={null}
<img
  src="https://cdn.brandapi.io/unknown.com/fallback/lettermark/icon?c=ID"
  alt="Fallback company logo"
/>
```

You can also implement a custom fallback inside your frontend application when needed.

## 5. Use Modern Image Formats

By default, Logo API serves images in WebP format.
WebP provides strong image quality with smaller file sizes compared to PNG or JPEG, helping logos load faster across your website or application.
Use the default WebP format unless your project has specific compatibility requirements.

## 6. Prefer SVG for Full Logos

When using the `logo` type, which usually represents the full company wordmark, SVG is often the best format.
SVG keeps logos crisp at different screen sizes, zoom levels, and resolutions.

```html theme={null}
<img
  src="https://cdn.brandapi.io/github.com/logo.svg?c=ID"
  alt="GitHub full logo"
/>
```

## 7. Avoid Re-Hosting Logos

Do not download and re-host logos on your own servers.
Re-hosting prevents your application from receiving automatic logo updates when a brand changes its identity.
Using the Logo API CDN directly keeps your UI current, reduces maintenance, and improves logo delivery performance.
