# PcComponentes Product Details API Documentation

`GET /api/pccomponentes/product` returns one product as JSON. Pass the `slug` from a search result, and pass its `id` too when you want the id echoed back.

## What you get

`product` holds `id`, `slug`, `name`, `url`, `price`, `original_price`, `discount`, `currency`, `availability`, `in_stock`, `rating`, `review_count`, `rating_count`, `description`, full-size `images` and `specs`. Prices are numbers in EUR. `review_count` and `rating_count` stay separate; a value the page does not publish stays `null`.

## Credits

A successful request costs **63 credits**. Errors, challenges and `404` answers cost nothing. The response shows the charge in `meta.credits_charged`.

- **Documentation:** [https://scrappa.co/docs/pccomponentes-api/pccomponentes_product](https://scrappa.co/docs/pccomponentes-api/pccomponentes_product)
- **API group:** PcComponentes API
- **Endpoint:** `GET https://scrappa.co/api/pccomponentes/product`

## 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 |
| --- | --- | --- | --- |
| `slug` | string | Yes | Product slug from a search result. |
| `id` | string | No | Product id from a search result. Echoed back when given. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/pccomponentes/product?slug=portatil-asus-vivobook-15-oled&id=10810270"
```

## Example response

```json
{
    "success": true,
    "product": {
        "id": "10810270",
        "slug": "portatil-asus-vivobook-15-oled",
        "name": "Portatil Asus Vivobook 15 OLED",
        "url": "https://www.pccomponentes.com/portatil-asus-vivobook-15-oled",
        "price": 579.99,
        "original_price": 699,
        "discount": 17,
        "currency": "EUR",
        "availability": "https://schema.org/InStock",
        "in_stock": true,
        "rating": 4.455,
        "review_count": 99,
        "rating_count": 189,
        "description": "Portatil con Ryzen 7, 16 GB DDR5 y 512 GB SSD.",
        "images": [
            "https://img.pccomponentes.com/articles/108/10810270/1.jpg"
        ],
        "specs": [
            {
                "name": "Memoria RAM",
                "value": "16 GB",
                "unit": null
            }
        ]
    },
    "meta": {
        "endpoint_family": "pccomponentes-product",
        "billable": true,
        "attempts": 1,
        "credits_charged": 63
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The storefront has no page for that product slug (`not_found`). Non-billable. |
| 422 | Validation Error | A query parameter is missing, unknown, conflicting or unusable. Unknown parameters are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | The storefront could not be reached, answered with a challenge, or changed its page shape (`upstream_blocked`, `upstream_unavailable`, `parser_drift`). 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)
