# Sweetwater Search API Documentation

<p><strong>Sweetwater Search API Documentation</strong> Search the public Sweetwater music gear catalogue by query, category, brand, sort, price range and zero-based page. Prices are numbers in USD, discount uses multiple signals, ids work unchanged in the next route, dates use ISO 8601 and images are full-size URLs. Availability carries a derived boolean in_stock, or null when stock is unknown; a negative stock count is reported as zero. 1 credit per request. Failed requests are never billed.</p>

- **Documentation:** [https://scrappa.co/docs/sweetwater-api/sweetwater_search](https://scrappa.co/docs/sweetwater-api/sweetwater_search)
- **API group:** Sweetwater API
- **Endpoint:** `GET https://scrappa.co/api/sweetwater/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 | No | Search text, e.g. sm7b |
| `category` | string | No | Category name from a search hit |
| `brand` | string | No | Brand name from a search hit |
| `sort` | string | No | price_asc, price_desc, rating_desc, popularitySerials_desc or daysSinceNew_asc |
| `price_min` | number | No | Minimum final price in USD |
| `price_max` | number | No | Maximum final price in USD |
| `page` | integer | No | Zero-based page number, default 0 |
| `hitsPerPage` | integer | No | Results per page, default 42, max 300 |

## Example response

```json
{
    "data": {
        "hits": [
            {
                "url": "/store/detail/SM7B--shure-sm7b",
                "brand": "Shure",
                "image": {
                    "pathAbsolute": "https://media.sweetwater.com/api/i/q-82__ha-abc__w-1500__ca-1/image.jpg"
                },
                "price": {
                    "currency": "USD",
                    "finalPrice": 399,
                    "retailPrice": 449
                },
                "rating": {
                    "count": 1234,
                    "average": 4.8
                },
                "discount": {
                    "amount": 50,
                    "percent": 11.1,
                    "final_price": 399,
                    "is_discounted": true,
                    "original_price": 449
                },
                "objectID": "SM7B",
                "attributes": {
                    "inStock": true,
                    "available": true
                },
                "categories": {
                    "lvl0": [
                        "Microphones"
                    ]
                },
                "genericName": "Microphone",
                "productName": "Shure SM7B",
                "availability": {
                    "in_stock": true
                }
            }
        ],
        "page": 0,
        "query": "sm7b",
        "facets": {
            "brand": {
                "Shure": 25
            }
        },
        "nbHits": 25,
        "nbPages": 1,
        "hitsPerPage": 42
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "algolia_search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing or invalid. Failed requests are not billed. |
| 503 | Upstream Unavailable | The upstream source is temporarily unavailable. Failed requests are not billed. |

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