---
title: "Advanced Search Companies"
method: POST
path: "/api/v3/crm/{integration_id}/companies/search"
tags: ["CRM Companies"]
---

# Advanced Search Companies

`POST /api/v3/crm/{integration_id}/companies/search`

Advanced search for companies with full CRM filter capabilities.

## Filter Operators

| Operator | Description | Example |
|----------|-------------|---------|
| `EQ` | Equals | `{"propertyName": "state", "operator": "EQ", "value": "CA"}` |
| `NEQ` | Not equals | `{"propertyName": "industry", "operator": "NEQ", "value": "TECHNOLOGY"}` |
| `LT` | Less than | `{"propertyName": "numberofemployees", "operator": "LT", "value": "100"}` |
| `LTE` | Less than or equal | `{"propertyName": "annualrevenue", "operator": "LTE", "value": "1000000"}` |
| `GT` | Greater than | `{"propertyName": "createdate", "operator": "GT", "value": "2024-01-01"}` |
| `GTE` | Greater than or equal | `{"propertyName": "numberofemployees", "operator": "GTE", "value": "50"}` |
| `CONTAINS_TOKEN` | Contains (supports `*` wildcard) | `{"propertyName": "name", "operator": "CONTAINS_TOKEN", "value": "*school*"}` |
| `NOT_CONTAINS_TOKEN` | Does not contain | `{"propertyName": "domain", "operator": "NOT_CONTAINS_TOKEN", "value": "test"}` |
| `HAS_PROPERTY` | Has any value | `{"propertyName": "website", "operator": "HAS_PROPERTY"}` |
| `NOT_HAS_PROPERTY` | Has no value | `{"propertyName": "phone", "operator": "NOT_HAS_PROPERTY"}` |
| `IN` | In list | `{"propertyName": "state", "operator": "IN", "values": ["CA", "TX", "NY"]}` |
| `NOT_IN` | Not in list | `{"propertyName": "lifecyclestage", "operator": "NOT_IN", "values": ["lead"]}` |
| `BETWEEN` | Between range | `{"propertyName": "numberofemployees", "operator": "BETWEEN", "value": "10", "highValue": "100"}` |

## Filter Logic

- **Within a filterGroup**: Filters are ANDed (all must match)
- **Between filterGroups**: Groups are ORed (any group can match)

## Custom Properties

Request any property by name, including custom properties:
```json
{
  "properties": ["name", "domain", "my_custom_property", "another_custom_field"],
  "filterGroups": [
    {
      "filters": [
        {"propertyName": "my_custom_property", "operator": "EQ", "value": "some_value"}
      ]
    }
  ]
}
```

## Limits

- Max 5 filter groups
- Max 6 filters per group
- Max 18 total filters
- Max 100 results per page
- Max 10,000 total results per query
- Rate limit: 5 requests/second/account

## Path parameters

- `integration_id` string, uuid, required — The CRM integration ID

## Request body

- AdvancedSearchRequest — Request body for advanced company search. Supports the full power of HubSpot's search API including: - Complex filter groups with AND/OR logic - All 12 filter operators - Custom property filtering - Sorting - Full-text query search Limits: - Max 5 filter groups - Max 6 filters per group - Max 18 total filters - Max 100 results per page - Max 10,000 total results per query
  - `filterGroups` AdvancedFilterGroupRequest[], nullable — Filter groups (ORed together). Each group's filters are ANDed. Max 5 groups.
    - `filters` AdvancedFilterRequest[], required — Filters in this group (ANDed together). Max 6 per group.
      - `propertyName` string, required — The internal name of the property to filter on (e.g., 'name', 'domain', 'my_custom_property')
      - `operator` 'LT' | 'LTE' | 'GT' | 'GTE' | 'EQ' | 'NEQ' | 'BETWEEN' | 'IN' | 'NOT_IN' | 'HAS_PROPERTY' | 'NOT_HAS_PROPERTY' | 'CONTAINS_TOKEN' | 'NOT_CONTAINS_TOKEN', required — HubSpot search filter operators.
      - `value` string, nullable — The value to compare against. Required for most operators.
      - `values` string[], nullable — List of values for IN/NOT_IN operators.
      - `highValue` string, nullable — Upper bound for BETWEEN operator.
  - `query` string, nullable — Full-text search query across searchable properties (name, domain, phone, etc.)
  - `properties` string[], nullable — Properties to return. Include custom property names here. If not specified, returns default properties.
  - `sorts` AdvancedSortRequest[], nullable — Sort configuration. Only one sort allowed per search.
    - `propertyName` string, required — Property to sort by
    - `direction` 'ASCENDING' | 'DESCENDING' — Sort direction for search results.
  - `limit` integer — Results per page (max 200)
  - `after` string, nullable — Pagination cursor from previous response

## Response `200`

Successful Response

- CompanySearchResponse — API response for searching companies.
  - `total` integer, required
  - `results` CompanyResponse[], required
    - `id` string, required
    - `properties` object, required
    - `created_at` string, nullable
    - `updated_at` string, nullable
  - `has_more` boolean
  - `next_cursor` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/nationgraph/apis/nationgraph-api.md) · [All operations](https://skmtc.net/nationgraph/apis/nationgraph-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nationgraph/nationgraph-api/versions/85804e68d86d/schema)
