# Brand Search API

> Search brands by name and get matching logos and domains. AI-powered resolution handles fuzzy matching, aliases, and common misspellings.

## How It Works

1. **Send a search query** — `GET api.loadlogo.com/search?q={query}` with any brand name.
2. **FTS5 full-text search** — The D1 database runs a fast FTS5 query across indexed brand names and domains.
3. **AI fallback** — If FTS5 returns no results, OpenRouter AI resolves the brand name to a domain.
4. **Return results** — Array of matching brands with name, domain, and logo URL.

## Benefits

- Fuzzy matching handles typos, abbreviations, and aliases
- FTS5 provides millisecond search performance
- AI fallback catches edge cases and new brands
- Perfect for autocomplete and search-as-you-type UIs
- Free tier — no API key required
- Returns logo URLs for immediate display

## Code Example

```javascript
// Search for brands
const res = await fetch("https://api.loadlogo.com/search?q=spotify");
const brands = await res.json();
// [{ name: "Spotify", domain: "spotify.com", logo: "https://img.loadlogo.com/spotify.com" }]

// Autocomplete implementation
async function searchBrands(query) {
  const res = await fetch(`https://api.loadlogo.com/search?q=${encodeURIComponent(query)}`);
  return res.json();
}
```

## Related

- [Domain Logo Lookup](/features/domain-lookup.md)
- [Brand Profiles & Colors](/features/brand-profiles.md)
- [Full API Reference](/docs.md)
