Ocado Promotions
ocado.promotions.list
List the products on Ocado's offers page, with the price now and wording such as "Now £3.95, was £6".
At a glance
- Endpoint ID
ocado.promotions.list- Price
- 8 credits per call; failed calls are free
- Runs for up to
- 45 seconds
Request
Send the endpoint ID as capability and its fields as input. Set UPSCRAPE_API_KEY to your key first.
curl --request POST \ --url https://data.upscrape.com/execute \ --header "Authorization: Bearer $UPSCRAPE_API_KEY" \ --header "Content-Type: application/json" \ --header "Prefer: wait=30" \ --data '{ "capability": "ocado.promotions.list", "input": {}}'
import jsonimport osimport requestspayload = json.loads(r'''{ "capability": "ocado.promotions.list", "input": {}}''')response = requests.post( "https://data.upscrape.com/execute", headers={ "Authorization": f"Bearer {os.environ['UPSCRAPE_API_KEY']}", "Content-Type": "application/json", "Prefer": "wait=30", }, json=payload,)response.raise_for_status()print(json.dumps(response.json(), indent=2))
const response = await fetch("https://data.upscrape.com/execute", { method: "POST", headers: { "Authorization": `Bearer ${process.env.UPSCRAPE_API_KEY}`, "Content-Type": "application/json", "Prefer": "wait=30", }, body: JSON.stringify({ "capability": "ocado.promotions.list", "input": {}}),});if (!response.ok) { throw new Error(`Upscrape request failed: ${response.status}`);}console.log(JSON.stringify(await response.json(), null, 2));
Input
This endpoint takes an empty input object.
Response
A finished call answers with HTTP 200; the data is in results[0].data, and billing.credits_charged is what it cost. A call still running after the wait answers 202: see jobs and results.
This is results[0].data from a real run:
{ "returned": 48, "items": [ { "name": "MOJU Ginger Vitality Dosing Bottle 7x Shots", "available": true, "brand": "Moju", "gtin": null, "image": "https://www.ocado.com/images-v3/eafa5127-d256-497b-9609-4869092accd6/d890cb08-2147-44a4-bb89-6d9373bfe46c/300x300.jpg", "pack_size": "420ml", "retailer_product_id": "584914011", "url": "https://www.ocado.com/products/moju-ginger-vitality-dosing-bottle-7x-shots/584914011", "price": { "amount": 3.95, "currency": "GBP" }, "unit_price": { "amount": 9.4, "currency": "GBP", "unit": "per_litre" }, "member_prices": [], "promotions": [ { "buy_quantity": null, "description": "Now £3.95, was £6", "end": null, "for_price": null, "id": "0eb6f2f4-8484-4c8b-b46e-221d5b74d042", "start": null, "type": "price_cut" } ] }, { "name": "M&S Seedless Easy Peelers", "available": true, "brand": "M&S", "gtin": null, "image": "https://www.ocado.com/images-v3/eafa5127-d256-497b-9609-4869092accd6/a2e549f9-ce4e-4bda-9ad5-8f98b50a32e0/300x300.jpg", "pack_size": "600g", "retailer_product_id": "517762011", "url": "https://www.ocado.com/products/m-s-seedless-easy-peelers/517762011", "price": { "amount": 2.6, "currency": "GBP" }, "unit_price": { "amount": 4.33, "currency": "GBP", "unit": "per_kg" }, "member_prices": [], "promotions": [ { "buy_quantity": 2, "description": "Buy any 2 for £4.50", "end": null, "id": "deed8117-f96c-45a2-912d-1bfac8a51040", "start": null, "type": "multibuy", "for_price": { "amount": 4.5, "currency": "GBP" } } ] } ], "promotions": [ { "buy_quantity": null, "description": "Now £3.95, was £6", "end": null, "for_price": null, "id": "0eb6f2f4-8484-4c8b-b46e-221d5b74d042", "start": null, "type": "price_cut" }, { "buy_quantity": 2, "description": "Buy any 2 for £4.50", "end": null, "id": "deed8117-f96c-45a2-912d-1bfac8a51040", "start": null, "type": "multibuy", "for_price": { "amount": 4.5, "currency": "GBP" } } ]}
Fields
| Field | Type | What it is | Example |
|---|---|---|---|
items[].name |
string | The name as Ocado shows it. | MOJU Ginger Vitality Dosing Bottle 7x Shots |
items[].brand |
string | The product's brand, such as Ocado or M&S. | Moju |
items[].pack_size |
string | The pack size, such as 2L. | 420ml |
items[].price.amount |
number | The amount, in the currency beside it. | 3.95 |
items[].unit_price.amount |
number | The amount, in the currency beside it. | 9.4 |
items[].unit_price.currency |
string | GBP for pounds, GBX for pence. | GBP |
items[].unit_price.unit |
string | What the unit price is per, such as per_litre. | per_litre |
items[].retailer_product_id |
string | Ocado's product number; the product and review endpoints take it. | 584914011 |
items[].price |
object | The price of one pack. | 2 fields |
items[].available |
boolean | Whether Ocado lists the product as available to order; not a stock count. | true |
items[].gtin |
null | The barcode, when Ocado gives one; usually empty. | null |
items[].image |
string | The product picture. | https://www.ocado.com/images-v3/eafa5127-d256-497b-9609-4869092… |
items[].member_prices |
array | Member-only prices, when Ocado shows them. | empty in this sample |
items[].price.currency |
string | GBP for pounds, GBX for pence. | GBP |
items[].promotions |
array | The offers on the product. | 1 records |
items[].promotions[].buy_quantity |
null | null | |
items[].promotions[].description |
string | Now £3.95, was £6 | |
items[].promotions[].end |
null | null | |
items[].promotions[].for_price |
null | null | |
items[].promotions[].id |
string | 0eb6f2f4-8484-4c8b-b46e-221d5b74d042 | |
items[].promotions[].start |
null | null | |
items[].promotions[].type |
string | price_cut | |
items[].unit_price |
object | The price per litre, kilo or item. | 3 fields |
items[].url |
string | The page on ocado.com. | https://www.ocado.com/products/moju-ginger-vitality-dosing-bott… |
items |
array | The products on this page. | 48 records |
promotions |
array | The offers on the product. | 43 records |
promotions[].buy_quantity |
null | How many to buy for a multibuy. | null |
promotions[].description |
string | The offer as Ocado words it, such as Buy any 2 for £4. | Now £3.95, was £6 |
promotions[].end |
null | When the offer ends, when Ocado says. | null |
promotions[].for_price |
null | What the multibuy quantity costs in total. | null |
promotions[].id |
string | 0eb6f2f4-8484-4c8b-b46e-221d5b74d042 | |
promotions[].start |
null | When the offer starts, when Ocado says. | null |
promotions[].type |
string | The kind of offer: price_cut, multibuy or offer. | price_cut |
returned |
integer | How many entries this page holds. | 48 |
If a call fails
A failed call costs nothing. The response carries an error.code you can branch on; Errors and retries lists every code and which ones to retry.
Other Ocado endpoints
Something missing or unclear? Ask the team that builds the Ocado endpoints.