URL: /code/data/organizations/count · Id: `page:/code/data/organizations/count`

# Organization.count

> Count the companies that match your filters, free, before you buy a single row.

`GET https://api.sb/{your-domain}/organizations/count`

Count the companies that match your filters, free, before you buy a single row.

- **Price:** Free
- **Success rate:** 100% of 171,792 calls
- **Freshness:** Fresh for 7 days
- **Emits:** `Organization.counted`
- **Capability:** [Enrichment](https://startupbuilder.dev/systems/sales/enrichment)

```text title="Run it · Ask"
How many US property managers with 20 to 200 staff are there? Spend nothing.
```

```ts title="Run it · SDK"
import { $ } from 'startup-builder'

const result = await $.try.Organization.count({ where: { industries: ['property management'], headcount: { min: 20, max: 200 }, countries: ['US'] }, maxCost: 0 })
```

```json title="Run it · Response"
{
  "count": 4180,
  "ignored": [],
  "observedAt": "2026-10-27T14:02:11Z",
  "method": "estimated"
}
```

## Inputs
| Name | Type | Meaning |
| --- | --- | --- |
| `icp` | `string` | An ICP id. Its saved filters fill `where`. Pass this or `where`. |
| `where` | [`OrganizationFilter`](/code/data/types#organizationfilter) | The filters every Organization call takes: industries, headcount, countries, regions, technologies, keywords, revenue, funding stages, founded year, open roles. |
| `strict` | `boolean` | Refuse with `filter-unsupported`, at $0, instead of listing an unapplied filter in `ignored`. Default `false`. |

## Outputs
| Field | Type | What `null` means |
| --- | --- | --- |
| `count` | `number`, in companies | Never null: a count of 0 means no company matched. |
| `ignored` | `string[]` | Never null: empty when every filter you sent was applied. |
| `observedAt` | `string`, in ISO 8601 | Never null. |
| `method` | `Observed['method']` | Never null. Counts read `'estimated'`: they come from a company index, not a live read of each site. |

## Read the result
| Field | Value | What it means | What to do |
| --- | --- | --- | --- |
| `count` | Under 600 | At 1.5 people a company and 400 new contacts a month, the list runs out in about 2 months. | Add lookalikes and dated reasons to write before you add volume. (list saturation math, our planning number) |
| `count` | Over 4,000 | About 6,000 people at 1.5 a company: well over a year of cold email at 400 new contacts a month. | Size is not your constraint; spend the effort on the sentence that picks who fits. (list saturation math, our planning number) |
| `ignored` | Not empty | No route could apply that filter, so the count is wider than you asked. | Drop the filter, or pass `strict: true` to be refused instead, at $0. (the contract every data call keeps) |
| `method` | `estimated` | Two company indexes can count the same filters 2 to 3 times apart. | Compare your own segments with each other, never with a count from another tool. (measured across two count sources) |

## Effects
**Action class**

None: it reads, so no approval rule names it

**Modes**

- `try`: Counts and stores nothing; a count is free in every mode.
- `send`: Returns a pending Action at once; its Event carries the rows when the read finishes.
- `do`: Waits for the count; a count is free in every mode.

**Idempotency**

The same `Idempotency-Key` with the same input replays the first answer at $0; with other input it returns 409.

**Saved or shared**

Nothing about you. The count is shared across startups for the same filters for 7 days.

**Emits**

`Organization.counted` with `{ count, where, ignored }`

**Performed by**

[Prospector](https://startupbuilder.dev/agents/sales/prospector)

**Price**

Free. Free: every count, in every mode.

**Reliability**

The first route succeeds 100% of 171,792 calls. If it fails, a second route answers at 100% of 26,256 calls, and you pay for one.

**Freshness**

A reading younger than 7 days returns at $0. Readings are shared across startups for the same subject and locale.

**Batch and pages**

Up to 1 filter set a call. It answers in one response.

**Rate**

[The shared rate rules](/code/data#rate): 10 calls a second per key, and an array input counts as one call.

## Refuses when
| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| A call sent with `strict: true` and a filter no route can apply | [`filter-unsupported`](/code/refusals#filter-unsupported) | Drop that filter, or send without `strict` and read what comes back in `ignored`. | [`Organization.count`](/code/data/organizations/count) |

Every data call can also meet [the shared data-call refusals](/code/refusals#data-calls): [`input-missing`](/code/refusals#input-missing), [`limit-exceeded`](/code/refusals#limit-exceeded), [`max-cost`](/code/refusals#max-cost), [`rate-limited`](/code/refusals#rate-limited), [`sources-busy`](/code/refusals#sources-busy), [`venue-unsupported`](/code/refusals#venue-unsupported).

```json
{
  "type": "https://startupbuilder.dev/errors/filter-unsupported",
  "title": "No route can apply a filter you sent",
  "status": 422,
  "detail": "A call sent with `strict: true` and a filter no route can apply.",
  "fix": "Drop that filter, or send without `strict` and read what comes back in `ignored`.",
  "next": {
    "verb": "Organization.count",
    "input": {
      "where": {
        "industries": [
          "property management"
        ],
        "headcount": {
          "min": 20,
          "max": 200
        },
        "countries": [
          "US"
        ]
      }
    }
  },
  "instance": "https://api.sb/leaseline.app/actions/action_1"
}
```

## When it waits
Returns in one response; nothing waits.

## Example

**Ask**

```text
How many US property managers with 20 to 200 staff are there? Spend
nothing.
```

**API**

```bash
curl -G "https://api.sb/leaseline.app/organizations/count" \
  -H "Authorization: Bearer $SB_TOKEN" \
  --data-urlencode "mode=try" \
  --data-urlencode 'where={"industries":["property management"],"headcount":{"min":20,"max":200},"countries":["US"]}' \
  --data-urlencode 'maxCost=0'
```

The response is the one in the Run it window above.

**CLI**

```bash
npx startup-builder do Organization.count --try --data '{"where":{"industries":["property management"],"headcount":{"min":20,"max":200},"countries":["US"]},"maxCost":0}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "mode": "try",
    "code": "return await $.Organization.count({ where: { industries: ['property management'], headcount: { min: 20, max: 200 }, countries: ['US'] }, maxCost: 0 })"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const result = await $.try.Organization.count({
  where: { industries: ['property management'], headcount: { min: 20, max: 200 }, countries: ['US'] },
  maxCost: 0,
})
```

To retry, send the same `Idempotency-Key`: the retry returns the first answer for $0. A new key reads again.

A `sk_test_` key answers these the same way every time, at $0 ([every test value](/code/data#test-values)).

| Test value | Always returns | What it is for |
| --- | --- | --- |
| `US property managers with 20 to 200 staff` | `{"count":4180,"ignored":[]}` | The market Leaseline sells to counts 4,180 companies, every time, for free. |
| `maxCost: 0.0001` | Refuses with [`max-cost`](/code/refusals#max-cost) | Any priced call with a maxCost of 0.0001 is refused before it spends: the price is above the cap. |
| `rate-limited.test` | Refuses with [`rate-limited`](/code/refusals#rate-limited) | Any call naming this hostname answers 429 with Retry-After, so your retry logic runs. |
| `sources-busy.test` | Refuses with [`sources-busy`](/code/refusals#sources-busy) | Any call naming this hostname answers 503 as if every route were busy, and nothing is spent. |

## Used by
- **Workflows:** [Build a verified list](/capabilities/find-customers/build-a-verified-list) · [Pick who to sell to first](/capabilities/find-customers/pick-who-to-sell-to)
- **Jobs:** [Find your first customers](/capabilities/find-customers)

## Related
[`Organization.find`](/code/data/organizations/find) · [`Organization.enrich`](/code/data/organizations/enrich) · [`Organization.resolve`](/code/data/organizations/resolve)