# Search products

Search the Instamart catalogue for a query at a selected store or delivery location, with pack prices, stock, match positions, result kinds, filters and continuation.

- Platform: [Swiggy Instamart](https://docs.upscrape.com/docs/platforms/swiggy-instamart)
- Capability ID: `swiggy-instamart.products.search`
- Cost: 1 credit per request
- Maximum runtime: 120 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
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 '{
  "input": {
    "query": "milk",
    "store_id": "1396284"
  },
  "capability": "swiggy-instamart.products.search"
}'
```

## Input

Provide store_id, a six-digit pincode, or both lat and lng. Store takes precedence over pincode, which takes precedence over coordinates. Prefer one selector and retain the returned store and delivery point; one pincode does not describe every address in its area.

Provide a nonblank query of at most 200 characters. Use returned next_offset for continuation; there is no result-limit input.

Choose sort from relevance, price_low_to_high, price_high_to_low or discount_high_to_low. Numeric sorts order the packs on the returned page, not the entire catalogue. Choose brands and types from available_filters, with at most ten unique values in each; min_rating accepts 3, 4 or 4.5.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `brands` | `array<string>` | No | Selected brand values from available_filters |
| `lat` | `number` | No | Latitude in decimal degrees. From -90 to 90. |
| `lng` | `number` | No | Longitude in decimal degrees. From -180 to 180. |
| `min_rating` | `number` | No | Minimum rating facet Allowed values: `3`, `4`, `4.5`. |
| `offset` | `string` | No | Opaque next_offset from the previous search page, scoped to this query and location. Legacy page:items cursors remain accepted. |
| `pincode` | `string` | No | 6-digit Indian PIN code; the store serving it is resolved automatically (alternative to store_id) |
| `primary_store_id` | `string` | No | Primary store ID; defaults to store_id |
| `query` | `string` | Yes | Product search text |
| `secondary_store_id` | `string` | No | Secondary store ID when the location has one |
| `sort` | `string` | No | Listing order; relevance is the default Allowed values: `relevance`, `price_low_to_high`, `price_high_to_low`, `discount_high_to_low`. |
| `store_id` | `string` | No | Instamart store ID (alternative to pincode; takes precedence when both are given) |
| `types` | `array<string>` | No | Selected type values from available_filters |

### Example input

```json
{
  "query": "milk",
  "store_id": "1396284"
}
```

## Response

Successful output is returned in `results[0].data`.

Use offer_price_paise, mrp_paise and discount_paise for price arithmetic, dividing by 100 to display rupees. Missing monetary fields remain unknown; a real zero stays zero. Compare the same SKU and pack size, and inspect in_stock separately from price.

Follow next_offset unchanged with the same location, store, query, sorting, filters and layout. An empty product page can still have a continuation. Check pagination_status and pagination_reason; limited or unknown states do not establish complete catalogue coverage.

Only result_type: match rows receive position. Keep promoted, sold_out_collection and other rows separate. An absent sponsorship flag is unknown, and search absence is not a stockout. Confirm availability with product.get at the same location.

### Illustrative sample output

This example shows one response. Values and optional fields vary with the data available.

```json
{
  "available_filters": {
    "facets": {
      "brand": [
        "Amul",
        "Akshayakalpa",
        "Nandini"
      ],
      "rating": [
        "3+",
        "4+",
        "4.5+"
      ],
      "type": [
        "Fresh Milk",
        "Tetra Milk",
        "Milk Powder"
      ]
    },
    "sorts": [
      {
        "key": "relevance",
        "label": "Relevance"
      },
      {
        "key": "price_low_to_high",
        "label": "Price (Low To High)"
      },
      {
        "key": "price_high_to_low",
        "label": "Price (High To Low)"
      }
    ]
  },
  "next_offset": "im1.[redacted:token]",
  "pagination_status": "continuation_available",
  "products": [
    {
      "badges": [
        "Bestseller"
      ],
      "brand": "Nandini",
      "category": "Milk",
      "id": "CCX1XWR7GN",
      "image": "NI_CATALOG/IMAGES/ciw/2025/12/17/[redacted:token].png",
      "image_url": "https://instamart-media-assets.swiggy.com/swiggy/image/upload/fl_lossy,f_auto,q_auto/NI_CATALOG/IMAGES/ciw/2025/12/17/[redacted:token].png",
      "in_stock": true,
      "max_per_order": 1,
      "mrp": "108",
      "mrp_paise": 10800,
      "name": "Nandini Shubham Milk",
      "offer_price": "108",
      "offer_price_paise": 10800,
      "position": 1,
      "product_url": "https://www.swiggy.com/instamart/item/CCX1XWR7GN",
      "quantity": "500 ml x 4",
      "rating": "4.4",
      "rating_count": "118k",
      "rating_value": 4.4,
      "result_type": "match",
      "sku": "SS8P89LI92",
      "source_widget_type": "type.googleapis.com/swiggy.im.v1.ItemCollectionCard",
      "store_id": "1396284"
    },
    {
      "badges": [
        "Bestseller"
      ],
      "brand": "Nandini",
      "category": "Milk",
      "id": "CCX1XWR7GN",
      "image": "NI_CATALOG/IMAGES/ciw/2025/12/17/[redacted:token].png",
      "image_url": "https://instamart-media-assets.swiggy.com/swiggy/image/upload/fl_lossy,f_auto,q_auto/NI_CATALOG/IMAGES/ciw/2025/12/17/[redacted:token].png",
      "in_stock": true,
      "max_per_order": 3,
      "mrp": "54",
      "mrp_paise": 5400,
      "name": "Nandini Shubham Milk",
      "offer_price": "54",
      "offer_price_paise": 5400,
      "position": 2,
      "product_url": "https://www.swiggy.com/instamart/item/CCX1XWR7GN",
      "quantity": "500 ml x 2",
      "rating": "4.4",
      "rating_count": "118k",
      "rating_value": 4.4,
      "result_type": "match",
      "sku": "TK6K7BDQRM",
      "source_widget_type": "type.googleapis.com/swiggy.im.v1.ItemCollectionCard",
      "store_id": "1396284"
    },
    {
      "badges": [
        "Bestseller"
      ],
      "brand": "Nandini",
      "category": "Milk",
      "id": "CCX1XWR7GN",
      "image": "NI_CATALOG/IMAGES/ciw/2025/12/17/[redacted:token].png",
      "image_url": "https://instamart-media-assets.swiggy.com/swiggy/image/upload/fl_lossy,f_auto,q_auto/NI_CATALOG/IMAGES/ciw/2025/12/17/[redacted:token].png",
      "in_stock": true,
      "max_per_order": 20,
      "mrp": "27",
      "mrp_paise": 2700,
      "name": "Nandini Shubham Milk",
      "offer_price": "27",
      "offer_price_paise": 2700,
      "position": 3,
      "product_url": "https://www.swiggy.com/instamart/item/CCX1XWR7GN",
      "quantity": "500 ml",
      "rating": "4.4",
      "rating_count": "118k",
      "rating_value": 4.4,
      "result_type": "match",
      "sku": "793U9Z9S0Q",
      "source_widget_type": "type.googleapis.com/swiggy.im.v1.ItemCollectionCard",
      "store_id": "1396284"
    }
  ]
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `available_filters` | `object` | 2 fields |
| `available_filters.facets` | `object` | 3 fields |
| `available_filters.sorts` | `array` | 3 items |
| `next_offset` | `string` | im1.[redacted:token] |
| `pagination_status` | `string` | continuation_available |
| `products` | `array` | 3 items |
| `products` | `array` | 3 items |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
