# Takealot Search API Documentation

Returns up to 36 products per call from the public Takealot catalogue. Each product carries the PLID, the separate SKU and TSIN ids, title, brand, price, list price, sale price, discount in percent, ZAR currency, rating, review count, seller availability, a full-size image url and the product url. Filter with a category, a brand, facet tokens in Name:Value form and a price band. The price band is also checked on each returned card; count is the filtered total. Facets, filters and sort_options mirror the upstream sections; Takealot currently returns them empty and no values are invented. Page with the opaque after or before cursor; never with a page number. Failed requests (404, 422, 503) are never billed. A valid answer with zero rows is a successful, billable 200.

- **Documentation:** [https://scrappa.co/docs/takealot-api/takealot_search](https://scrappa.co/docs/takealot-api/takealot_search)
- **API group:** Takealot API
- **Endpoint:** `GET https://scrappa.co/api/takealot/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, for example laptop. |
| `category` | string | No | Optional category id from the facets of a previous search. |
| `brand` | string | No | Only products of this brand, for example HP. |
| `facet` | string | No | Facet tokens in Name:Value form, comma-combined, for example Brand:HP,Type:13. |
| `sort` | string | No | Relevance, Price Ascending, Price Descending, Rating Descending or ReleaseDate Descending. |
| `min_price` | number | No | Lowest price in ZAR. Sent as the lower bound of the upstream Price band. |
| `max_price` | number | No | Highest price in ZAR. Sent as the upper bound of the upstream Price band. |
| `after` | string | No | Cursor from the after field of a previous response. |
| `before` | string | No | Cursor to page back. Use after or before, not both. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/takealot/search?query=laptop&sort=Price+Ascending&after="
```

## Example response

```json
{
    "success": true,
    "data": {
        "query": "laptop",
        "products": [
            {
                "position": 1,
                "id": "94928735",
                "sku": "214138364",
                "tsin": "95760710",
                "title": "Example Laptop 14 inch",
                "brand": "HP",
                "price": 3999,
                "list_price": 5499,
                "sale_price": 3999,
                "discount": 27,
                "currency": "ZAR",
                "rating": 4.3,
                "review_count": 156,
                "availability": {
                    "status": "In stock",
                    "in_stock": true
                },
                "image": "https://cdn.example.test/image/pdpxl/94928735.jpg"
            }
        ],
        "count": 1586,
        "page_size": 36,
        "after": "WzkuNjM2OTM4LDEwNDA2NDIzNV0"
    },
    "meta": {
        "endpoint_family": "search",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested Takealot record was not found. This response is not billable. |
| 422 | Validation Error | A parameter is invalid: a bad PLID, an unknown sort, a malformed facet or a price band out of range. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result. This response is not billable. |

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