Skip to the content
EnrichedNowDocs

    Type to search every page.

    Menu

    Scraper APISainsbury's

    sainsburys.search

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

    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; what a run costs is in Usage and units.

    Inputs

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

    Inputs of sainsburys.search
    FieldTypeDescription
    queryrequiredstringWhat to search for, as typed into the shop's search box (semi skimmed milk).Limit: at least 1 characters, at most 150 characters.
    pageintegerWhich page of the results, from 1.Limit: 1 to 100. Default: 1.
    max_results30 | 60How many products a page holds: 30 (default) or 60.Default: 30.
    sort"relevance" | "price_low" | "price_high" | "rating"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.

    Record fields of sainsburys.search
    FieldTypeNotes
    product_idstringSainsbury's id of the product (357937). sainsburys.product takes it.
    urlstring or nullThe product's page on sainsburys.co.uk.
    namestringThe product's name as the shop writes it, with its size.
    pricenumber or nullThe 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_offernumber or nullThe price without the offer that sets price, in pounds; null when no such offer applies.
    currencystringThe currency of the prices: always GBP.Default: "GBP".
    sold_bystring or nullkg for a product priced by weight (loose fruit and vegetables); null for one sold by the item.
    weightsarray of objectFor 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.
    weight (in weights[])stringA band of weights the item can come in, as the shop writes it, e.g. 400g - 600g.
    price (in weights[])number or nullWhat an item in that band costs, in pounds.
    unit_pricenumber or nullThe price per unit_amount unit, in pounds, as the shop compares products.
    unitstring or nullThe unit of unit_price as the shop writes it: kg, ltr, ea (each), 100g...
    unit_amountnumber or nullHow many unit the unit price is for, usually 1.
    availableboolean or nullWhether the shop offers the product for delivery now.
    offersarray of objectThe offers on the product now.
    text (in offers[])stringThe offer as the shop writes it, e.g. Buy 1 for 7.25 or Buy any 2 for £4.00 with Nectar.
    nectar (in offers[])boolean or nullTrue for an offer that needs a Nectar card.
    starts_at (in offers[])string (date-time) or nullWhen the offer began, in UTC.
    ends_at (in offers[])string (date-time) or nullWhen the offer ends, in UTC.
    ratingnumber or nullThe average customer rating, out of 5.
    review_countinteger or nullHow many customer reviews the rating is from.
    barcodesarray of stringThe product's barcodes (EAN-13), as the shop lists them.
    categoriesarray of stringThe shop's categories the product is placed in.
    labelsarray of stringThe labels on the product's tile: BRITISH, ALDI PRICE MATCH*...
    imagestring or nullThe address of the product's main picture.
    fetched_atstring (date-time)When the shop answered, in UTC.
    positionintegerThe product's place in the whole list of results, from 1.
    total_resultsinteger or nullHow many products the shop says match the search.

    Example request

    # Start a run and wait up to 60 seconds for it to finish
    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"}}'
    
    # Read its records, with the id the first call answered
    curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
      -H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
    from enrichednow import EnrichedNow
    
    client = EnrichedNow()  # reads ENRICHEDNOW_API_KEY
    
    # Start a run, wait for it to end, and get its records
    result = client.scrape("sainsburys.search", {"query": "semi skimmed milk"})
    print(result.run.id, result.run.status, result.run.record_count)
    
    # Read its records: pages are fetched as you go
    for record in result.records:
        print(record)

    Install it with pip install enrichednow, then save as run.py and run python3 run.py

    import EnrichedNow from "enrichednow";
    
    const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
    
    // Start a run, wait for it to end, and get its records
    const { run, records } = await client.scrape("sainsburys.search", { query: "semi skimmed milk" });
    console.log(run.id, run.status, run.record_count);
    
    // Read its records: pages are fetched as you go
    for await (const record of records) console.log(record);

    Install it with npm install enrichednow, then save as run.mjs and run node run.mjs

    package main
    
    import (
    	"context"
    	"fmt"
    	"log"
    	"time"
    
    	enrichednow "github.com/enrichednow/enrichednow-go"
    )
    
    func main() {
    	client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
    	if err != nil {
    		log.Fatal(err)
    	}
    	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
    	defer cancel()
    
    	// Start a run, wait for it to end, and get its records
    	run, records, err := client.Scrape(ctx, "sainsburys.search", map[string]any{"query": "semi skimmed milk"})
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(run.ID, run.Status, run.RecordCount)
    
    	// Read its records: pages are fetched as you go
    	for records.Next() {
    		fmt.Println(string(records.Current()))
    	}
    	if err := records.Err(); err != nil {
    		log.Fatal(err)
    	}
    }

    Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go

    import com.enrichednow.EnrichedNowClient;
    import com.enrichednow.ScrapeResult;
    import java.util.Map;
    
    public class Run {
        public static void main(String[] args) {
            EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
    
            // Start a run, wait for it to end, and get its records
            ScrapeResult result = client.scrape("sainsburys.search", Map.of("query", "semi skimmed milk"));
            System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
    
            // Read its records: pages are fetched as you go
            for (Map<String, Object> record : result.records()) {
                System.out.println(record);
            }
        }
    }

    Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java

    enrichednow run sainsburys.search --input 'query=semi skimmed milk'

    Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh

    It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.

    The body on its own:

    JSON
    {
      "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 lists every status and the reasons every scraper shares; the reasons of the Sainsbury's scrapers are in their own section there.