Discover/SPAR API
live

SPAR APIspar.co.za

Search the SPAR South Africa grocery catalog by keyword. Returns product name, description, size, and image URL for matching items.

This API takes change requests — .
Endpoints
1
Updated
6d ago

What is the SPAR API?

The SPAR South Africa API exposes 1 endpoint — search_products — that queries the SPAR brand product catalog and returns up to 5 fields per product: product_id, name, description, size, and image_url. It covers the full SPAR grocery range including fresh food, pantry staples, beverages, and household items, letting developers build product lookup tools without maintaining their own catalog data.

This call costs1 credit / call— charged only on success
Try it
Search term to find products by name or description (e.g. 'milk', 'bread', 'coconut').
api.parse.bot/scraper/3bdd71ec-f83f-486e-ad7d-f41d77d75337/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/3bdd71ec-f83f-486e-ad7d-f41d77d75337/search_products' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

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 spar-co-za-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.

"""
SPAR South Africa Product Catalog API Client

Search the SPAR South Africa product catalog for grocery items.
Get your API key from: https://parse.bot/settings
"""

import os
import requests
from typing import Optional, Dict, List, Any


class ParseClient:
    """Client for interacting with the SPAR South Africa Product Catalog API."""

    def __init__(self, api_key: Optional[str] = None):
        """
        Initialize the Parse API client.

        Args:
            api_key: API key for authentication. If not provided, reads from PARSE_API_KEY env var.
        """
        self.base_url = "https://api.parse.bot"
        self.scraper_id = "3bdd71ec-f83f-486e-ad7d-f41d77d75337"
        self.api_key = api_key or os.getenv("PARSE_API_KEY")

        if not self.api_key:
            raise ValueError(
                "API key not provided. Set PARSE_API_KEY environment variable or pass api_key parameter."
            )

    def _call(
        self, endpoint: str, method: str = "POST", **params
    ) -> Dict[str, Any]:
        """
        Make a request to the Parse API.

        Args:
            endpoint: The endpoint name to call.
            method: HTTP method (GET or POST).
            **params: Parameters to send with the request.

        Returns:
            Response JSON as a dictionary.

        Raises:
            requests.exceptions.RequestException: If the request fails.
        """
        url = f"{self.base_url}/scraper/{self.scraper_id}/{endpoint}"
        headers = {
            "X-API-Key": self.api_key,
            "Content-Type": "application/json",
        }

        if method.upper() == "GET":
            response = requests.get(url, headers=headers, params=params)
        elif method.upper() == "POST":
            response = requests.post(url, headers=headers, json=params)
        else:
            raise ValueError(f"Unsupported HTTP method: {method}")

        response.raise_for_status()
        return response.json()

    def search_products(self, query: str) -> Dict[str, Any]:
        """
        Search the SPAR product catalog by keyword.

        Args:
            query: Search term to find products by name or description (e.g., 'milk', 'bread', 'coconut').

        Returns:
            Dictionary containing:
                - query: The search term used
                - total_results: Number of matching products
                - products: List of product objects with product_id, name, description, size, and image_url
        """
        return self._call("search_products", method="GET", query=query)


def format_product(product: Dict[str, Any]) -> str:
    """Format a product dictionary for display."""
    return (
        f"  • {product['name']}\n"
        f"    ID: {product['product_id']} | Size: {product['size']}\n"
        f"    Description: {product['description']}\n"
        f"    Image: {product['image_url']}"
    )


def main():
    """Demonstrate practical usage of the SPAR Product Catalog API."""

    # Initialize the client
    client = ParseClient()

    # Define search queries representing a typical shopping workflow
    shopping_list = ["bread", "milk", "coconut"]

    print("=" * 70)
    print("SPAR South Africa Product Catalog Search")
    print("=" * 70)

    # Search for multiple items and collect results
    all_results = {}

    for item in shopping_list:
        print(f"\nSearching for: {item.upper()}")
        print("-" * 70)

        try:
            result = client.search_products(query=item)

            # Store results for later use
            all_results[item] = result

            # Display search summary
            print(f"Found {result['total_results']} product(s)")

            # Display first 3 products
            products_to_show = result["products"][:3]
            for product in products_to_show:
                print(format_product(product))

            if result["total_results"] > 3:
                print(f"  ... and {result['total_results'] - 3} more products")

        except requests.exceptions.RequestException as e:
            print(f"Error searching for '{item}': {e}")

    # Summary report
    print("\n" + "=" * 70)
    print("SHOPPING SUMMARY")
    print("=" * 70)

    total_products_found = sum(r["total_results"] for r in all_results.values())
    print(f"Total items searched: {len(all_results)}")
    print(f"Total products found: {total_products_found}\n")

    for item, result in all_results.items():
        if result["products"]:
            top_product = result["products"][0]
            print(
                f"• {item.upper()}: {top_product['name']} ({top_product['size']})"
            )


if __name__ == "__main__":
    main()
All endpoints · 1 totalmissing one? ·

Search the SPAR brand product catalog by keyword. Returns matching products with their name, description, size, and image URL. The search matches against product names and descriptions. Prices are not available on this site as they vary by store location.

Input
ParamTypeDescription
queryrequiredstringSearch term to find products by name or description (e.g. 'milk', 'bread', 'coconut').
Response
{
  "type": "object",
  "fields": {
    "query": "string",
    "products": "array of product objects with product_id, name, description, size, and image_url",
    "total_results": "integer"
  },
  "sample": {
    "query": "bread",
    "products": [
      {
        "name": "brown bread wheat flour",
        "size": "12.5kg",
        "image_url": "https://www.spar.co.za/CMSWebParts/SPAR/Brands/BrandImage.aspx?thumb=false&Id=799",
        "product_id": "799",
        "description": "Finest quality flour for home made brown bread"
      }
    ],
    "total_results": 5
  }
}

About the SPAR API

What the API Returns

The search_products endpoint accepts a single query string parameter and returns a list of matching SPAR South Africa products. Each product object includes a product_id, name, description, size, and image_url. The response also includes a total_results count and echoes back the original query string for reference. Searches match against both product names and descriptions, so terms like 'coconut' will surface items whose descriptions mention the ingredient even if it is not in the product name.

Coverage and Scope

The catalog reflects SPAR's branded product range for South Africa, covering categories such as dairy, bakery, beverages, snacks, canned goods, and household products. Because SPAR South Africa prices are set at the individual store level, price data is not available in any response field — this is a fundamental characteristic of the source, not a gap in the endpoint.

Using the Data

The image_url field returns a direct link to the product image, suitable for rendering in a storefront or comparison tool. The size field carries the pack or volume information (e.g. 500ml, 1kg) as a string, which can be used for unit-based filtering in downstream logic. Product IDs are stable identifiers useful for deduplicating results or building persistent product references.

Reliability & maintenance

The SPAR API is a managed, monitored endpoint for spar.co.za — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when spar.co.za 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 spar.co.za 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?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Build a grocery list app that resolves typed item names to canonical SPAR product entries with images and descriptions.
  • Populate a nutrition or meal-planning tool with SPAR product data keyed by ingredient keyword.
  • Create a product comparison page that shows SPAR catalog entries alongside other South African retailers.
  • Generate a product image gallery for SPAR items by querying category keywords and collecting image_url fields.
  • Validate whether a specific branded product (e.g. SPAR house-brand bread) exists in the catalog before listing it in a menu or app.
  • Feed a search autocomplete widget that resolves partial grocery terms to full SPAR product names and sizes.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 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.

Frequently asked questions
Does SPAR South Africa offer an official developer API?+
SPAR South Africa does not publish a public developer API or documented data feed for its product catalog. This Parse API provides structured access to the product data available on spar.co.za.
Why are prices missing from the product results?+
SPAR South Africa prices are set at the store level and are not published centrally on spar.co.za. As a result, no price field exists in any product response — this applies to every item returned by search_products, not just certain categories.
Can I retrieve products by category or browse the full catalog?+
Not currently. The API supports keyword search via the query parameter and returns matching products with name, description, size, and image_url. Category-level browsing or a full catalog dump is not covered. You can fork the API on Parse and revise it to add a category-browsing endpoint.
Does the API return store locations or stock availability?+
Not currently. The API covers product catalog data only — name, description, size, and image URL. Store locations, stock levels, and availability by branch are not included. You can fork the API on Parse and revise it to add a store-finder or availability endpoint.
How specific can my search query be?+
The query parameter matches against product names and descriptions, so both broad terms ('milk') and more specific phrases ('low fat yoghurt') are valid. The total_results field in the response indicates how many products matched, which is useful for deciding whether to broaden or narrow the search term.
Page content last updated . Spec covers 1 endpoint from spar.co.za.
Related APIs in Food DiningSee all →
opentable.com API
Search for restaurants across the US with ratings, reviews, photos, and pricing information, plus get real-time availability and autocomplete suggestions as you type. Check reservation openings and explore detailed restaurant features to find and book your perfect dining experience.
resy.com API
Search for restaurants across cities and check real-time availability to find open reservation slots on Resy. Discover trending and top-rated venues with detailed information about dining options, menus, and available time slots across selected dates.
fdc.nal.usda.gov API
Search across thousands of foods to get detailed nutritional information, serving sizes, and ingredient data from USDA's comprehensive food database. Find nutrition facts for branded products, legacy foods, and foundation foods all in one place.
guide.michelin.com API
Access data from guide.michelin.com.
flipp.com API
Search for grocery deals and weekly advertisements across multiple retailers by keyword, store location, or zip code to find the best prices on items you need. Browse flyer items and current promotions to plan your shopping and save money on groceries.
waitrose.com API
Search Waitrose & Partners' online grocery catalog to find products with detailed information including pricing, current promotions, and availability. Get autocomplete suggestions for faster browsing and access complete product details to compare items and find the best deals.
carrefour.es API
Access data from carrefour.es.
opentable.ca API
Search and discover restaurants on OpenTable, view detailed information like menus and reviews, and check real-time dining availability across metro areas. Find top-rated restaurants in your location and instantly see which tables are open for your preferred date and time.