# Firecrawl

> Use Firecrawl's scrape and search endpoints with Search1API by changing the API URL and key, including which Python clients keep the URL path.

Canonical URL: https://s1.dev/docs/compatibility/firecrawl

Search1API answers Firecrawl's single-page scrape and search, in both API versions: `POST /v1/scrape`, `/v2/scrape`, `/v1/search` and `/v2/search`. Set the Firecrawl API URL to:

```text
https://api.search1api.com/compat/firecrawl
```

Authenticate with your Search1API key as `Authorization: Bearer YOUR_API_KEY`, as the Firecrawl SDKs do.

## Configure your client

<Tabs items={['JavaScript', 'Python', 'Open WebUI']}>

<Tab value="JavaScript">

```ts
import Firecrawl from '@mendable/firecrawl-js';

const firecrawl = new Firecrawl({
  apiKey: process.env.SEARCH1API_KEY,
  apiUrl: 'https://api.search1api.com/compat/firecrawl',
});
const page = await firecrawl.scrape('https://hono.dev/docs/', { formats: ['markdown'] });
const results = await firecrawl.search('hono cloudflare workers', { limit: 5 });
```

</Tab>

<Tab value="Python">

```python
from firecrawl import AsyncFirecrawl

firecrawl = AsyncFirecrawl(
    api_key="YOUR_API_KEY",
    api_url="https://api.search1api.com/compat/firecrawl",
)
page = await firecrawl.scrape("https://hono.dev/docs/", formats=["markdown"])
results = await firecrawl.search("hono cloudflare workers", limit=5)
```

For synchronous code, use the v1 client:

```python
from firecrawl import V1FirecrawlApp

firecrawl = V1FirecrawlApp(
    api_key="YOUR_API_KEY",
    api_url="https://api.search1api.com/compat/firecrawl",
)
page = firecrawl.scrape_url("https://hono.dev/docs/", formats=["markdown"])
```

</Tab>

<Tab value="Open WebUI">

Choose **firecrawl** as the web search engine or web loader, enter your Search1API key as the Firecrawl API key, and set:

```bash
FIRECRAWL_API_BASE_URL="https://api.search1api.com/compat/firecrawl"
```

</Tab>

</Tabs>

> **warn:** In `firecrawl-py` 4.x, the default synchronous client (`Firecrawl`, also exported as `FirecrawlApp`) builds request URLs from the host of `api_url` and drops its path, so `https://api.search1api.com/compat/firecrawl` becomes `https://api.search1api.com/v2/scrape` and the request fails with `404`. Use `AsyncFirecrawl` or `V1FirecrawlApp` as shown above; both keep the path. Libraries built on the default client, including LangChain's `FireCrawlLoader` and LlamaIndex's Firecrawl reader, are affected in the same way.

## Scrape

`url` is required. The page is returned as Markdown in `data.markdown`, with `data.metadata.title`, `sourceURL`, `url` and `statusCode`.

As in Firecrawl, when the target site itself answers with an error status, such as `404` for a dead link or `403` when it refuses the request, the response is `success: true` with an empty `markdown`, the site's status in `metadata.statusCode` and its reason phrase in `metadata.error`. A dead link (`404`/`410`) is charged like a native `/crawl` dead link; other target statuses are not charged.

Only Markdown is produced. Other entries in `formats`, such as `html`, `links` or `screenshot`, are ignored and their fields are absent. `onlyMainContent`, `waitFor`, `timeout`, `actions` and other page options are ignored.

## Search

| Field | Behavior |
| --- | --- |
| `query` | Required. |
| `limit` | Default `10` in v2 and `5` in v1, up to `50` per source. |
| `sources` (v2) | `web`, `news` and `images`, as strings or `{ "type": … }` objects. Default `["web"]`. |
| `tbs` | `qdr:h` and `qdr:d` (day), `qdr:w`, `qdr:m` and `qdr:y`. |
| `lang` | Primary language of the results. |
| `includeDomains`, `excludeDomains` | Restrict or exclude sites. |
| `scrapeOptions.formats` | Any non-empty list reads each web and news result page and adds `markdown` and `metadata` to the result. |

As in Firecrawl, results do not include page content unless `scrapeOptions.formats` is set.

v2 returns `data.web` (`url`, `title`, `description`, `position`), `data.news` (`title`, `url`, `snippet`, `date`, `position`) and `data.images` (`imageUrl`, `url`, `position`) for the requested sources. When a source fails while others succeed, the response includes a `warning`. v1 returns `data` as a list of `{ url, title, description }`.

## Credits

| Request | Credits |
| --- | --- |
| Scrape | 1 |
| Search | 1 for each source |
| Search with `scrapeOptions.formats` | 1 for each source, plus 1 for each page read |

## Not supported

Crawl, batch scrape, map, extract and other job endpoints return `404`. For full-site work, use Search1API's [`/deepcrawl`](https://s1.dev/docs/advanced/deepcrawl) and [`/sitemap`](https://s1.dev/docs/advanced/sitemap).

## Errors

Errors return `{ "success": false, "error": "message" }` with the status code. A page that cannot be read for reasons other than the target's own status (see [Scrape](#scrape)) returns `502`, which the Firecrawl JavaScript SDK retries before raising an error.