Skip to main content
POST
/
search
/
count
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"}
      ]
    }
  }'
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")
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`);
{
  "total_results": 242,
  "total_results_is_capped": false
}
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

ActionCredits
CountFree

Request Body

category
string
required
Category to count: "people" or "company".
filters
object
required
Filters in FilterGroup format — the same structure returned by Text to Filters and accepted by /search/people and /search/companies.

Response

total_results
integer
Number of matching records. Capped at 10,000.
total_results_is_capped
boolean
true when total_results reached the 10,000 cap — the real count is higher (display it as “10,000+”).

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"}
      ]
    }
  }'
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")
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`);
{
  "total_results": 242,
  "total_results_is_capped": false
}