Marksandspencer APImarksandspencer.com ↗
Access M&S UK food products, nutrition info, ingredients, allergens, and category listings via 4 structured endpoints.
What is the Marksandspencer API?
The Marks & Spencer Food Catalogue API covers 4 endpoints that expose M&S UK food product data including category navigation, product listings, keyword search, and full product details. The get_product_details endpoint returns nutrition tables, ingredients, allergen information, storage instructions, and product images for any individual item. Category and search responses include product weight, brand, labels, and SEO URLs used to drill into product-level detail.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/f50bd5ad-301e-4278-8cf4-a5ef67ba5897/get_food_catalogue_categories' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace marksandspencer-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
from parse_apis.marks_spencer_food_api import MarksAndSpencer, CategorySlug, Category, ProductSummary, Product
ms = MarksAndSpencer()
# Browse products in a specific category using the enum
dairy = ms.category(CategorySlug.DAIRY)
for product in dairy.products(limit=5):
print(product.title, product.weight, product.brand)
# Search for products by keyword
for item in ms.productsummaries.search(query="chocolate", limit=3):
print(item.title, item.weight, item.seo_url)
# Navigate to full product details
detail = item.details()
print(detail.product_name, detail.description, detail.storage)
print(detail.nutrition.categories, detail.nutrition.values)
for img in detail.images:
print(img.asset_id, img.type)
# List all categories
for category in ms.categories.list():
print(category.name, category.slug)
Get the top-level food categories from the M&S food catalogue. Returns category names, URLs, and URL slugs that can be used with get_category_products to browse products within each category.
No input parameters required.
{
"type": "object",
"fields": {
"categories": "array of category objects with name, url, and slug"
},
"sample": {
"data": {
"categories": [
{
"url": "https://www.marksandspencer.com/food/l/fruit-and-vegetables",
"name": "Fruit & Vegetables",
"slug": "fruit-and-vegetables"
},
{
"url": "https://www.marksandspencer.com/food/l/meat",
"name": "Meat",
"slug": "meat"
},
{
"url": "https://www.marksandspencer.com/food/l/dairy",
"name": "Dairy",
"slug": "dairy"
}
]
},
"status": "success"
}
}About the Marksandspencer API
Category Navigation and Product Listings
The get_food_catalogue_categories endpoint returns the top-level food category tree — each entry includes a name, url, and slug. Those slugs feed directly into get_category_products, which accepts a required category_slug plus optional subcategory_slug and sub_subcategory_slug parameters to navigate up to three levels of hierarchy (for example, fruit-and-vegetables → fresh-fruit → berries-and-cherries). The listing response includes products, subcategories, filters, total_items, total_pages, and current_page for full pagination control.
Search and Product Discovery
search_food_products accepts a query string (e.g. 'milk', 'chocolate cake') and an optional page integer. Results mirror the listing shape: an array of product objects each carrying id, title, weight, brand, labels, seoUrl, and imageUrl. The search_term field in the response echoes back the query used, which is useful when logging or caching results.
Full Product Detail
get_product_details takes a product_id (the numeric segment from the seoUrl after fdp) and a product_slug. It returns the deepest data available: a nutrition object with a categories array and a values array, an ingredients string, a storage string, breadcrumbs for category context, labels such as 'Eat Well' or 'New In', and an images array. The ingredients field may be empty for unprocessed fresh produce where M&S does not publish ingredient declarations.
The Marksandspencer API is a managed, monitored endpoint for marksandspencer.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when marksandspencer.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official marksandspencer.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a grocery comparison tool using
weight,brand, and nutrition data fromget_product_details. - Aggregate allergen and ingredient data across the M&S food range for dietary filtering apps.
- Crawl the full product catalogue hierarchically using
get_food_catalogue_categoriesthenget_category_productssubcategory slugs. - Power a meal-planning feature that displays calorie and macro data from the
nutritionresponse field. - Monitor product label changes (e.g. 'New In', 'Eat Well') across categories for market trend tracking.
- Index M&S food product images and descriptions for a visual search or product catalog application.
- Search for specific products by keyword with
search_food_productsand surface results with pricing context from a parallel data source.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Marks & Spencer have an official public developer API?+
What does `get_product_details` return beyond basic product info?+
nutrition object (with categories and values arrays), an ingredients string, storage instructions, labels, breadcrumbs, and an images array. The ingredients field may be empty for fresh unprocessed items where M&S does not publish an ingredients declaration.Does the API cover customer reviews or star ratings for M&S food products?+
Does the API return pricing for M&S food products?+
get_category_products and search_food_products include title, weight, brand, labels, and imageUrl, but not price fields. You can fork the API on Parse and revise it to add a pricing field to the product detail endpoint.How does pagination work across endpoints?+
get_category_products and search_food_products accept an optional page integer. Responses include current_page, total_pages, and total_items, so you can iterate through the full result set programmatically. get_food_catalogue_categories and get_product_details are single-response endpoints with no pagination.