# How many stores run an app (free)

`GET /v1/apps/{slug}/companies/count`

Counts the Shopify stores running an app with the same filters as the list, **free**, so you know the cost before you pull rows.

- **Auth:** API key ([Authentication](https://installgraph.com/docs/authentication.md))
- **Scope:** `companies:read`
- **Cost:** Free and unlimited.

Call it before every `GET /v1/apps/{slug}/companies` pull: the count is the most that pull can cost.

The number of stores `/v1/apps/{slug}/companies` would list with the same filters. Free and unlimited,
so you can narrow a query before paying for rows. Scope `companies:read`.

## Request

```bash
curl "https://api.installgraph.com/v1/apps/klaviyo/companies/count?country=GB&industry=Apparel" \
  -H "Authorization: Bearer $INSTALLGRAPH_API_KEY"
```

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `slug` | string | Yes | Example: `klaviyo`. |

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `country` | string | No | ISO 3166-1 alpha-2 country the store sells from (Shopify's `Shopify.country`). Example: `US`. |
| `region` | Region | No | A world region, i.e. its countries. Combined with `country`, both must hold. One of `north-america`, `latin-america`, `europe`, `middle-east-africa`, `asia-pacific`. |
| `industry` | string | No | A top-level industry (`Apparel`, which also matches stores placed at that level only) or a subcategory (`Apparel/Footwear`). `GET /v1/industries` lists them. Example: `Apparel/Footwear`. |
| `aov` | string | No | One or more typical order-value bands in USD, comma-separated (`100-200,200-500`). `GET /v1/industries` lists them. Example: `100-200`. |

## Response

`200`. The example's stores are fictional.

```json
{
  "data": {
    "app": "klaviyo",
    "count": 1284
  },
  "meta": {
    "requestId": "6f1c2a9e-4b7d-4e2a-9c51-0d3b8e7f2a14",
    "creditsUsed": 0,
    "creditsCharged": 0,
    "creditsRemaining": 47,
    "freeRepulls": 0
  }
}
```

### Fields

| Field | Type | Description |
| --- | --- | --- |
| `data.app` | string |  |
| `data.count` | integer |  |

Every keyed response also carries `meta` (`requestId`, `creditsUsed`, `creditsRemaining`, `freeRepulls`) and the `X-Credits-*` and `X-RateLimit-*` headers. See [Credits](https://installgraph.com/docs/credits.md) and [Rate limits](https://installgraph.com/docs/rate-limits.md).

## Errors

| Status | Code | Meaning | What to do |
| --- | --- | --- | --- |
| 404 | `not_found` | No such endpoint, app, or store (or not scanned yet). | Check the slug or domain. Store 404s are free within the lookup-miss allowance. |

All codes: [Errors](https://installgraph.com/docs/errors.md).
