# X-Kom Product Search API Documentation

<p><strong>X-Kom Product Search API Documentation</strong> Search the X-Kom catalog by query or by a numeric category id from the categories route. Each item has a numeric id, name, producer, category, PLN price and old price, discount, full-size image URL, 1 to 5 rating, review count, availability and feature summary. Page and page size are honoured, up to 100 items per page. Cost: 1 credit per successful request with results. Failed, empty and validation responses are not billed.</p>

- **Documentation:** [https://scrappa.co/docs/xkom-api/xkom_search](https://scrappa.co/docs/xkom-api/xkom_search)
- **API group:** X-Kom API
- **Endpoint:** `GET https://scrappa.co/api/xkom/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 | No | Search words (use this or category). Example: laptop. |
| `category` | string | No | Numeric category id from the categories route (use this or query). Example: 159. |
| `page` | integer | No | Page number from 1. |
| `page_size` | integer | No | Items per page, 1 to 100. Defaults to 100. |

## Example response

```json
{
    "data": {
        "items": [
            {
                "id": 1175277,
                "name": "Laptop",
                "image": "https://cdn.x-kom.pl/i/produkt/product-large.jpg",
                "price": 649,
                "rating": 4.79,
                "category": {
                    "id": 159,
                    "name": "Laptopy"
                },
                "currency": "PLN",
                "discount": 50,
                "producer": "Apple",
                "old_price": 699,
                "availability": "Dost\u0119pny",
                "rating_scale": "1-5",
                "review_count": 389
            }
        ],
        "currency": "PLN",
        "pagination": {
            "has_next": true,
            "per_page": 1,
            "total_pages": 65,
            "current_page": 1,
            "total_results": 6403
        }
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query or category is missing or a filter is unsupported. Not billed. |
| 502 | Upstream Unavailable | X-Kom could not be reached. Retry. Not billed. |

## 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)
