# Shopify

Measured Shopify storefront data, one operation per call. Any Shopify-powered store, named by its URL. Every fetch adds a price and stock point to each product's history. ops: products (the catalogue of up to five stores — title, brand, category, tags, price range, sale flag, stock, variant count, every variant with SKU/price/stock, options, images, created and published dates), history (stored price/stock series of a product already held, by product URL, free). Fresh fetches cost credits; anything already held is free.

`POST https://api.zomler.com/api/v1/platforms/shopify`

-   [products](#products)
-   [history](#history)

## products

from 25 credits for 25 · fresh for 1 day

The catalogue of up to five Shopify storefronts — every product with its price range, sale flag, stock, variants and options.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `subjects` (required) | list of string | — | 1-5 items |
| `limit` | integer | `25` | 1-100 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/shopify \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "products",
    "subjects": [
      "example"
    ]
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/shopify", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "products",
      "subjects": [
        "example"
      ]
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/shopify",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "products",
        "subjects": [
          "example"
        ]
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

## history

free · reads what is held

Stored price/stock series of a store's products already held — free.

### Request fields

| Field | Type | Default | Values / limits |
| --- | --- | --- | --- |
| `subjects` (required) | list of string | — | 1-5 items |
| `metric` | enum | `price_from` | `price_from`, `price_to`, `in_stock`, `variant_count` |
| `days` | integer | `90` | 1-730 |

### Example

```bash
curl -X POST https://api.zomler.com/api/v1/platforms/shopify \
  -H "X-API-Key: zk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "request": {
    "op": "history",
    "subjects": [
      "example"
    ]
  },
  "estimateOnly": false
}'
```

```js
const res = await fetch("https://api.zomler.com/api/v1/platforms/shopify", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.ZOMLER_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "request": {
      "op": "history",
      "subjects": [
        "example"
      ]
    },
    "estimateOnly": false
  }),
});
const envelope = await res.json();
console.log(envelope.data, envelope.cost.creditsCharged);
```

```python
import os, httpx

res = httpx.post(
    "https://api.zomler.com/api/v1/platforms/shopify",
    headers={"X-API-Key": os.environ["ZOMLER_API_KEY"]},
    json={
      "request": {
        "op": "history",
        "subjects": [
          "example"
        ]
      },
      "estimateOnly": False
    },
    timeout=120,
)
envelope = res.json()
print(envelope["data"], envelope["cost"]["creditsCharged"])
```

---

Source: https://zomler.com/docs/api/platforms/shopify
