> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Crustdata Persondb Search: Inputs, Cost & CLI Example

> Searching CrustData PersonDB with structured filters. Includes inputs, outputs, pricing notes, Deepline CLI examples, and GTM automation guidance.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=crustdata_persondb_search:{"filters":[{"filter_type":"region","type":"(.)","value":"United States"}]}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                     | Type              | Required | Default | Description                                                                                                                                                                                                                                        |
| ------------------------ | ----------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payload.filters`        | `object \| array` | Yes      |         | Array of filter conditions (AND-combined). Each: \{filter\_type, type, value} or \{filter\_name, type, value}. filter\_name is syntactic sugar for filter\_type. Single object is accepted. Nested \{op,conditions} groups supported for OR logic. |
| `payload.limit`          | `integer`         | No       | `3`     | Max returned profiles to request (1-1000, default 3). Zero returned profiles are free; non-preview searches with returned profiles are billed in started 100-profile buckets.                                                                      |
| `payload.cursor`         | `string`          | No       |         | Pagination cursor.                                                                                                                                                                                                                                 |
| `payload.sorts`          | `array`           | No       |         | Sort criteria array.                                                                                                                                                                                                                               |
| `payload.postProcessing` | `object`          | No       |         | Post-processing exclusions.                                                                                                                                                                                                                        |
| `payload.preview`        | `boolean`         | No       |         | Enable free preview mode.                                                                                                                                                                                                                          |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Searches PersonDB using /screener/persondb/search with filters. Priced as database discovery: preview=true is free; zero returned profiles are free; returned profiles are billed in started 100-profile buckets.",
    "properties": {
      "filters": {
        "description": "Array of filter conditions (AND-combined). Each: {filter_type, type, value} or {filter_name, type, value}. filter_name is syntactic sugar for filter_type. Single object is accepted. Nested {op,conditions} groups supported for OR logic.",
        "anyOf": [
          {
            "$ref": "T1"
          },
          {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "T1"
            }
          }
        ]
      },
      "limit": {
        "type": "integer",
        "description": "Max returned profiles to request (1-1000, default 3). Zero returned profiles are free; non-preview searches with returned profiles are billed in started 100-profile buckets.",
        "default": 3,
        "minimum": 1,
        "maximum": 1000
      },
      "cursor": {
        "type": "string",
        "description": "Pagination cursor.",
        "minLength": 1
      },
      "sorts": {
        "type": "array",
        "description": "Sort criteria array.",
        "minItems": 1,
        "items": {
          "type": "object",
          "properties": {
            "column": {
              "type": "string",
              "description": "Field to sort by (e.g. employee_metrics.latest_count).",
              "minLength": 1
            },
            "order": {
              "type": "string",
              "description": "Sort order: asc or desc.",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          "required": [
            "column",
            "order"
          ],
          "additionalProperties": false
        }
      },
      "postProcessing": {
        "type": "object",
        "description": "Post-processing exclusions.",
        "properties": {
          "exclude_profiles": {
            "type": "array",
            "description": "Exclude specific profile IDs.",
            "maxItems": 50000,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "exclude_names": {
            "type": "array",
            "description": "Exclude matching names.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "additionalProperties": false
      },
      "preview": {
        "type": "boolean",
        "description": "Enable free preview mode."
      }
    },
    "required": [
      "filters"
    ],
    "additionalProperties": false,
    "$defs": {
      "T1": {
        "$id": "T1",
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "filter_type": {
                "type": "string",
                "description": "Field to filter on. Key mappings: job title → current_employers.title, seniority → current_employers.seniority_level, company/employer → current_employers.company_website_domain, location → region, experience → years_of_experience_raw, bio/summary → headline, connections → num_of_connections.",
                "enum": [
                  "current_employers.company_website_domain",
                  "current_employers.seniority_level",
                  "current_employers.title",
                  "headline",
                  "num_of_connections",
                  "region",
                  "years_of_experience_raw"
                ]
              },
              "type": {
                "type": "string",
                "description": "Operator: =, !=, in, not_in, >, <, =>, =<, (.) fuzzy contains, [.] substring, geo_distance (region only).",
                "enum": [
                  "=",
                  "!=",
                  "in",
                  "not_in",
                  ">",
                  "<",
                  "=>",
                  "=<",
                  "(.)",
                  "[.]",
                  "geo_distance"
                ]
              },
              "value": {
                "description": "Filter value (or geo_distance object for region). When unsure of exact values for a field, call crustdata_persondb_autocomplete first (free, no credits): e.g. deepline tools execute crustdata_persondb_autocomplete --payload '{\"field\":\"current_employers.title\",\"query\":\"engineer\",\"limit\":10}' --json.",
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        }
                      ]
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "location": {
                        "type": "string",
                        "description": "Origin location for geo distance filtering.",
                        "minLength": 1
                      },
                      "distance": {
                        "type": "number",
                        "description": "Distance radius for geo distance filtering.",
                        "exclusiveMinimum": 0
                      },
                      "unit": {
                        "type": "string",
                        "description": "Distance unit for geo distance filtering.",
                        "enum": [
                          "km",
                          "mi",
                          "miles",
                          "m",
                          "meters",
                          "ft",
                          "feet"
                        ]
                      }
                    },
                    "required": [
                      "location",
                      "distance"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "filter_type",
              "type",
              "value"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "op": {
                "type": "string",
                "description": "Logical operator for conditions.",
                "enum": [
                  "and",
                  "or"
                ]
              },
              "conditions": {
                "type": "array",
                "description": "Nested filter conditions.",
                "minItems": 1,
                "items": {
                  "$ref": "T1"
                }
              }
            },
            "required": [
              "op",
              "conditions"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  }
  ```
</details>

## Output Schema

| Name          | Type     | Required | Default | Description                               |
| ------------- | -------- | -------- | ------- | ----------------------------------------- |
| `result.data` | `object` | Yes      |         | Profiles from the persondb search result. |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Crustdata persondb search result.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Profiles from the persondb search result.",
        "properties": {
          "profiles": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {}
            }
          },
          "meta": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "profiles",
          "meta"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute crustdata_persondb_search --payload '{
  "filters": [
    {
      "filter_type": "region",
      "type": "(.)",
      "value": "United States"
    }
  ]
}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Cost

* Pricing model: `per_result` (per result).
* Estimated Deepline credits: `0.4` per pricing unit.
* Billing mode: `post_deduct`.
