# PChome Search API Documentation

<p><strong>PChome Search API</strong> searches products on PChome 24h in Taiwan. Each item has the price, original price and discount as TWD numbers, the brand, seller, category id and a full-size image url.</p><p>Filter by shop segment, sort, price range and brand. The shop parameter is the upstream shop segment, not a category tree. Brand is applied to the returned page, so pagination counts and has_next describe the unfiltered set; pagination.filtered_out reports how many items were dropped. When a row has no brand, a fixed brand vocabulary is matched against the name and description with a word boundary. ASCII tokens need at least 3 letters and CJK tokens at least 2 characters. Every returned item follows the filters you send. There are 20 results per page and page N returns the real page N.</p><p>Search carries no rating, review count or availability. Read the aggregate rating of one product from the reviews route. The product id feeds the product, offers, variants and reviews routes unchanged. Costs 1 credit per successful request. Empty results and failed requests are free.</p>

- **Documentation:** [https://scrappa.co/docs/pchome-api/pchome_search](https://scrappa.co/docs/pchome-api/pchome_search)
- **API group:** PChome 24h API
- **Endpoint:** `GET https://scrappa.co/api/pchome/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 text, 1 to 120 characters, for example iphone. |
| `page` | integer | No | One-based page number, 20 results per page (default 1). |
| `shop` | string | No | Shop segment: all, 24h, 24b, vdr or tour. |
| `sort` | string | No | One of sale/dc, rnk/dc, prc/dc, prc/ac or new/dc. |
| `min_price` | number | No | Lowest price in TWD. |
| `max_price` | number | No | Highest price in TWD. |
| `brand` | string | No | Brand text to match. Matched on the returned page and filled from a fixed brand vocabulary when the row has no brand. |

## Example response

```json
{
    "data": {
        "query": "iphone",
        "results": [
            {
                "url": "https://24h.pchome.com.tw/prod/DYAJKE-A900FVZ88",
                "brand": "Apple",
                "image": "https://d.ecimg.tw/abc.jpg",
                "price": 32900,
                "title": "iPhone",
                "seller": "PChome 24h",
                "currency": "TWD",
                "product_id": "DYAJKE-A900FVZ88",
                "category_id": "A1",
                "original_price": 35900,
                "discount_percent": 8.36
            }
        ],
        "currency": "TWD",
        "pagination": {
            "page": 1,
            "has_next": true,
            "per_page": 20,
            "filtered_out": 0,
            "total_results": 48909
        }
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter or a value is invalid. This response is not billable. |
| 503 | Upstream Unavailable | The source could not be reached. This response is not billable. Retry shortly. |

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