API Reference: B2B Company Enrichment API
Complete reference for the B2B Company Enrichment API. For a hands-on introduction, start with the Quickstart.
Base URL:
https://b2b-enrichment.p.rapidapi.com
Authentication
Every request to POST /api/enrich requires an API key in the X-API-Key header. Get your key by subscribing on RapidAPI.
X-API-Key: YOUR_API_KEY
The GET /api/health endpoint does not require authentication.
Endpoints
POST /api/enrich
Enrich a single company. Returns structured profile data based on the company's public website.
Request Headers
| Header | Required | Value |
|---|---|---|
Content-Type | Yes | application/json |
X-API-Key | Yes | Your RapidAPI key |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
company | string | Yes | A company URL, bare domain, or company name. |
fields | string[] | No | Subset of fields to return. If omitted, all fields are returned. |
Company input formats:
| Input Style | Example | Reliability |
|---|---|---|
| Full URL | https://stripe.com | Highest — no ambiguity |
| Bare domain | stripe.com | High — auto-prefixed with https:// |
| Company name | Stripe | Lower — domain is guessed as https://stripe.com |
Use a URL or domain whenever possible. Name-only lookups depend on a simple .com guess and may fail for companies with non-obvious domains.
Supported Fields
| Field | Type | Description |
|---|---|---|
name | string | null | Official company name |
domain | string | null | Primary domain (e.g., stripe.com) |
industry | string | null | Industry or sector classification |
size | string | null | Employee-count range: 1-10, 11-50, 51-200, 201-500, 501-1000, 1001-5000, 5001-10000, 10000+ |
description | string | null | Concise 1-2 sentence company summary |
techStack | string[] | null | Technologies and frameworks detected from the website |
socialLinks | object | null | Social profile URLs. Keys: linkedin, twitter, facebook, github, instagram, youtube. Missing platforms are omitted. |
founded | string | null | Year the company was founded |
Any field the API cannot determine from the public website is returned as null.
Success Response (200)
{
"success": true,
"data": {
"name": "Stripe",
"domain": "stripe.com",
"industry": "Fintech / Payments",
"size": "5001-10000",
"description": "Stripe builds financial infrastructure and payment software for internet businesses.",
"techStack": ["React", "Ruby", "Go", "AWS"],
"socialLinks": {
"linkedin": "https://www.linkedin.com/company/stripe",
"twitter": "https://twitter.com/stripe",
"github": "https://github.com/stripe"
},
"founded": "2010"
},
"metadata": {
"source": "https://stripe.com",
"enrichedAt": "2026-03-22T10:00:00.000Z",
"responseTimeMs": 3200,
"tokensUsed": 1250,
"fieldsRequested": ["name", "domain", "industry", "size", "description", "techStack", "socialLinks", "founded"]
}
}
Metadata Object
| Field | Type | Description |
|---|---|---|
source | string | The resolved URL that was scraped |
enrichedAt | string | ISO 8601 timestamp of enrichment |
responseTimeMs | number | Total processing time in milliseconds |
tokensUsed | number | Approximate LLM tokens consumed |
fieldsRequested | string[] | The fields used for this enrichment |
Error Responses
All errors follow this shape:
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human-readable description"
}
}
| HTTP Status | Error Code | When It Happens |
|---|---|---|
400 | INVALID_REQUEST | Missing or empty company field. Invalid fields array. Unrecognized field names. Company input cannot be resolved to a URL. Malformed JSON body. |
401 | UNAUTHORIZED | Missing X-API-Key header. Invalid API key. |
429 | RATE_LIMIT_EXCEEDED | More than 10 requests in the current 60-second window. |
502 | SCRAPE_FAILED | The target website could not be fetched. Possible causes: DNS failure, timeout (15s limit), HTTP error, anti-bot protection. |
422 | ENRICHMENT_FAILED | The page was fetched but contains too little content for meaningful enrichment (less than 50 characters of usable text). |
500 | ENRICHMENT_FAILED | The AI model returned invalid output. Retry the request — this is typically transient. |
Example error responses:
Missing company:
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "company is required"
}
}
Invalid fields:
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid fields: location, revenue. Valid fields: name, domain, industry, size, description, techStack, socialLinks, founded"
}
}
Rate limited:
{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "You have exceeded 10 requests per minute."
}
}
GET /api/health
Health check endpoint. No authentication required.
Response (200)
{
"status": "ok",
"service": "B2B Company Enrichment API",
"version": "1.0.0",
"timestamp": "2026-03-22T10:00:00.000Z"
}
Rate Limits
The API enforces 10 requests per minute per API key.
Every response (success and error) includes rate-limit headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Max requests per window (always 10) |
X-RateLimit-Remaining | Requests left in current window |
X-RateLimit-Reset | Unix timestamp (seconds) when the window resets |
When you hit the limit, the API returns HTTP 429 with the RATE_LIMIT_EXCEEDED error code. Read the X-RateLimit-Reset header to know when to retry.
Batch processing tip: Space requests at least 6 seconds apart to stay within the 10/min limit. For higher throughput, upgrade your plan for increased burst limits.
CORS
The API supports cross-origin requests:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-API-Key
Browser-based applications can call the API directly. OPTIONS preflight requests return HTTP 204 with the appropriate CORS headers.
Response Times
Typical response times range from 2 to 8 seconds, depending on:
- Target website load speed
- Number of fields requested
- Server-side model processing time
The metadata.responseTimeMs field in each response tells you the exact processing time. Set client-side timeouts to at least 30 seconds to account for slow target websites.
Troubleshooting
Company name returns INVALID_REQUEST
Name-only lookups guess the domain by slugifying the name and appending .com. This fails for companies with non-obvious domains (e.g., Meta → meta.com works, but Notion → notion.com works while Linear might not). Always prefer domains or URLs.
Fields return null
The API extracts data from the company's public website. If the site doesn't expose certain information (founding year, team size), those fields return null. This is expected behavior, not an error.
SCRAPE_FAILED on a valid website
Some websites block automated requests with CAPTCHAs, bot detection, or geo-restrictions. The API uses a standard User-Agent and does not bypass anti-bot measures. Try the company's main domain rather than a subdomain.
ENRICHMENT_FAILED (422)
The website loaded but had less than 50 characters of extractable text content. This happens with JavaScript-heavy single-page apps that don't render content server-side, or with login-gated pages.
Tech stack looks incomplete
The API detects technologies from client-side signals: script tags, framework-specific attributes, meta tags, and known third-party domains. Server-side technologies (databases, backend frameworks) are only detected when mentioned in the page content.