# Competitor Data Structure Reference


**Last Updated:** 2025-11-20

## Required Fields

### Basic Information

- `slug` (string): URL slug, e.g., "personio", "clockin"
- `name` (string): Display name, e.g., "Personio", "Clockin"
- `rating` (string): Rating value, e.g., "4.3", "4.9"
- `reviews` (string): Review count, e.g., "368", "329"
- `description` (string): Full product description paragraph
- `category` (string): Category, e.g., "HR-Software", "Zeiterfassung"
- `focus` (string): Focus/use case, e.g., "Schichtplanung, Zeiterfassung & Personalmanagement"
- `target` (string): Target audience, e.g., "Unternehmen", "Agenturen"
- `logo_alt` (string): Alt text for logo
- `logo_class` (string): Additional CSS classes for logo (e.g., "brightness-0 invert" or "")

### Pricing

```php
'pricing' => [
    'starting_price' => '0.00',  // String, can be "0.00" for "auf Anfrage"
    'price_unit' => 'auf Anfrage',  // e.g., "pro Standort pro Monat", "pro User pro Monat"
    'currency' => 'EUR',  // 'EUR', 'USD', etc.
]
```

### FAQ

```php
'faq' => [
    [
        'question' => 'Question text here',
        'answer' => 'Answer text with <strong>HTML</strong> preserved',
    ],
    // ... more FAQ items
]
```

### Schema

```php
'schema' => [
    'name' => 'Competitor Name',
    'description' => 'Full description matching SoftwareApplication schema',
    'url' => 'competitor-slug-vergleich',
]
```

### Rating Distribution

```php
'rating_distribution' => [
    '5' => [
        'percentage' => 98,  // Integer, 0-100
        'count' => 53,  // Integer
    ],
    '4' => [
        'percentage' => 2,
        'count' => 1,
    ],
    '3' => [
        'percentage' => 0,
        'count' => 0,
    ],
    '2' => [
        'percentage' => 0,
        'count' => 0,
    ],
    '1' => [
        'percentage' => 0,
        'count' => 0,
    ],
]
```

### Detailed Ratings (Optional)

```php
'detailed_ratings' => [
    'benutzerfreundlichkeit' => [
        'score' => 9.7,
        'category' => 'Zeiterfassung',
        'average' => 9.0,
    ],
    'erfuellung' => [
        'score' => 9.4,
        'category' => 'Zeiterfassung',
        'average' => 9.1,
    ],
    'kundensupport' => [
        'score' => 9.7,
        'category' => 'Zeiterfassung',
        'average' => 9.2,
    ],
    'einfache_einrichtung' => [
        'score' => 9.3,
        'category' => 'Zeiterfassung',
        'average' => 8.8,
    ],
]
```

### Details Section (if has_details = true)

```php
'has_details' => true,
'details' => [
    'features' => [
        'Feature 1',
        'Feature 2',
        // ... more features
    ],
    'integrations' => [
        'Integration 1',
        'Integration 2',
        // ... more integrations
    ],
    'special' => [
        'Special characteristic 1',
        'Special characteristic 2',
        // ... more special characteristics
    ],
]
```

## Known Syntax Errors

1. **Double commas in rating_distribution** (lines 2788, 2864, 2936, etc.):
   ```php
   'percentage' => 100,,  // Should be: 'percentage' => 100,
   ```

## Data Extraction Sources

From old comparison pages, extract:

1. **Meta tags**: title, description, keywords, canonical URL
2. **Open Graph**: og:title, og:description, og:url
3. **Twitter Card**: twitter:title, twitter:description
4. **Schema.org JSON-LD**:
   - SoftwareApplication: name, description, rating, reviews, pricing
   - Table: competitor rating and reviews
5. **Hero section**: H1 heading, description paragraph
6. **Comparison grid**: competitor rating, reviews, pricing display
7. **Rating distribution**: percentages and counts for 5★-1★
8. **Detailed ratings**: scores for benutzerfreundlichkeit, erfuellung, kundensupport, einfache_einrichtung
9. **FAQ section**: all questions and answers (preserve HTML)
10. **Logo**: alt text and CSS classes from img tag
