# Morele Product Search API Documentation

`GET /api/morele/search` `GET /api/morele/search` returns public products by search words. `term` is required and `page` is 1-based. The live page returns 30 products per page; there is no `limit` parameter. Prices are numbers in PLN. Each row carries its public id, slug, full-size image, numeric price, rating, review count, stock flag and category path when the live listing publishes them. A numeric `category_id` is not published on the results page and is named in `unavailable_fields`. Any other field the page omits is named there too. Rows that share no word with the query are dropped. A product URL is not accepted as search words. An empty result with `total` 0 is still a successful lookup; an index that reports rows but returns none, or rows that do not match the query, is an unbilled error. A sort or price filter that the source cannot honour returns 422 before any lookup.

## Credits

A successful request costs **1 credit**. Errors and challenges cost nothing. The response shows the charge in `meta.credits_charged`. Clients are never rate limited.

- **Documentation:** [https://scrappa.co/docs/morele-api/morele_search](https://scrappa.co/docs/morele-api/morele_search)
- **API group:** Morele API
- **Endpoint:** `GET https://scrappa.co/api/morele/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 |
| --- | --- | --- | --- |
| `term` | string | Yes | Search words. |
| `page` | integer | No | 1-based result page. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/morele/search?term=laptop"
```

## Example response

```json
{
    "success": true,
    "currency": "PLN",
    "results": [
        {
            "id": 5948081,
            "name": "Example",
            "price": 2415.78,
            "currency": "PLN"
        }
    ],
    "pagination": {
        "page": 1,
        "per_page": 30,
        "total": 83
    },
    "meta": {
        "endpoint_family": "morele-search",
        "billable": true,
        "attempts": 1,
        "credits_charged": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The public page has no product with that id (`not_found`). Non-billable. |
| 422 | Filter Not Available | A requested filter or page cannot be honoured by the public source (`unsupported_filter`). Non-billable. |
| 422 | Validation Error | A query parameter is missing, unknown, conflicting or unusable. Unknown parameters are rejected. Non-billable. |
| 503 | Upstream Unavailable | The source could not be reached or changed its page shape (`upstream_blocked`, `upstream_unavailable`, `parser_drift`, `key_stale`). 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)
