Count
curl --request POST \
--url https://api.revenuebase.ai/v2/contact/count \
--header 'Content-Type: application/json' \
--header 'X-Key: <api-key>' \
--data '
{
"filter": {
"type": "group",
"op": "AND",
"children": [
{
"type": "condition",
"column": "COUNTRY_NAME_PER",
"operator": "eq",
"value": "United States"
},
{
"type": "condition",
"column": "JOB_LEVEL_PER",
"operator": "eq",
"value": "VP"
}
]
},
"mode": "fast"
}
'import requests
url = "https://api.revenuebase.ai/v2/contact/count"
payload = {
"filter": {
"type": "group",
"op": "AND",
"children": [
{
"type": "condition",
"column": "COUNTRY_NAME_PER",
"operator": "eq",
"value": "United States"
},
{
"type": "condition",
"column": "JOB_LEVEL_PER",
"operator": "eq",
"value": "VP"
}
]
},
"mode": "fast"
}
headers = {
"X-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: {
type: 'group',
op: 'AND',
children: [
{
type: 'condition',
column: 'COUNTRY_NAME_PER',
operator: 'eq',
value: 'United States'
},
{type: 'condition', column: 'JOB_LEVEL_PER', operator: 'eq', value: 'VP'}
]
},
mode: 'fast'
})
};
fetch('https://api.revenuebase.ai/v2/contact/count', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.revenuebase.ai/v2/contact/count",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
'type' => 'group',
'op' => 'AND',
'children' => [
[
'type' => 'condition',
'column' => 'COUNTRY_NAME_PER',
'operator' => 'eq',
'value' => 'United States'
],
[
'type' => 'condition',
'column' => 'JOB_LEVEL_PER',
'operator' => 'eq',
'value' => 'VP'
]
]
],
'mode' => 'fast'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.revenuebase.ai/v2/contact/count"
payload := strings.NewReader("{\n \"filter\": {\n \"type\": \"group\",\n \"op\": \"AND\",\n \"children\": [\n {\n \"type\": \"condition\",\n \"column\": \"COUNTRY_NAME_PER\",\n \"operator\": \"eq\",\n \"value\": \"United States\"\n },\n {\n \"type\": \"condition\",\n \"column\": \"JOB_LEVEL_PER\",\n \"operator\": \"eq\",\n \"value\": \"VP\"\n }\n ]\n },\n \"mode\": \"fast\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.revenuebase.ai/v2/contact/count")
.header("X-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"type\": \"group\",\n \"op\": \"AND\",\n \"children\": [\n {\n \"type\": \"condition\",\n \"column\": \"COUNTRY_NAME_PER\",\n \"operator\": \"eq\",\n \"value\": \"United States\"\n },\n {\n \"type\": \"condition\",\n \"column\": \"JOB_LEVEL_PER\",\n \"operator\": \"eq\",\n \"value\": \"VP\"\n }\n ]\n },\n \"mode\": \"fast\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revenuebase.ai/v2/contact/count")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"type\": \"group\",\n \"op\": \"AND\",\n \"children\": [\n {\n \"type\": \"condition\",\n \"column\": \"COUNTRY_NAME_PER\",\n \"operator\": \"eq\",\n \"value\": \"United States\"\n },\n {\n \"type\": \"condition\",\n \"column\": \"JOB_LEVEL_PER\",\n \"operator\": \"eq\",\n \"value\": \"VP\"\n }\n ]\n },\n \"mode\": \"fast\"\n}"
response = http.request(request)
puts response.read_body{
"total": 1318125,
"companies": 323960,
"withEmail": 567221,
"withCellphone": 742003,
"exact": {
"total": true,
"companies": false,
"withEmail": false,
"withCellphone": false
},
"mode": "fast"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Contact Endpoints
Count matching contacts
Find the size of an audience and the availability of email and mobile details.
POST
/
count
Count
curl --request POST \
--url https://api.revenuebase.ai/v2/contact/count \
--header 'Content-Type: application/json' \
--header 'X-Key: <api-key>' \
--data '
{
"filter": {
"type": "group",
"op": "AND",
"children": [
{
"type": "condition",
"column": "COUNTRY_NAME_PER",
"operator": "eq",
"value": "United States"
},
{
"type": "condition",
"column": "JOB_LEVEL_PER",
"operator": "eq",
"value": "VP"
}
]
},
"mode": "fast"
}
'import requests
url = "https://api.revenuebase.ai/v2/contact/count"
payload = {
"filter": {
"type": "group",
"op": "AND",
"children": [
{
"type": "condition",
"column": "COUNTRY_NAME_PER",
"operator": "eq",
"value": "United States"
},
{
"type": "condition",
"column": "JOB_LEVEL_PER",
"operator": "eq",
"value": "VP"
}
]
},
"mode": "fast"
}
headers = {
"X-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: {
type: 'group',
op: 'AND',
children: [
{
type: 'condition',
column: 'COUNTRY_NAME_PER',
operator: 'eq',
value: 'United States'
},
{type: 'condition', column: 'JOB_LEVEL_PER', operator: 'eq', value: 'VP'}
]
},
mode: 'fast'
})
};
fetch('https://api.revenuebase.ai/v2/contact/count', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.revenuebase.ai/v2/contact/count",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
'type' => 'group',
'op' => 'AND',
'children' => [
[
'type' => 'condition',
'column' => 'COUNTRY_NAME_PER',
'operator' => 'eq',
'value' => 'United States'
],
[
'type' => 'condition',
'column' => 'JOB_LEVEL_PER',
'operator' => 'eq',
'value' => 'VP'
]
]
],
'mode' => 'fast'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.revenuebase.ai/v2/contact/count"
payload := strings.NewReader("{\n \"filter\": {\n \"type\": \"group\",\n \"op\": \"AND\",\n \"children\": [\n {\n \"type\": \"condition\",\n \"column\": \"COUNTRY_NAME_PER\",\n \"operator\": \"eq\",\n \"value\": \"United States\"\n },\n {\n \"type\": \"condition\",\n \"column\": \"JOB_LEVEL_PER\",\n \"operator\": \"eq\",\n \"value\": \"VP\"\n }\n ]\n },\n \"mode\": \"fast\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.revenuebase.ai/v2/contact/count")
.header("X-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"type\": \"group\",\n \"op\": \"AND\",\n \"children\": [\n {\n \"type\": \"condition\",\n \"column\": \"COUNTRY_NAME_PER\",\n \"operator\": \"eq\",\n \"value\": \"United States\"\n },\n {\n \"type\": \"condition\",\n \"column\": \"JOB_LEVEL_PER\",\n \"operator\": \"eq\",\n \"value\": \"VP\"\n }\n ]\n },\n \"mode\": \"fast\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revenuebase.ai/v2/contact/count")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"type\": \"group\",\n \"op\": \"AND\",\n \"children\": [\n {\n \"type\": \"condition\",\n \"column\": \"COUNTRY_NAME_PER\",\n \"operator\": \"eq\",\n \"value\": \"United States\"\n },\n {\n \"type\": \"condition\",\n \"column\": \"JOB_LEVEL_PER\",\n \"operator\": \"eq\",\n \"value\": \"VP\"\n }\n ]\n },\n \"mode\": \"fast\"\n}"
response = http.request(request)
puts response.read_body{
"total": 1318125,
"companies": 323960,
"withEmail": 567221,
"withCellphone": 742003,
"exact": {
"total": true,
"companies": false,
"withEmail": false,
"withCellphone": false
},
"mode": "fast"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Credits and plans
PAYG is Pay-as-you-go. AYCE is All-you-can-eat.| Usage | PAYG | AYCE |
|---|---|---|
| Count request, including SmartSearch filters | Free 0 credits | Included 0 credits |
When to use Count
- Size an audience before downloading records.
- Compare filters without spending credits.
- Check email or mobile availability before choosing what to reveal.
Example: size an audience
This request counts VPs located in the United States. Get your API key from the RevenueBase dashboard and set it asREVENUEBASE_API_KEY before running the example.
curl --request POST 'https://api.revenuebase.ai/v2/contact/count' \
--header "X-Key: $REVENUEBASE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"filter": {
"type": "group",
"op": "AND",
"children": [
{
"type": "condition",
"column": "COUNTRY_NAME_PER",
"operator": "eq",
"value": "United States"
},
{
"type": "condition",
"column": "JOB_LEVEL_PER",
"operator": "eq",
"value": "VP"
}
]
},
"mode": "fast"
}'
{
"total": 1318125,
"companies": 323960,
"withEmail": 567221,
"withCellphone": 742003,
"exact": {
"total": true,
"companies": false,
"withEmail": false,
"withCellphone": false
},
"mode": "fast"
}
| Field | What it means |
|---|---|
total | Matching contact rows. Always exact. A row represents a person at a company, so this is not a distinct-person count. |
companies | Distinct companies represented in those rows. |
withEmail | Matching contact rows with an email address. |
withCellphone | Matching contact rows with a mobile number. |
exact | Whether each reported figure is exact. Treat false values as estimates. |
mode | fast by default; use exact for precise distinct-company and availability counts. Exact mode can take longer. |
Limits and errors
Count uses the shared filter limits. A422 means the filter or column needs correction. On a 429, wait
until X-RateLimit-Reset before retrying. An empty audience returns
zero counts and costs 0 credits.
Omitting filter, or sending null, counts the entire dataset.
If you need a count of accounts, use
Company Count.
Next: inspect the audience for free
Send the same filter to View. Keep refining until the sample looks right, then estimate an export with an explicit row cap and contact-data choices.Authorizations
Body
application/json
Audience filter. Reuse it in View and export requests. Omitted/null selects the entire dataset.
Show child attributes
Show child attributes
fast (default) gives an exact total and estimated distinct-company/detail counts. exact makes every reported count precise and can take longer.
Response
Successful Response
The response is of type Response Count V1 Count Post · object.
Was this page helpful?
