# Walgreens Product Search API Documentation

<p>Search public Walgreens OTC products. Each row has the product id, name, brand, size, USD price, promotion text, rating, review count, availability, image and product url. Filter by brand, price range and category. Sort by price or rating. A numeric query returns that one product. Rows that violate a filter are never returned and overlapping ids are deduplicated. Filters and sort narrow a single page, not the whole catalog. One credit per successful search; an empty result and every error cost nothing.</p>

- **Documentation:** [https://scrappa.co/docs/walgreens-api/walgreens_search](https://scrappa.co/docs/walgreens-api/walgreens_search)
- **API group:** Walgreens API
- **Endpoint:** `GET https://scrappa.co/api/walgreens/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 or a numeric product id, 1 to 200 characters. Example: ibuprofen. |
| `page` | integer | No | Page number, also accepted as p, default 1. |
| `sort` | string | No | relevance, price_low, price_high, rating_high. Default: relevance. |
| `brand` | string | No | Brand name filter. |
| `min_price` | number | No | Lowest USD price. Send it together with max_price. |
| `max_price` | number | No | Highest USD price. Send it together with min_price. |
| `category` | string | No | Category id from the categories endpoint, e.g. 350006. |

## Example response

```json
{
    "data": {
        "query": "ibuprofen",
        "results": [
            {
                "url": "https://www.walgreens.com/store/c/ibuprofen/ID=300429191-product",
                "name": "Ibuprofen 200 mg Tablets",
                "size": "100 ct",
                "brand": "Walgreens",
                "image": "https://pics.walgreens.com/prodimg/300429191/450.jpg",
                "price": 9.99,
                "rating": 4.5,
                "on_sale": false,
                "currency": "USD",
                "discount": null,
                "product_id": "300429191",
                "store_price": null,
                "availability": "find_at_store",
                "review_count": 120,
                "promotion_text": null
            }
        ],
        "sort_by": "relevance",
        "store_id": "15196",
        "pagination": {
            "per_page": 72,
            "returned": 1,
            "current_page": 1,
            "has_next_page": true
        },
        "sort_options": [
            "relevance",
            "price_low",
            "price_high",
            "rating_high"
        ]
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required query parameter is missing or invalid. This response is not billable. |
| 503 | Service Unavailable | Walgreens could not be reached or refused the request. 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)
