# Fnac Product Search API Documentation

`GET /api/fnac/search` returns public Fnac France product cards as structured JSON. A page holds up to 20 products.

## What you get

Each item has `position`, `id`, `title`, `brand`, `url`, `price`, `original_price`, `discount_percent`, `currency`, `online_available`, `seller`, `image`, `rating` and `review_count`. The `id` is the value the storefront publishes on its card; pass page results through to your own storage unchanged. Prices are numbers in EUR. `rating` and `review_count` are `null` because the public search page does not publish them.

## Parameters and honesty

Only `query` and `page` are applied. `page` runs from 1 to 20. Brand, price, sort, category, seller and site are rejected with a 422 `unsupported_filter` before any lookup, so page two is never relabelled as filtered or sorted. Unknown parameters are rejected as well.

A query with no products answers HTTP 200 with `items: []`, `meta.billable: false` and `meta.credits_charged: 0`. `meta.unavailable_reason` names what a page lacks. `next_page` and `has_more` come from the card count on the page, never from an assumption.

## Credits

A successful request with at least one product costs **1 credit**. Errors, challenges and empty pages cost nothing. The response shows the charge in `meta.credits_charged`.

- **Documentation:** [https://scrappa.co/docs/fnac-api/fnac_search](https://scrappa.co/docs/fnac-api/fnac_search)
- **API group:** Fnac API
- **Endpoint:** `GET https://scrappa.co/api/fnac/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | Search words. |
| `page` | integer | No | Result page of 20 products, 1-20. |
| `sort` | string | No | Not available: returns 422 `unsupported_filter`. |
| `price` | number | No | Not available: returns 422 `unsupported_filter`. |
| `brand` | string | No | Not available: returns 422 `unsupported_filter`. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/fnac/search?query=iphone"
```

## Example response

```json
{
    "success": true,
    "site": "fnac-fr",
    "query": "iphone",
    "page": 1,
    "page_size": 20,
    "next_page": 2,
    "has_more": true,
    "sort": "relevance",
    "items": [
        {
            "position": 1,
            "id": "21492225",
            "title": "Apple iPhone 16 128 Go",
            "brand": "Apple",
            "url": "https://www.fnac.com/a21492225/Apple-iPhone-16-128-Go",
            "price": 1899,
            "original_price": 2399,
            "discount_percent": 21,
            "currency": "EUR",
            "online_available": true,
            "seller": "Fnac",
            "image": "https://images.fnac.com/21492225/image.jpg",
            "rating": null,
            "review_count": null
        }
    ],
    "meta": {
        "endpoint_family": "fnac-search",
        "billable": true,
        "attempts": 1,
        "credits_charged": 1,
        "unavailable_reason": []
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Parameter Not Available | Brand, price, sort, category, seller and site have no verified recipe. They are rejected before any lookup (`unsupported_filter`). Non-billable. |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters are rejected, never ignored. Non-billable. |
| 503 | Storefront Unavailable | The storefront could not be reached or answered with a challenge (`upstream_blocked`, `upstream_unavailable`). Retryable and never billed. Clients are never rate limited. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
