# PChome Variants API Documentation

<p><strong>PChome Variants API</strong> lists the variants of one product. Each variant has its id, spec label, group, stock, availability and image. A product with only the default choice returns a successful response with an empty variants list. An empty variants list is free.</p><p>Costs 1 credit per successful request. Empty results and failed requests are free.</p>

- **Documentation:** [https://scrappa.co/docs/pchome-api/pchome_variants](https://scrappa.co/docs/pchome-api/pchome_variants)
- **API group:** PChome 24h API
- **Endpoint:** `GET https://scrappa.co/api/pchome/variants`

## 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 |
| --- | --- | --- | --- |
| `id` | string | Yes | Product id from search, for example DYAJKE-A900FVZ88. |

## Example response

```json
{
    "data": {
        "variants": [
            {
                "name": "128GB",
                "spec": "Black",
                "group": "Color",
                "image": "https://d.ecimg.tw/abc.jpg",
                "stock": 12,
                "sequence": 2,
                "variant_id": "DYAJKE-A900FVZ88-002",
                "is_preorder": false,
                "availability": "in_stock"
            }
        ],
        "product_id": "DYAJKE-A900FVZ88"
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "variants"
    },
    "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)
