Python httpx + asyncio.gather · Partner + Fund Fan-Out · 0-Credit 404 Anti-Hallucination
VC & Investor CRM Enrichment API in Python (httpx + asyncio).
Direct Answer · Production Pattern (Updated 2026-11-27)
To enrich a venture capital CRM (Affinity, Attio, HubSpot, or Airtable) without LinkedIn li_at cookies or $12K+ annual seat contracts, fan out GET /v1/profile (partner handle, e.g. fredwilson / reidhoffman) and GET /v1/company?domain= (fund domain, e.g. usv.com / greylock.com) concurrently with httpx.AsyncClient + asyncio.gather. Verified 200 records cost $0.40–$1.00 per 1,000 lookups, while invalid or AI-hallucinated slugs return HTTP 404 at strictly 0 Credits.
Model Your Investor Batch Cost & 404 Savings
Adjust your VC partner count, parent fund domains, and expected dead-slug rate (10–25% is typical for outbound fundraise lists or LLM-extracted handles) to estimate runtime and credit spend.
Interactive Simulator · VC CRM Batch Cost & 404 Zero-Charge Calculator
10 Credits / Verified 200 · 0 Credits on 4041. CRM Dataset Preset
2. Concurrency & Rate Tier (asyncio.Semaphore)
Estimated Pipeline Execution & Cost
2,975
29,750 Credits billed525
$0.00 charged (saved $0.53)- B2BProfile API Effective Cost (60 RPM)
- $2.26 (PAYG $9.00)
- Legacy Enrichment APIs ($280/1K ref.)
- $980
- Wall-Clock Runtime (httpx + Semaphore(6))
- ~59 min
Step 1 · Concurrent Partner + Fund Pipeline (Zero Cookies)
Production Python httpx + asyncio.gather Script
Uses asyncio.Semaphore to stay inside your plan's RPM ceiling, runs /v1/profile and /v1/company in parallel per investor row, and drops hallucinated handles cleanly on HTTP 404 (0 Credits).
import asyncio
import os
import httpx
API_KEY = os.environ["B2BPROFILE_API_KEY"]
BASE_URL = "https://api.b2bprofileapi.com"
HEADERS = {"X-API-Key": API_KEY, "Accept": "application/json"}
# Public benchmark pairs: partner LinkedIn handle + parent VC fund domain
INVESTOR_ROWS = [
{"partner_slug": "fredwilson", "fund_domain": "usv.com"},
{"partner_slug": "reidhoffman", "fund_domain": "greylock.com"},
{"partner_slug": "nonexistent-hallucinated-vc-slug-999", "fund_domain": "usv.com"},
]
async def safe_get(
client: httpx.AsyncClient,
sem: asyncio.Semaphore,
path: str,
params: dict[str, str],
) -> dict | None:
async with sem:
for attempt in range(3):
resp = await client.get(f"{BASE_URL}{path}", params=params, headers=HEADERS)
if resp.status_code == 404:
# Anti-hallucination gate: dead/invented LinkedIn handles return 404 at 0 Credits
return None
if resp.status_code in (429, 502, 503):
retry_after = float(resp.headers.get("Retry-After", 1.5 * (attempt + 1)))
await asyncio.sleep(min(retry_after, 10.0))
continue
resp.raise_for_status()
return resp.json()["data"]
return None
async def enrich_investor_row(
client: httpx.AsyncClient,
sem: asyncio.Semaphore,
row: dict[str, str],
) -> dict:
# Fan out Partner (/v1/profile) + Fund (/v1/company) concurrently in a single await
partner, fund = await asyncio.gather(
safe_get(client, sem, "/v1/profile", {"username": row["partner_slug"]}),
safe_get(client, sem, "/v1/company", {"domain": row["fund_domain"]}),
)
return {
"input_slug": row["partner_slug"],
"verified": partner is not None,
"partner_name": partner.get("full_name") if partner else None,
"headline": partner.get("headline") if partner else None,
"fund_name": fund.get("name") if fund else None,
"fund_hq": fund.get("headquarters") if fund else None,
"fund_followers": fund.get("followers_count") if fund else None,
"fund_size": fund.get("company_size") if fund else None,
}
async def main() -> None:
# Tune Semaphore to your tier: Starter 60 RPM -> 6, Pro 180 RPM -> 15, Business 300 RPM -> 25
sem = asyncio.Semaphore(6)
limits = httpx.Limits(max_connections=20, max_keepalive_connections=10)
async with httpx.AsyncClient(timeout=20.0, limits=limits) as client:
enriched = await asyncio.gather(*(enrich_investor_row(client, sem, r) for r in INVESTOR_ROWS))
for rec in enriched:
print(rec)
if __name__ == "__main__":
asyncio.run(main())Step 2 · Verified Sanitized JSON Receipts (usv.com · greylock.com · 404 Gate)
Real API Responses & Zero-Charge 404 Verification
Captured against api.b2bprofileapi.com using public venture firms (usv.com, greylock.com) plus a synthetic dead handle verifying credits_charged: 0.
HTTP 200 (10 Credits) / HTTP 404 (0 Credits)
Live JSON Receipts · usv.com + greylock.com + 404 Zero-Charge
{
"partner_and_fund_pair_1": {
"endpoint": "/v1/company?domain=usv.com",
"status": "ok",
"data": {
"slug": "union-square-ventures",
"name": "Union Square Ventures",
"domain": "usv.com",
"industry": "Venture Capital and Private Equity Principals",
"company_size": "11-50 employees",
"headquarters": "New York, NY, US",
"followers_count": 37956,
"linkedin_url": "https://www.linkedin.com/company/union-square-ventures"
},
"meta": { "credits_charged": 10, "cache_hit": true }
},
"partner_and_fund_pair_2": {
"endpoint": "/v1/company?domain=greylock.com",
"status": "ok",
"data": {
"slug": "greylock-partners",
"company_id": "18077",
"name": "Greylock Partners",
"domain": "greylock.com",
"industry": "Venture Capital and Private Equity Principals",
"company_size": "51-200 employees",
"headquarters": "Menlo Park, CA, US",
"followers_count": 258557,
"linkedin_url": "https://www.linkedin.com/company/greylock-partners"
},
"meta": { "credits_charged": 10, "cache_hit": true }
},
"anti_hallucination_404_check": {
"endpoint": "/v1/profile?username=nonexistent-hallucinated-vc-slug-999",
"http_status": 404,
"error": { "code": "entity_not_found" },
"meta": { "credits_charged": 0 }
}
}Step 3 · Unit Economics · 2,500 VC Partners + 1,000 Funds (15% Dead Slugs)
Cost Breakdown: B2BProfile API vs Legacy Stacks
| Provider / Stack | Billing & 404 Policy | Billed Volume | Total Cost | Cookie / Ban Risk |
|---|---|---|---|---|
| B2BProfile API (Starter $19/mo · 60 RPM) ★ | 10 Credits / 200 · 0 Credits on 404 | 2,975 verified (525 404s free) | $2.26 effective (in $19/mo) | None (0% ban risk) |
| B2BProfile API ($9 One-Time PAYG) ★ | Never-expiring credits · 0 Credits on 404 | 2,975 verified (525 404s free) | $2.98 effective (in $9 pack) | None (0% ban risk) |
| People Data Labs Pro / Enrichment APIs | $98–$2,500/mo · Split Person/Company pools | 3,500 total attempts | $280–$980+ | None (static snapshot lag) |
| Enterprise VC CRM Add-Ons (Annual Seat) | Annual contract · Per-seat lock-in | Seat-bundled | $12,000–$30,000 / yr | No direct bulk REST export |
VC CRM Enrichment Pipeline FAQ
Why use Python httpx with asyncio.gather instead of sequential requests.get for VC CRM enrichment?
Sequential requests.get loops block for 1–4 seconds per uncached LinkedIn lookup, turning a 3,500-row investor + fund sync into a 3-hour script. Pairing httpx.AsyncClient with asyncio.Semaphore and asyncio.gather enriches both the partner (/v1/profile) and parent fund (/v1/company?domain=) concurrently while respecting your exact 60–300 RPM quota.
How does HTTP 404 zero-charge prevent LLM hallucinated investor handles from polluting Affinity or Attio?
AI prospecting agents frequently guess LinkedIn slugs (such as firstname-lastname) that do not exist. When B2BProfile API confirms a handle is missing, it returns HTTP 404 entity_not_found and deducts strictly 0 Credits—allowing your pipeline to verify every investor handle before upserting into your CRM at zero wasted spend.
Can I pass full LinkedIn URLs, uppercase domains, or partner emails into /v1/profile and /v1/company?
Yes. Both endpoints automatically normalize full https://www.linkedin.com/in/... URLs, trailing slashes, tracking query parameters (?trk=), double-encoded European UTF-8 slugs, and root fund domains or emails (such as partner@usv.com -> usv.com).
When should I append ?fresh=1 on a VC investor enrichment run?
Cached lookups return in ~18ms from our PostgreSQL 16 hot cache and cover most quarterly CRM refreshes. When a partner just changed funds or announced a new vehicle, any paid account ($9 PAYG or $19–$199/mo) can pass ?fresh=1 to force a live upstream fetch at the exact same 10-Credit rate.