> ## 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.

# Firecrawl Search: Inputs, Cost & CLI Example

> Web search with automatic scraping of result pages. 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=firecrawl_search:{"query":"{{query}}"}' --json
```

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

## Input Schema

| Name                        | Type      | Required | Default | Description                                          |
| --------------------------- | --------- | -------- | ------- | ---------------------------------------------------- |
| `payload.query`             | `string`  | Yes      |         | Search query (max 500 chars)                         |
| `payload.limit`             | `integer` | No       |         | Max results (default 5, max 100)                     |
| `payload.country`           | `string`  | No       |         | Country code (e.g. "us")                             |
| `payload.tbs`               | `string`  | No       |         | Time-based search filter (e.g. "qdr:d" for past day) |
| `payload.location`          | `string`  | No       |         | Geographic location string                           |
| `payload.sources`           | `array`   | No       |         | Search source types                                  |
| `payload.categories`        | `array`   | No       |         | Search category filters                              |
| `payload.timeout`           | `integer` | No       |         | Request timeout in ms (default 60000)                |
| `payload.ignoreInvalidURLs` | `boolean` | No       |         | Skip invalid URLs instead of failing (default false) |
| `payload.scrapeOptions`     | `object`  | No       |         | Options for scraping search results                  |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Search the web and optionally scrape result pages.",
    "properties": {
      "query": {
        "type": "string",
        "description": "Search query (max 500 chars)"
      },
      "limit": {
        "type": "integer",
        "description": "Max results (default 5, max 100)"
      },
      "country": {
        "type": "string",
        "description": "Country code (e.g. \"us\")"
      },
      "tbs": {
        "type": "string",
        "description": "Time-based search filter (e.g. \"qdr:d\" for past day)"
      },
      "location": {
        "type": "string",
        "description": "Geographic location string"
      },
      "sources": {
        "type": "array",
        "description": "Search source types",
        "items": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Source type",
              "enum": [
                "web",
                "images",
                "news"
              ]
            },
            "tbs": {
              "type": "string",
              "description": "Time-based search filter for this source (e.g. \"qdr:d\")"
            },
            "location": {
              "type": "string",
              "description": "Geographic location for this source"
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        }
      },
      "categories": {
        "type": "array",
        "description": "Search category filters",
        "items": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Category type",
              "enum": [
                "github",
                "research",
                "pdf"
              ]
            }
          },
          "required": [
            "type"
          ],
          "additionalProperties": false
        }
      },
      "timeout": {
        "type": "integer",
        "description": "Request timeout in ms (default 60000)"
      },
      "ignoreInvalidURLs": {
        "type": "boolean",
        "description": "Skip invalid URLs instead of failing (default false)"
      },
      "scrapeOptions": {
        "type": "object",
        "description": "Options for scraping search results",
        "properties": {
          "formats": {
            "type": "array",
            "description": "Output formats (default [{\"type\":\"markdown\"}])",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "markdown",
                    "summary",
                    "html",
                    "rawHtml",
                    "links",
                    "images",
                    "screenshot",
                    "json",
                    "changeTracking",
                    "branding"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "markdown"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "summary"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "html"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "rawHtml"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "links"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "images"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "screenshot"
                    },
                    "fullPage": {
                      "type": "boolean",
                      "description": "Capture full page screenshot"
                    },
                    "quality": {
                      "type": "integer",
                      "description": "Screenshot quality 0-100"
                    },
                    "viewport": {
                      "type": "object",
                      "description": "Custom viewport size",
                      "properties": {
                        "width": {
                          "type": "integer"
                        },
                        "height": {
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "json"
                    },
                    "schema": {
                      "type": "object",
                      "description": "JSON schema for structured output",
                      "additionalProperties": {}
                    },
                    "prompt": {
                      "type": "string",
                      "description": "Natural language extraction instructions"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "changeTracking"
                    },
                    "modes": {
                      "type": "array",
                      "description": "Change tracking modes",
                      "items": {
                        "type": "string",
                        "enum": [
                          "git-diff",
                          "json"
                        ]
                      }
                    },
                    "schema": {
                      "type": "object",
                      "description": "Schema for tracked changes",
                      "additionalProperties": {}
                    },
                    "prompt": {
                      "type": "string",
                      "description": "Instructions for change tracking"
                    },
                    "tag": {
                      "type": "string",
                      "description": "Tag for this change tracking snapshot"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "branding"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "onlyMainContent": {
            "type": "boolean",
            "description": "Only return main content, filtering navs/footers"
          },
          "includeTags": {
            "type": "array",
            "description": "Only include these HTML tags",
            "items": {
              "type": "string"
            }
          },
          "excludeTags": {
            "type": "array",
            "description": "Exclude these HTML tags",
            "items": {
              "type": "string"
            }
          },
          "headers": {
            "type": "object",
            "description": "Custom HTTP headers",
            "additionalProperties": {
              "type": "string"
            }
          },
          "waitFor": {
            "type": "number",
            "description": "Wait ms after page load before scraping"
          },
          "mobile": {
            "type": "boolean",
            "description": "Use mobile user agent"
          },
          "timeout": {
            "type": "number",
            "description": "Request timeout in ms (default 30000, max 300000)"
          },
          "maxAge": {
            "type": "integer",
            "description": "Max cache age in ms (default 172800000)"
          },
          "storeInCache": {
            "type": "boolean",
            "description": "Store result in cache (default true)"
          },
          "parsers": {
            "type": "array",
            "description": "Document parsers (e.g. PDF)",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "description": "Parser type",
                  "const": "pdf"
                },
                "mode": {
                  "type": "string",
                  "description": "PDF parsing mode",
                  "enum": [
                    "fast",
                    "auto",
                    "ocr"
                  ]
                },
                "maxPages": {
                  "type": "integer",
                  "description": "Max pages to parse (1-10000)"
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": false
            }
          },
          "actions": {
            "type": "array",
            "description": "Browser actions to execute before scraping",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "description": "Browser action type",
                  "enum": [
                    "wait",
                    "click",
                    "write",
                    "press",
                    "screenshot",
                    "scroll",
                    "pdf",
                    "scrape",
                    "executeJavascript"
                  ]
                },
                "selector": {
                  "type": "string",
                  "description": "CSS selector for the element"
                },
                "milliseconds": {
                  "type": "number",
                  "description": "Wait time in milliseconds"
                },
                "text": {
                  "type": "string",
                  "description": "Text to write"
                },
                "key": {
                  "type": "string",
                  "description": "Key to press"
                },
                "direction": {
                  "type": "string",
                  "description": "Scroll direction",
                  "enum": [
                    "up",
                    "down"
                  ]
                },
                "amount": {
                  "type": "number",
                  "description": "Scroll amount in pixels"
                },
                "script": {
                  "type": "string",
                  "description": "JavaScript to execute"
                },
                "fullPage": {
                  "type": "boolean",
                  "description": "Full-page screenshot"
                },
                "format": {
                  "type": "string",
                  "description": "PDF page format",
                  "enum": [
                    "A0",
                    "A1",
                    "A2",
                    "A3",
                    "A4",
                    "A5",
                    "A6",
                    "Letter",
                    "Legal",
                    "Tabloid",
                    "Ledger"
                  ]
                },
                "landscape": {
                  "type": "boolean",
                  "description": "PDF landscape orientation"
                },
                "scale": {
                  "type": "number",
                  "description": "PDF scale factor (0.1-2)"
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": false
            }
          },
          "location": {
            "type": "object",
            "description": "Geographic location settings",
            "properties": {
              "country": {
                "type": "string",
                "description": "Country code (e.g. \"US\")"
              },
              "languages": {
                "type": "array",
                "description": "Language codes",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "proxy": {
            "type": "string",
            "description": "Proxy mode",
            "enum": [
              "basic",
              "enhanced",
              "auto"
            ]
          },
          "blockAds": {
            "type": "boolean",
            "description": "Block ads during scraping"
          },
          "removeBase64Images": {
            "type": "boolean",
            "description": "Strip base64 images from output"
          },
          "skipTlsVerification": {
            "type": "boolean",
            "description": "Skip TLS certificate verification"
          }
        },
        "additionalProperties": false
      }
    },
    "required": [
      "query"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

| Name          | Type     | Required | Default | Description                                    |
| ------------- | -------- | -------- | ------- | ---------------------------------------------- |
| `result.data` | `object` | Yes      |         | Provider response payload.                     |
| `result.meta` | `record` | No       |         | Additional response metadata (status, paging). |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Web search results with optional scraped content.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "web": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "markdown": {
                  "type": "string"
                }
              },
              "required": [
                "url"
              ],
              "additionalProperties": false
            }
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {}
            }
          },
          "news": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {}
            }
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": {}
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Advanced: Direct CLI

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

```bash theme={null}
deepline tools execute firecrawl_search --payload '{
  "query": "string"
}' --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.                      |

## Provider API Context

<details>
  <summary>Show provider reference (optional)</summary>

  ````md theme={null}
  The search endpoint combines web search with Firecrawl's scraping capabilities to return full page content for any query.

  Include `scrapeOptions` with `formats: [{"type": "markdown"}]` to get complete markdown content for each search result otherwise you will default to getting the results (url, title, description). You can also use other formats like `{"type": "summary"}` for condensed content.

  ## Supported query operators

  We support a variety of query operators that allow you to filter your searches better.

  | Operator      | Functionality                                                             | Examples                          |
  | ------------- | ------------------------------------------------------------------------- | --------------------------------- |
  | `""`          | Non-fuzzy matches a string of text                                        | `"Firecrawl"`                     |
  | `-`           | Excludes certain keywords or negates other operators                      | `-bad`, `-site:firecrawl.dev`     |
  | `site:`       | Only returns results from a specified website                             | `site:firecrawl.dev`              |
  | `filetype:`   | Only returns results with a specific file extension                       | `filetype:pdf`, `-filetype:pdf`   |
  | `inurl:`      | Only returns results that include a word in the URL                       | `inurl:firecrawl`                 |
  | `allinurl:`   | Only returns results that include multiple words in the URL               | `allinurl:git firecrawl`          |
  | `intitle:`    | Only returns results that include a word in the title of the page         | `intitle:Firecrawl`               |
  | `allintitle:` | Only returns results that include multiple words in the title of the page | `allintitle:firecrawl playground` |
  | `related:`    | Only returns results that are related to a specific domain                | `related:firecrawl.dev`           |
  | `imagesize:`  | Only returns images with exact dimensions                                 | `imagesize:1920x1080`             |
  | `larger:`     | Only returns images larger than specified dimensions                      | `larger:1920x1080`                |

  ## Location Parameter

  Use the `location` parameter to get geo-targeted search results. Format: `"string"`. Examples: `"Germany"`, `"San Francisco,California,United States"`.

  See the [complete list of supported locations](https://firecrawl.dev/search_locations.json) for all available countries and languages.

  ## Country Parameter

  Use the `country` parameter to specify the country for search results using ISO country codes. Default: `"US"`.

  Examples: `"US"`, `"DE"`, `"FR"`, `"JP"`, `"UK"`, `"CA"`.

  ```json  theme={null}
  {
    "query": "restaurants",
    "country": "DE"
  }
  ```

  ## Categories Parameter

  Filter search results by specific categories using the `categories` parameter:

  * **`github`**: Search within GitHub repositories, code, issues, and documentation
  * **`research`**: Search academic and research websites (arXiv, Nature, IEEE, PubMed, etc.)
  * **`pdf`**: Search for PDFs

  ### Example Usage

  ```json  theme={null}
  {
    "query": "machine learning",
    "categories": ["github", "research"],
    "limit": 10
  }
  ```

  ### Category Response

  Each result includes a `category` field indicating its source:

  ```json  theme={null}
  {
    "success": true,
    "data": {
      "web": [
        {
          "url": "https://github.com/example/ml-project",
          "title": "Machine Learning Project",
          "description": "Implementation of ML algorithms",
          "category": "github"
        },
        {
          "url": "https://arxiv.org/abs/2024.12345",
          "title": "ML Research Paper",
          "description": "Latest advances in machine learning",
          "category": "research"
        }
      ]
    }
  }
  ```

  ## Time-Based Search

  Use the `tbs` parameter to filter results by time periods, including custom date ranges. See the [Search Feature documentation](https://docs.firecrawl.dev/features/search#time-based-search) for detailed examples and supported formats.
  ````
</details>

## Cost

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