# Costco Autocomplete API Documentation

<p><strong>Costco Autocomplete API</strong> returns the search suggestions Costco shows while a shopper types. Use country <code>ca</code> with locale <code>fr-CA</code> for Canadian French. A text without suggestions returns an empty list and is free. Costs 1 credit per successful request.</p>

- **Documentation:** [https://scrappa.co/docs/costco-api/costco_autocomplete](https://scrappa.co/docs/costco-api/costco_autocomplete)
- **API group:** Costco API
- **Endpoint:** `GET https://scrappa.co/api/costco/autocomplete`

## 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 100 characters, for example tv. |
| `country` | string | No | us (default) or ca. Selects costco.com or costco.ca. |
| `locale` | string | No | en-US, en-CA or fr-CA. Canadian French works with country ca. Default is the English locale of the country. |

## Example response

```json
{
    "data": {
        "query": "tv",
        "country": "us",
        "suggestions": [
            "samsung tv",
            "tv stand",
            "tv",
            "apple tv",
            "65 inch tv",
            "lg tv",
            "tcl tv",
            "75 inch tv",
            "85 inch tv",
            "tvs",
            "oled tv",
            "55 inch tv",
            "tv mount",
            "fireplace tv stand",
            "100 inch tv",
            "sony tv",
            "frame tv",
            "hisense tv",
            "tv stands & entertainment centers",
            "98 inch or larger tvs"
        ],
        "suggested_warehouses": []
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "autocomplete"
    },
    "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 | Costco could not be reached after several tries. 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)
