# Company Search API Reference

> Platform documentation snapshot. Access, charging and provider requirements remain operation-specific; examples do not execute requests.

### What it does

Query the company graph by industry, revenue band, employee size, location, SIC and NAICS codes, keywords and technology signals. Returns firmographics, domain, LinkedIn page, HQ location and descriptive metadata for account planning.

### Use cases

- Build a total addressable market list for a new territory and hand it to sales as named accounts.
- Generate account lists for ABM advertising audiences segmented by revenue and headcount.
- Size a market segment before launching a product line by counting matching companies per industry.

### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `query` | string | Company name or keyword search |
| `industry` | string | Industry name filter. Examples: "Information Technology and Services", "Financial Services", "Health Care", "Manufacturing", "Retail", "Construction", "Real Estate", "Education", "Marketing and Advertising", "Food & Beverages", "Hospitality", "Legal Services", "Insurance", "Automotive", "Telecommunications" |
| `naics_code` | string | NAICS industry classification code (e.g. "5112", "5415", "6211") |
| `keywords` | string | Keywords to search in company descriptions (e.g. "cloud security platform") |
| `state` | string | US state 2-letter code (e.g. "CA", "NY", "TX") |
| `city` | string | City name filter |
| `country` | string | Country code (e.g. "US", "GB", "CA", "DE") |
| `min_employees` | integer | Minimum employee count |
| `max_employees` | integer | Maximum employee count |
| `has_website` | boolean | Only return companies with a website |
| `page` | integer | Page number (default: 1) |
| `page_size` | integer | Results per page (default: 20, max: 100) |

### Response Schema

_Complete documented fields for this section, with nested notation preserved. Endpoint-specific envelopes, availability and additional fields are described under each endpoint below._

| Field | Notes |
|-------|-------|
| company_id | |
| name | |
| website | |
| description | |
| employee_count | |
| founded_year | |
| industries | |
| naics_codes | |
| specialties | |
| company_type | |
| primary_city | |
| primary_state | |
| country_name | |
| primary_address | |
| linkedin_url | |
| logo | |
| ticker | |
| stock_exchange_code | |

**Illustrative Example Response (synthetic, not a complete endpoint schema):**

```json
{
  "data": [
    {
      "company_id": "abc123",
      "name": "string",
      "website": "https://example.com",
      "description": "string",
      "employee_count": 0,
      "founded_year": 0,
      "industries": [],
      "naics_codes": [],
      "specialties": [],
      "company_type": "string",
      "primary_city": "string",
      "primary_state": "string",
      "country_name": 0,
      "primary_address": "string",
      "linkedin_url": "https://example.com",
      "logo": "https://example.com",
      "ticker": "string",
      "stock_exchange_code": "string"
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 20,
    "total": 1,
    "has_more": false
  },
  "credits_used": 1
}
```

### POST /b2b-search — Search Companies

Search the company database by name, industry, NAICS code, location, employee count, and more. Returns paginated results with company profiles. Costs 1 credit per company returned.

**Example Request Body:**

```json
{
  "query": "software",
  "state": "CA",
  "min_employees": 50,
  "max_employees": 5000,
  "page": 1,
  "page_size": 20
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/b2b-search",
  "method": "POST",
  "body": {
    "query": "software",
    "state": "CA",
    "min_employees": 50,
    "max_employees": 5000,
    "page": 1,
    "page_size": 20
  }
}'
```

### POST /b2b-search — Search by Industry

Filter companies by industry name. The industry field matches against the industries jsonb array.

**Example Request Body:**

```json
{
  "industry": "Information Technology and Services",
  "page": 1,
  "page_size": 20
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/b2b-search",
  "method": "POST",
  "body": {
    "industry": "Information Technology and Services",
    "page": 1,
    "page_size": 20
  }
}'
```

### POST /b2b-search — Search by NAICS Code

Filter companies by NAICS code for precise industry classification.

**Example Request Body:**

```json
{
  "naics_code": "5112",
  "state": "NY",
  "page": 1,
  "page_size": 20
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/b2b-search",
  "method": "POST",
  "body": {
    "naics_code": "5112",
    "state": "NY",
    "page": 1,
    "page_size": 20
  }
}'
```

### POST /b2b-search — Search by Keywords

Search companies by keywords matched against company descriptions. Useful for finding companies by what they do rather than by name.

**Example Request Body:**

```json
{
  "keywords": "cloud security platform",
  "page": 1,
  "page_size": 20
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/b2b-search",
  "method": "POST",
  "body": {
    "keywords": "cloud security platform",
    "page": 1,
    "page_size": 20
  }
}'
```

