> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dataforb2b.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Count Results

> Count how many records match a FilterGroup, without running the search

Return the number of records matching a FilterGroup, without executing the search or fetching any profiles. Useful for showing a live "X results" counter while a user builds or edits their filters.

## Credit Cost

| Action | Credits |
| ------ | ------- |
| Count  | Free    |

***

## Request Body

<ParamField body="category" type="string" required>
  Category to count: `"people"` or `"company"`.
</ParamField>

<ParamField body="filters" type="object" required>
  Filters in FilterGroup format — the same structure returned by [Text to Filters](/api-reference/text-to-filters) and accepted by `/search/people` and `/search/companies`.
</ParamField>

***

## Response

<ResponseField name="total_results" type="integer">
  Number of matching records. Capped at 10,000.
</ResponseField>

<ResponseField name="total_results_is_capped" type="boolean">
  `true` when `total_results` reached the 10,000 cap — the real count is higher (display it as "10,000+").
</ResponseField>

***

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.dataforb2b.ai/search/count \
    -H "api_key: YOUR_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "category": "people",
      "filters": {
        "op": "and",
        "conditions": [
          {"column": "current_title", "type": "like", "value": "Data Scientist"},
          {"column": "current_company", "type": "=", "value": "Google"}
        ]
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.dataforb2b.ai/search/count",
      headers={
          "api_key": "YOUR_api_key",
          "Content-Type": "application/json"
      },
      json={
          "category": "people",
          "filters": {
              "op": "and",
              "conditions": [
                  {"column": "current_title", "type": "like", "value": "Data Scientist"},
                  {"column": "current_company", "type": "=", "value": "Google"}
              ]
          }
      }
  )

  data = response.json()
  print(f"{data['total_results']}{'+' if data['total_results_is_capped'] else ''} results")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.dataforb2b.ai/search/count', {
    method: 'POST',
    headers: {
      'api_key': 'YOUR_api_key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      category: 'people',
      filters: {
        op: 'and',
        conditions: [
          { column: 'current_title', type: 'like', value: 'Data Scientist' },
          { column: 'current_company', type: '=', value: 'Google' }
        ]
      }
    })
  });

  const data = await response.json();
  console.log(`${data.total_results}${data.total_results_is_capped ? '+' : ''} results`);
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "total_results": 242,
    "total_results_is_capped": false
  }
  ```
</ResponseExample>
