Back to Blog
TutorialMarch 15, 202610 min read

How to Build a Real-Time Price Comparison App for Quick Commerce in India

Learn how to build a price comparison app that searches products across BlinkIt, Zepto, Swiggy, and more using a single API call.

#price comparison#groupsearch#tutorial#react

If you have ever ordered groceries in India, you know the pain. You open BlinkIt to check the price of Amul Butter, then switch to Zepto to see if it is cheaper, then Swiggy Instamart, then BigBasket. By the time you have compared prices across four apps, ten minutes have passed and you have forgotten what you were cooking. The quick commerce market in India is booming with over 7 major platforms, but there is no easy way to compare prices across all of them in one place.

In this tutorial, we will build a real-time price comparison app using the QuickCommerce API. With a single API call, you can search for any product across multiple platforms and get back prices, availability, and product details. Let us get started.

What is the groupsearch Endpoint?

The groupsearch endpoint is the powerhouse behind multi-platform price comparison. Instead of making separate API calls to each platform, you send a single request with your search query and a list of platforms. The API fans out the request to all specified platforms in parallel and returns unified results. This means you get price data from BlinkIt, Zepto, Swiggy, and BigBasket in one shot, typically in under 2 seconds.

Each platform in the response includes the product name, price, MRP, offer price (if any), images, and availability status. The response format is consistent across all platforms, so you do not need to write different parsing logic for each one. Check the full API documentation for the complete response schema.

Supported Platforms

The QuickCommerce API currently supports 7 major quick commerce platforms in India. For price comparison, you will typically want to query at least the top 4 platforms to get meaningful data. Visit any of the platform pages below to learn about platform-specific features and data.

Making Your First groupsearch Call

Let us start with a practical example. Say you want to compare prices for "Amul Butter 500g" across BlinkIt, Zepto, Swiggy, and BigBasket. Here is what the API call and response look like. You can also try this live in the API Playground.

GET /api/v1/groupsearchSearch for Amul Butter across 4 platforms
Request (cURL)
curl -X GET "https://api.quickcommerceapi.com/api/v1/groupsearch?query=Amul+Butter+500g&platforms=blinkit,zepto,swiggy,bigbasket" \
  -H "X-API-Key: YOUR_API_KEY"
Response (JSON)
{
  "query": "Amul Butter 500g",
  "platforms": {
    "blinkit": {
      "status": "success",
      "products": [
        {
          "name": "Amul Pasteurised Butter 500 g (Carton)",
          "price": 281,
          "mrp": 290,
          "offer_price": 281,
          "image": "https://cdn.blinkit.com/amul-butter-500g.jpg",
          "in_stock": true,
          "quantity": "500 g",
          "brand": "Amul"
        }
      ]
    },
    "zepto": {
      "status": "success",
      "products": [
        {
          "name": "Amul Butter - Pasteurised, 500 g Carton",
          "price": 285,
          "mrp": 290,
          "offer_price": null,
          "image": "https://cdn.zepto.co/amul-butter-500.webp",
          "in_stock": true,
          "quantity": "500 g",
          "brand": "Amul"
        }
      ]
    },
    "swiggy": {
      "status": "success",
      "products": [
        {
          "name": "Amul Pasteurised Butter 500g",
          "price": 276,
          "mrp": 290,
          "offer_price": 276,
          "image": "https://instamart.swiggy.com/amul-butter.jpg",
          "in_stock": true,
          "quantity": "500 g",
          "brand": "Amul"
        }
      ]
    },
    "bigbasket": {
      "status": "success",
      "products": [
        {
          "name": "Amul Pasteurized Butter 500 g (Carton)",
          "price": 279,
          "mrp": 290,
          "offer_price": 279,
          "image": "https://www.bigbasket.com/amul-butter.jpg",
          "in_stock": true,
          "quantity": "500 g",
          "brand": "Amul"
        }
      ]
    }
  },
  "credits_used": 4,
  "response_time_ms": 1847
}

Try it live in the API Playground →

Notice how Swiggy Instamart has the lowest price at Rs 276, while Zepto is the most expensive at Rs 285. That is a difference of Rs 9 on a single item. Across a full grocery order, these differences add up to hundreds of rupees. This is exactly why a price comparison app is so valuable for Indian consumers.

Price Comparison at a Glance

PlatformPriceMRPDiscountIn Stock
BlinkItRs 281Rs 2903.1%Yes
ZeptoRs 285Rs 2901.7%Yes
Swiggy InstamartRs 276Rs 2904.8%Yes
BigBasketRs 279Rs 2903.8%Yes

Price Comparison: Amul Butter 500g

7

Platforms

Supported

<2s

Response Time

Average

50

Free Credits

On Signup

99.9%

API Uptime

Guaranteed

Price Comparison App Architecture

👤UserEnters product
🔍Your AppFrontend
QuickCommerce API/v1/groupsearch
📊ComparisonSide by side

Building the React Frontend

Now let us build a React component that calls the groupsearch endpoint and renders a comparison table. We will use TypeScript for type safety and Tailwind CSS for styling. The component handles loading states, errors, and displays results in a clean card layout.

PriceComparison.tsx — React Component
import { useState } from "react";

interface Product {
  name: string;
  price: number;
  mrp: number;
  offer_price: number | null;
  image: string;
  in_stock: boolean;
  quantity: string;
  brand: string;
}

interface GroupSearchResponse {
  query: string;
  platforms: Record<string, { status: string; products: Product[] }>;
  credits_used: number;
}

const PLATFORMS = ["blinkit", "zepto", "swiggy", "bigbasket"];

export default function PriceComparison() {
  const [query, setQuery] = useState("");
  const [results, setResults] = useState<GroupSearchResponse | null>(null);
  const [loading, setLoading] = useState(false);

  const search = async () => {
    setLoading(true);
    try {
      const res = await fetch(
        `https://api.quickcommerceapi.com/api/v1/groupsearch?query=${encodeURIComponent(query)}&platforms=${PLATFORMS.join(",")}`,
        { headers: { "X-API-Key": process.env.NEXT_PUBLIC_QC_API_KEY! } }
      );
      const data = await res.json();
      setResults(data);
    } catch (err) {
      console.error("Search failed:", err);
    } finally {
      setLoading(false);
    }
  };

  const getBestPrice = () => {
    if (!results) return null;
    let best = { platform: "", price: Infinity };
    for (const [platform, data] of Object.entries(results.platforms)) {
      if (data.products?.[0]?.price < best.price) {
        best = { platform, price: data.products[0].price };
      }
    }
    return best;
  };

  return (
    <div className="max-w-2xl mx-auto p-6">
      <h1 className="text-2xl font-bold mb-4">Quick Commerce Price Compare</h1>
      <div className="flex gap-2 mb-6">
        <input
          value={query}
          onChange={(e) => setQuery(e.target.value)}
          placeholder="Search for a product (e.g. Amul Butter 500g)"
          className="flex-1 border rounded-lg px-4 py-2"
          onKeyDown={(e) => e.key === "Enter" && search()}
        />
        <button onClick={search} disabled={loading}
          className="bg-violet-600 text-white px-6 py-2 rounded-lg disabled:opacity-50">
          {loading ? "Searching..." : "Compare"}
        </button>
      </div>

      {results && (
        <div className="space-y-4">
          {getBestPrice() && (
            <div className="bg-green-50 border border-green-200 rounded-lg p-3 text-sm">
              Best price: <strong>Rs {getBestPrice()!.price}</strong> on{" "}
              <strong>{getBestPrice()!.platform}</strong>
            </div>
          )}
          <div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
            {Object.entries(results.platforms).map(([platform, data]) => (
              <div key={platform} className="border rounded-xl p-4">
                <h3 className="font-semibold capitalize mb-2">{platform}</h3>
                {data.products?.[0] ? (
                  <div className="flex gap-3">
                    <img src={data.products[0].image} alt="" className="w-16 h-16 rounded" />
                    <div>
                      <p className="text-sm">{data.products[0].name}</p>
                      <p className="text-lg font-bold">Rs {data.products[0].price}</p>
                      {data.products[0].offer_price && (
                        <p className="text-xs text-green-600">
                          Offer: Rs {data.products[0].offer_price}
                        </p>
                      )}
                    </div>
                  </div>
                ) : (
                  <p className="text-sm text-gray-500">No results found</p>
                )}
              </div>
            ))}
          </div>
          <p className="text-xs text-gray-400 text-right">
            Credits used: {results.credits_used}
          </p>
        </div>
      )}
    </div>
  );
}

Tip

Visit each platform page for deeper data and platform-specific features. For example, BlinkIt provides sub-category data, while BigBasket includes nutritional information. Check out /platforms/blinkit, /platforms/zepto, /platforms/swiggy, and /platforms/bigbasket.

Adding Location Awareness

Prices on quick commerce platforms can vary by location. A product might be Rs 10 cheaper in Bangalore compared to Mumbai. To get the most accurate prices for your user, you should capture their location and pass the pincode in the request header. Some platforms like DMart, JioMart, and Minutes require the x-geolocation-pincode header to return results.

Geolocation + Pincode — Browser API
// Get user's coordinates from browser
async function getUserPincode(): Promise<string> {
  return new Promise((resolve, reject) => {
    navigator.geolocation.getCurrentPosition(
      async (position) => {
        const { latitude, longitude } = position.coords;
        // Reverse geocode to get pincode (using Google Maps or similar)
        const res = await fetch(
          `https://maps.googleapis.com/maps/api/geocode/json?latlng=${latitude},${longitude}&key=YOUR_GOOGLE_KEY`
        );
        const data = await res.json();
        const pincode = data.results?.[0]?.address_components
          ?.find((c: any) => c.types.includes("postal_code"))?.long_name;
        resolve(pincode || "560001"); // Default to Bangalore
      },
      (err) => reject(err)
    );
  });
}

// Use pincode in API call
const pincode = await getUserPincode();
const res = await fetch(
  "https://api.quickcommerceapi.com/api/v1/groupsearch?query=Amul+Butter&platforms=blinkit,zepto,dmart,jiomart",
  {
    headers: {
      "X-API-Key": "YOUR_API_KEY",
      "x-geolocation-pincode": pincode,
    },
  }
);

Understanding Credit Usage

The groupsearch endpoint charges N credits for N platforms. So if you search across 4 platforms, it costs 4 credits per call. If you search across all 7 platforms, it costs 7 credits. This is important to consider when building your app. For cost-effective usage, you might want to let users select which platforms to compare rather than always querying all 7. Every new account gets 50 free credits to start, which is enough for about 12 four-platform comparisons.

Get Started in 5 Minutes

Ready to build your own price comparison app? Follow these steps to go from zero to working app in just a few minutes. If you are new to the API, check out our getting started guide for a detailed walkthrough.

1

Sign up for a free account

Create your account at quickcommerceapi.com/auth/signup and get 50 free credits instantly. No credit card required.

2

Get your API key

After signing up, copy your API key from the dashboard. You will use this in the X-API-Key header for all requests.

3

Test in the Playground

Head to the API Playground and try a groupsearch query. Test with different products and platforms to see the response format.

4

Build your frontend

Use the React component above as a starting point. Customize the UI to match your app design and add features like sorting, filtering, and favorites.

5

Deploy and share

Deploy your app to Vercel or Netlify. Store your API key in environment variables and never expose it in client-side code.

Try It Live

Want to see the groupsearch endpoint in action before writing any code? Use our interactive API Playground to test queries, see live responses, and experiment with different platform combinations.

Next Steps

Now that you have a working price comparison app, here are some ideas to take it further. You could add price tracking over time to show users historical price trends. Or combine price data with delivery ETA data to help users decide not just where to buy, but when they will get it. For a deeper look at platform differences, check out our platform comparison guide.

Info

The groupsearch endpoint also supports searching on DMart, JioMart, and Minutes. Just add them to the platforms parameter and include the x-geolocation-pincode header for accurate results.

Ready to Get Started?

Sign up for free and get 50 credits instantly. No credit card required. Start querying 7 quick commerce platforms with a single API.