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

HeaderRequiredValue
Content-TypeYesapplication/json
X-API-KeyYesYour RapidAPI key

Request Body

FieldTypeRequiredDescription
companystringYesA company URL, bare domain, or company name.
fieldsstring[]NoSubset of fields to return. If omitted, all fields are returned.

Company input formats:

Input StyleExampleReliability
Full URLhttps://stripe.comHighest — no ambiguity
Bare domainstripe.comHigh — auto-prefixed with https://
Company nameStripeLower — 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

FieldTypeDescription
namestring | nullOfficial company name
domainstring | nullPrimary domain (e.g., stripe.com)
industrystring | nullIndustry or sector classification
sizestring | nullEmployee-count range: 1-10, 11-50, 51-200, 201-500, 501-1000, 1001-5000, 5001-10000, 10000+
descriptionstring | nullConcise 1-2 sentence company summary
techStackstring[] | nullTechnologies and frameworks detected from the website
socialLinksobject | nullSocial profile URLs. Keys: linkedin, twitter, facebook, github, instagram, youtube. Missing platforms are omitted.
foundedstring | nullYear 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

FieldTypeDescription
sourcestringThe resolved URL that was scraped
enrichedAtstringISO 8601 timestamp of enrichment
responseTimeMsnumberTotal processing time in milliseconds
tokensUsednumberApproximate LLM tokens consumed
fieldsRequestedstring[]The fields used for this enrichment

Error Responses

All errors follow this shape:

{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description"
  }
}
HTTP StatusError CodeWhen It Happens
400INVALID_REQUESTMissing or empty company field. Invalid fields array. Unrecognized field names. Company input cannot be resolved to a URL. Malformed JSON body.
401UNAUTHORIZEDMissing X-API-Key header. Invalid API key.
429RATE_LIMIT_EXCEEDEDMore than 10 requests in the current 60-second window.
502SCRAPE_FAILEDThe target website could not be fetched. Possible causes: DNS failure, timeout (15s limit), HTTP error, anti-bot protection.
422ENRICHMENT_FAILEDThe page was fetched but contains too little content for meaningful enrichment (less than 50 characters of usable text).
500ENRICHMENT_FAILEDThe 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:

HeaderDescription
X-RateLimit-LimitMax requests per window (always 10)
X-RateLimit-RemainingRequests left in current window
X-RateLimit-ResetUnix 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., Metameta.com works, but Notionnotion.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.