# Using the CardSight AI API - Manufacturer Search API

## Overview
List and search for card manufacturers in the CardSight AI catalog. Manufacturers are companies that produce trading cards like Topps, Panini, and Upper Deck.

## Endpoint Details
- **Method**: GET
- **URL**: `https://api.cardsight.ai/v1/catalog/manufacturers`
- **Authentication**: API Key required (X-Api-Key header)

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| name | string | No | Filter manufacturers by name (partial match, case-insensitive) |
| take | integer | No | Results per page (1-100, default: 20) |
| skip | integer | No | Number of results to skip for pagination |
| sort | string | No | Sort by: name |
| order | string | No | Sort order: asc, desc (default: asc) |

## Using the CardSight AI SDK (Recommended)

### Node.js / TypeScript
```typescript
import { CardSightAI } from 'cardsightai'

const client = new CardSightAI({ apiKey: 'your-api-key' })

// Get all manufacturers
const response = await client.catalog.manufacturers()

// Search with filters
const filteredResponse = await client.catalog.manufacturers({
  name: 'Topps',
  take: 20
})

// Always check for errors
if (response.error) {
  console.error('Error:', response.error)
} else {
  console.log(`Found ${response.data.total_count} manufacturers`)

  for (const manufacturer of response.data.manufacturers) {
    console.log(`${manufacturer.name} (ID: ${manufacturer.id})`)
  }
}
```

### Python
```python
from cardsightai import CardSightAI

client = CardSightAI(api_key='your-api-key')

# Get all manufacturers
response = client.catalog.manufacturers()

print(f"Found {response.total_count} manufacturers")
for manufacturer in response.manufacturers:
    print(f"- {manufacturer.name}")
```

## Direct API Call (cURL)
```bash
curl -X GET "https://api.cardsight.ai/v1/catalog/manufacturers?take=20" \
  -H "X-Api-Key: your-api-key"
```

## Example Response
```json
{
  "manufacturers": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Topps",
      "description": "Leading sports card manufacturer since 1938"
    },
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "name": "Panini America",
      "description": "Global trading card company"
    },
    {
      "id": "550e8400-e29b-41d4-a716-446655440002",
      "name": "Upper Deck",
      "description": "Premium sports and entertainment cards"
    }
  ],
  "total_count": 45,
  "skip": 0,
  "take": 20
}
```

## Response Fields

| Field | Type | Description |
|-------|------|-------------|
| manufacturers | array | Array of manufacturer objects |
| total_count | number | Total number of matching manufacturers |
| skip | number | Number of results skipped |
| take | number | Number of results returned |

### Manufacturer Object

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| id | UUID | Yes | Unique manufacturer identifier |
| name | string | Yes | Official name of the manufacturer |
| description | string | No | Additional information about the manufacturer |

## Common Use Cases
- Get a list of all card manufacturers
- Build a manufacturer picker/dropdown for filtering
- Look up manufacturer IDs for filtering releases

## Tips for AI Assistants
- The SDK returns `{ data, error }` - always check for errors first
- Manufacturer IDs are UUIDs and are stable - they can be cached
- Use manufacturer IDs when filtering releases
- Common manufacturers include: Topps, Panini America, Upper Deck, Leaf
- The `description` field may be null for some manufacturers
