# Products search

Search JioMart’s national catalogue by query with product identity, price data and page continuation.

- Platform: [JioMart](https://docs.upscrape.com/docs/platforms/jiomart)
- Capability ID: `jiomart.products.search`
- Cost: 1 credit per request
- Maximum runtime: 30 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": {
    "page": 1,
    "page_size": 20,
    "pincode": "400001",
    "query": "rice"
  },
  "capability": "jiomart.products.search"
}'
```

## Input

Provide a nonblank query. A top-level pincode must be a six-digit Indian PIN with a nonzero first digit; location may carry pincode, city and state. If both top-level and nested PINs are supplied, they must agree.

page is a native JioMart page number starting at 1. page_size accepts 1 to 100 and bounds the rows returned from that native page. Use returned page_id continuation to resume any unreturned rows.

sort_on is passed through to JioMart. Reuse a returned page_id only with the same query, PIN, sort and page_size.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `location` | `object` | No |  |
| `location.city` | `string` | No | City name. |
| `location.pincode` | `string` | No | Postal code (PIN) that sets the delivery location. |
| `location.state` | `string` | No | State or region name. |
| `page` | `integer` | No | Native upstream page number. Use returned page_id continuation to consume every row when page_size is smaller than a native page. At least 1. |
| `page_id` | `string` | No | Use the returned pagination.next_cursor or page.next_id unchanged, with the same query, filter, collection, PIN, sort and page_size. |
| `page_size` | `integer` | No | Maximum products returned from one native page. Returned continuation preserves any remaining rows; no additional native pages are scanned in this call. From 1 to 100. |
| `pincode` | `string` | No | Postal code (PIN) that sets the delivery location. |
| `query` | `string` | Yes | Search query. |
| `sort_on` | `string` | No | Passed unchanged to JioMart; results preserve JioMart's own order. price_asc is not guaranteed to be strictly ascending. No local page sorting. |

### Example input

```json
{
  "page": 1,
  "page_size": 20,
  "pincode": "400001",
  "query": "rice"
}
```

## Response

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

Search is national-catalogue data. A returned product, price, sellable value or store ID does not by itself establish local quick-commerce stock or delivery to the requested PIN.

Use page.next_id or pagination.next_cursor unchanged to continue the same request context. Numeric page selects an upstream page rather than an offset derived from page_size.

price_asc preserves JioMart’s returned order but is not guaranteed to be strictly ascending within or across pages.

### Illustrative sample output

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

```json
{
  "items": [
    {
      "brand": {
        "_custom_json": {},
        "action": {
          "page": {
            "query": {
              "brand": [
                ""
              ]
            },
            "type": "products"
          },
          "type": "page"
        },
        "name": "india gate",
        "type": "brand",
        "uid": 52
      },
      "discount": "",
      "name": "India Gate Mini Mogra-II Basmati Rice 10 kg",
      "price": {
        "currency_code": "INR",
        "currency_symbol": "₹",
        "effective": {
          "max": 493,
          "min": 493
        },
        "marked": {
          "max": 599,
          "min": 599
        }
      },
      "sellable": true,
      "slug": "india-gate-mini-mogra-ii-basmati-rice-10-kg-mffn6l-7534952",
      "store_ids": [
        3442
      ],
      "uid": 7534952
    },
    {
      "brand": {
        "_custom_json": {},
        "action": {
          "page": {
            "query": {
              "brand": [
                ""
              ]
            },
            "type": "products"
          },
          "type": "page"
        },
        "name": "india gate",
        "type": "brand",
        "uid": 52
      },
      "discount": "",
      "name": "India Gate Daily Delight Pure Basmati Rice 5 kg",
      "price": {
        "currency_code": "INR",
        "currency_symbol": "₹",
        "effective": {
          "max": 340,
          "min": 340
        },
        "marked": {
          "max": 440,
          "min": 440
        }
      },
      "sellable": true,
      "slug": "india-gate-daily-delight-pure-basmati-rice-5-kg-mffn77-7536285",
      "store_ids": [
        3442
      ],
      "uid": 7536285
    },
    {
      "brand": {
        "_custom_json": {},
        "action": {
          "page": {
            "query": {
              "brand": [
                ""
              ]
            },
            "type": "products"
          },
          "type": "page"
        },
        "name": "Good Life",
        "type": "brand",
        "uid": 462
      },
      "discount": "",
      "name": "Good Life Rozana Basmati Rice 5 kg",
      "price": {
        "currency_code": "INR",
        "currency_symbol": "₹",
        "effective": {
          "max": 369,
          "min": 369
        },
        "marked": {
          "max": 375,
          "min": 375
        }
      },
      "sellable": true,
      "slug": "good-life-rozana-basmati-rice-5-kg-mffn5s-7533184",
      "store_ids": [
        3442
      ],
      "uid": 7533184
    }
  ],
  "page": {
    "has_next": true,
    "has_previous": false,
    "item_total": 4610,
    "next_id": "2",
    "type": "cursor"
  },
  "pagination": {
    "has_more": true,
    "next_cursor": "2",
    "total": 4610
  }
}
```
### Illustrative output fields

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

| Path | Observed type | Example |
| --- | --- | --- |
| `items` | `array` | 3 items |
| `items` | `array` | 3 items |
| `page` | `object` | 5 fields |
| `page.has_next` | `boolean` | true |
| `page.has_previous` | `boolean` | false |
| `page.item_total` | `integer` | 4610 |
| `page.next_id` | `string` | 2 |
| `page.type` | `string` | cursor |
| `pagination` | `object` | 3 fields |
| `pagination.has_more` | `boolean` | true |
| `pagination.next_cursor` | `string` | 2 |
| `pagination.total` | `integer` | 4610 |

## 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)
