# sainsburys.search

A page of Sainsbury's grocery search results: each product's id, name, price, unit price, offers, rating, barcodes and picture.

Sainsbury's search, one of the Sainsbury's scrapers.

| | |
| --- | --- |
| Id | `sainsburys.search` |
| Version | 1 |
| Billed per | request — 1 unit for a charged run |
| Runs | within one request |

Start it with `POST /v1/scrapers/sainsburys.search/runs`. How runs work is in [Running a scraper](https://docs.enrichednow.com/running-a-scraper.md); what a run costs is in [Usage and units](https://docs.enrichednow.com/usage-and-units.md).

## Inputs

The fields of `input`. A field that is not listed here is refused.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | yes | What to search for, as typed into the shop's search box (`semi skimmed milk`). Limit: at least 1 characters, at most 150 characters. |
| `page` | integer | no | Which page of the results, from 1. Limit: 1 to 100. Default: `1`. |
| `max_results` | 30 \| 60 | no | How many products a page holds: 30 (default) or 60. Default: `30`. |
| `sort` | "relevance" \| "price_low" \| "price_high" \| "rating" | no | The order: relevance (default), price low to high, price high to low, or customer rating. Default: `"relevance"`. |

## Record fields

Every record of a run has these fields. A value that is not known is `null` — never an empty string and never `0`.

| Field | Type | Notes |
| --- | --- | --- |
| `product_id` | string | Sainsbury's id of the product (`357937`). `sainsburys.product` takes it. |
| `url` | string or null | The product's page on sainsburys.co.uk. |
| `name` | string | The product's name as the shop writes it, with its size. |
| `price` | number or null | The price the shop shows first, in pounds. Where an offer for Nectar members sets the price of one item, this is that price, and `price_before_offer` is the price without it. Null for an item priced by its band of weight (see `weights`). |
| `price_before_offer` | number or null | The price without the offer that sets `price`, in pounds; null when no such offer applies. |
| `currency` | string | The currency of the prices: always `GBP`. Default: `"GBP"`. |
| `sold_by` | string or null | `kg` for a product priced by weight (loose fruit and vegetables); null for one sold by the item. |
| `weights` | array of object | For an item whose weight varies (a joint, a pack of chicken fillets), the bands of weight it comes in and the price of each; `price` is then null. Empty for any other product. |
| `weights[].weight` | string | A band of weights the item can come in, as the shop writes it, e.g. `400g - 600g`. |
| `weights[].price` | number or null | What an item in that band costs, in pounds. |
| `unit_price` | number or null | The price per `unit_amount` `unit`, in pounds, as the shop compares products. |
| `unit` | string or null | The unit of `unit_price` as the shop writes it: `kg`, `ltr`, `ea` (each), `100g`... |
| `unit_amount` | number or null | How many `unit` the unit price is for, usually 1. |
| `available` | boolean or null | Whether the shop offers the product for delivery now. |
| `offers` | array of object | The offers on the product now. |
| `offers[].text` | string | The offer as the shop writes it, e.g. `Buy 1 for 7.25` or `Buy any 2 for £4.00 with Nectar`. |
| `offers[].nectar` | boolean or null | True for an offer that needs a Nectar card. |
| `offers[].starts_at` | string (date-time) or null | When the offer began, in UTC. |
| `offers[].ends_at` | string (date-time) or null | When the offer ends, in UTC. |
| `rating` | number or null | The average customer rating, out of 5. |
| `review_count` | integer or null | How many customer reviews the rating is from. |
| `barcodes` | array of string | The product's barcodes (EAN-13), as the shop lists them. |
| `categories` | array of string | The shop's categories the product is placed in. |
| `labels` | array of string | The labels on the product's tile: `BRITISH`, `ALDI PRICE MATCH*`... |
| `image` | string or null | The address of the product's main picture. |
| `fetched_at` | string (date-time) | When the shop answered, in UTC. |
| `position` | integer | The product's place in the whole list of results, from 1. |
| `total_results` | integer or null | How many products the shop says match the search. |

## Example request

It starts a run with this scraper's example input and waits up to 60 seconds for it. The key is read from `ENRICHEDNOW_API_KEY`.

```bash
curl -X POST "https://api.enrichednow.com/v1/scrapers/sainsburys.search/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"query":"semi skimmed milk"}}'
```

## Example response

The run, once it has ended. A run that has not ended within `wait` comes back with `202` and the status `queued` or `running`.

```json
{
  "id": "run_841742f37553189ff9c27ba1",
  "scraper_id": "sainsburys.search",
  "scraper_version": 1,
  "status": "ok",
  "reason": null,
  "input": {
    "query": "semi skimmed milk"
  },
  "record_count": 1,
  "units": 1,
  "units_per_request": 1,
  "units_per_record": null,
  "units_per_page": null,
  "diagnostics": {
    "requests": 1,
    "bytes": 259214,
    "wall_ms": 885,
    "facts": {}
  },
  "created_at": "2026-11-16T22:37:50.170950Z",
  "started_at": "2026-11-16T22:37:50.178331Z",
  "finished_at": "2026-11-16T22:37:51.066313Z"
}
```

Its records, from `GET /v1/runs/{id}/records`. The record is a real one: this scraper's own parser read it from a page recorded from the site.

```json
{
  "records": [
    {
      "product_id": "1208450",
      "url": "https://www.sainsburys.co.uk/gol-ui/product/sainsburys-british-semi-skimmed-milk-so-organic-2-27l-4-pint",
      "name": "Sainsbury's British Semi Skimmed Milk, SO Organic 2.27L (4 pint)",
      "price": 2.55,
      "price_before_offer": null,
      "currency": "GBP",
      "sold_by": null,
      "weights": [],
      "unit_price": 1.12,
      "unit": "ltr",
      "unit_amount": 1,
      "available": true,
      "offers": [],
      "rating": 4.5352,
      "review_count": 284,
      "barcodes": [
        "0000001208450"
      ],
      "categories": [
        "Fresh milk",
        "Dairy",
        "Dairy & chilled essentials"
      ],
      "labels": [
        "ORGANIC",
        "BRITISH"
      ],
      "image": "https://assets.sainsburys-groceries.co.uk/gol/1208450/image.jpg",
      "fetched_at": "2026-11-19T18:23:57.387139Z",
      "position": 1,
      "total_results": 26
    }
  ],
  "next_cursor": null
}
```

A run does not always end `ok`. [Results and statuses](https://docs.enrichednow.com/results-and-statuses.md#reason-codes) lists every status and the reasons every scraper shares; [the reasons of the Sainsbury's scrapers](https://docs.enrichednow.com/results-and-statuses.md#sainsbury-s) are in their own section there.
