> ## Documentation Index
> Fetch the complete documentation index at: https://firecrawl-fix-js-response-syntax-highlighting.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Hono

> Utilisez Firecrawl avec Hono pour créer des API légères de scraping web et de recherche qui fonctionnent partout.

<div id="prerequisites">
  ## Prérequis
</div>

* Node.js 18+, Bun ou Deno
* Une clé API Firecrawl — [obtenez-en une gratuitement](https://www.firecrawl.dev/app/api-keys)

<div id="setup">
  ## Configuration
</div>

```bash theme={null}
npm install hono firecrawl
```

Ajoutez votre clé API dans `.env` :

```bash theme={null}
FIRECRAWL_API_KEY=fc-YOUR-API-KEY
```

<div id="search-the-web">
  ## Rechercher sur le Web
</div>

```typescript theme={null}
import { Hono } from "hono";
import { Firecrawl } from "firecrawl";

const app = new Hono();
const firecrawl = new Firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY });

app.post("/search", async (c) => {
  const { query } = await c.req.json();
  const results = await firecrawl.search(query, { limit: 5 });
  return c.json(results);
});

export default app;
```

<div id="scrape-a-page">
  ## Scrape d’une page
</div>

```typescript theme={null}
app.post("/scrape", async (c) => {
  const { url } = await c.req.json();
  const result = await firecrawl.scrape(url);
  return c.json(result);
});
```

<div id="interact-with-a-page">
  ## Interact avec une page
</div>

Utilisez Interact pour contrôler une session de navigateur en direct : cliquez sur des boutons, remplissez des formulaires et extrayez du contenu dynamique.

```typescript theme={null}
app.post("/interact", async (c) => {
  const { url } = await c.req.json();

  const result = await firecrawl.scrape(url, { formats: ['markdown'] });
  const scrapeId = result.metadata?.scrapeId;

  await firecrawl.interact(scrapeId, { prompt: 'Search for iPhone 16 Pro Max' });
  const response = await firecrawl.interact(scrapeId, { prompt: 'Click on the first result and tell me the price' });

  await firecrawl.stopInteraction(scrapeId);

  return c.json({ output: response.output });
});
```

<div id="deploy-anywhere">
  ## Déployez n’importe où
</div>

Hono fonctionne dans plusieurs environnements d’exécution. Pour Cloudflare Workers, transmettez la clé API via la liaison d’environnement :

```typescript theme={null}
import { Hono } from "hono";
import { Firecrawl } from "firecrawl";

type Bindings = { FIRECRAWL_API_KEY: string };
const app = new Hono<{ Bindings: Bindings }>();

app.post("/search", async (c) => {
  const firecrawl = new Firecrawl({ apiKey: c.env.FIRECRAWL_API_KEY });
  const { query } = await c.req.json();
  const results = await firecrawl.search(query, { limit: 5 });
  return c.json(results);
});

export default app;
```

<div id="next-steps">
  ## Étapes suivantes
</div>

<CardGroup cols={2}>
  <Card title="Docs Scrape" icon="file-lines" href="/fr/features/scrape">
    Toutes les options de scrape, y compris les formats, les actions et les proxies
  </Card>

  <Card title="Docs recherche" icon="magnifying-glass" href="/fr/features/search">
    Effectuez une recherche sur le web et obtenez le contenu complet de la page
  </Card>

  <Card title="Docs Interact" icon="hand-pointer" href="/fr/features/interact">
    Cliquez, remplissez des formulaires et extrayez du contenu dynamique
  </Card>

  <Card title="Référence du SDK Node" icon="node" href="/fr/sdks/node">
    Référence complète du SDK avec crawl, cartographie, extraction par lot et plus encore
  </Card>
</CardGroup>
