Skip to main content

GET /api/v1/public/lead-lists/:id/enrichment/count/

Get the count of prospects that need email or phone enrichment, along with cost estimates and available credits. Auth: X-API-Key

Path Parameters

  • id (integer, required): Lead list ID

Query Parameters

ParameterTypeRequiredDefaultDescription
enrichment_typestringNoFIND_EMAILType of enrichment: FIND_EMAIL, FIND_EMAIL_WATERFALL, or FIND_PHONE
sort_fieldstringNoidField to sort by
sort_directionstringNoascSort direction (asc or desc)
You can also add filter parameters as query strings.

Enrichment Types and Costs

TypeDescriptionCost per Lead
FIND_EMAILBasic email finding3 credits
FIND_EMAIL_WATERFALLAdvanced email finding with multiple providers6 credits
FIND_PHONEPhone number finding30 credits

Response

{
  "success": true,
  "enrichment_type": "FIND_EMAIL",
  "unenriched_count": 150,
  "cost_per_lead": 3,
  "total_cost": 450,
  "available_credits": 1000,
  "has_enough_credits": true
}

Response Fields

FieldTypeDescription
successbooleanWhether the request was successful
enrichment_typestringThe enrichment type requested
unenriched_countintegerNumber of prospects that need enrichment
cost_per_leadintegerCredits cost per prospect
total_costintegerTotal credits needed to enrich all prospects
available_creditsintegerYour current credit balance
has_enough_creditsbooleanWhether you have enough credits for all prospects

Notes

  • PEOPLE Lists Only: Email/phone enrichment is only available for people lists (not company lists)
  • Automatic Filtering: The endpoint automatically excludes prospects that already have valid emails/phones
  • Credit Check: Use this endpoint before enriching to ensure you have enough credits

Error Responses

400 Bad Request

{
  "error": "Email/phone enrichment is only available for people lists"
}
{
  "error": "enrichment_type must be FIND_EMAIL, FIND_EMAIL_WATERFALL, or FIND_PHONE"
}

404 Not Found

{
  "error": "Lead list not found"
}

Example Usage

# Check how many prospects need email enrichment
curl -X GET "https://api.seleqt.ai/api/v1/public/lead-lists/123/enrichment/count/?enrichment_type=FIND_EMAIL" \
  -H "X-API-Key: <your-api-key>"

# Check phone enrichment cost
curl -X GET "https://api.seleqt.ai/api/v1/public/lead-lists/123/enrichment/count/?enrichment_type=FIND_PHONE" \
  -H "X-API-Key: <your-api-key>"
import requests

API_KEY = "<your-api-key>"
BASE_URL = "https://api.seleqt.ai/api/v1"

# Check email enrichment count and cost
response = requests.get(
    f"{BASE_URL}/public/lead-lists/123/enrichment/count/",
    headers={"X-API-Key": API_KEY},
    params={"enrichment_type": "FIND_EMAIL"}
)

data = response.json()
print(f"Prospects needing enrichment: {data['unenriched_count']}")
print(f"Total cost: {data['total_cost']} credits")
print(f"Available credits: {data['available_credits']}")

if data['has_enough_credits']:
    print("✓ You have enough credits to proceed")
else:
    print("✗ Insufficient credits")

# Check phone enrichment cost
phone_response = requests.get(
    f"{BASE_URL}/public/lead-lists/123/enrichment/count/",
    headers={"X-API-Key": API_KEY},
    params={"enrichment_type": "FIND_PHONE"}
)

phone_data = phone_response.json()
print(f"Phone enrichment would cost: {phone_data['total_cost']} credits")

Workflow Example

# Step 1: Check cost before enriching
count_response = requests.get(
    f"{BASE_URL}/public/lead-lists/123/enrichment/count/",
    headers={"X-API-Key": API_KEY},
    params={"enrichment_type": "FIND_EMAIL"}
)

count_data = count_response.json()

# Step 2: Decide whether to proceed based on cost and available credits
if count_data['has_enough_credits']:
    # Step 3: Proceed with enrichment
    enrich_response = requests.post(
        f"{BASE_URL}/public/lead-lists/123/enrichment/",
        headers={"X-API-Key": API_KEY},
        json={
            "enrichment_type": "FIND_EMAIL",
            "prospect_limit": count_data['unenriched_count']
        }
    )

    if enrich_response.json()['success']:
        print(f"Enriching {count_data['unenriched_count']} prospects...")
else:
    print(f"Need {count_data['total_cost']} credits, but only have {count_data['available_credits']}")
    print("Please purchase more credits to continue")