# Gemini (/developer-guides/llm-sdks-and-frameworks/gemini)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 916 · updated: 2026-07-30 -->
Related: [OpenAI](/developer-guides/llm-sdks-and-frameworks/openai.md), [Anthropic](/developer-guides/llm-sdks-and-frameworks/anthropic.md), [Agent Development Kit (ADK)](/developer-guides/llm-sdks-and-frameworks/google-adk.md), [Vercel AI SDK](/developer-guides/llm-sdks-and-frameworks/vercel-ai-sdk.md), [LangChain](/developer-guides/llm-sdks-and-frameworks/langchain.md), [LangGraph](/developer-guides/llm-sdks-and-frameworks/langgraph.md)

Integrate Firecrawl with Google's Gemini for AI applications powered by web data.

## Setup [#setup]

```bash
npm install firecrawl @google/genai
```

Create `.env` file:

```bash
FIRECRAWL_API_KEY=your_firecrawl_key
GEMINI_API_KEY=your_gemini_key
```

> **Note:** If using Node \< 20, install `dotenv` and add `import 'dotenv/config'` to your code.

## Scrape + Summarize [#scrape--summarize]

This example demonstrates a simple workflow: scrape a website and summarize the content using Gemini.

```typescript
import { Firecrawl } from 'firecrawl';
import { GoogleGenAI } from '@google/genai';

const firecrawl = new Firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY });
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const scrapeResult = await firecrawl.scrape('https://firecrawl.dev', {
    formats: ['markdown']
});

console.log('Scraped content length:', scrapeResult.markdown?.length);

const response = await ai.models.generateContent({
    model: 'gemini-2.5-flash',
    contents: `Summarize: ${scrapeResult.markdown}`,
});

console.log('Summary:', response.text);
```

## Content Analysis [#content-analysis]

This example shows how to analyze website content using Gemini's multi-turn conversation capabilities.

```typescript
import { Firecrawl } from 'firecrawl';
import { GoogleGenAI } from '@google/genai';

const firecrawl = new Firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY });
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const scrapeResult = await firecrawl.scrape('https://news.ycombinator.com/', {
    formats: ['markdown']
});

console.log('Scraped content length:', scrapeResult.markdown?.length);

const chat = ai.chats.create({
    model: 'gemini-2.5-flash'
});

// Ask for the top 3 stories on Hacker News
const result1 = await chat.sendMessage({
    message: `Based on this website content from Hacker News, what are the top 3 stories right now?\n\n${scrapeResult.markdown}`
});
console.log('Top 3 Stories:', result1.text);

// Ask for the 4th and 5th stories on Hacker News
const result2 = await chat.sendMessage({
    message: `Now, what are the 4th and 5th top stories on Hacker News from the same content?`
});
console.log('4th and 5th Stories:', result2.text);
```

## Structured Extraction [#structured-extraction]

This example demonstrates how to extract structured data using Gemini's JSON mode from scraped website content.

```typescript
import { Firecrawl } from 'firecrawl';
import { GoogleGenAI, Type } from '@google/genai';

const firecrawl = new Firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY });
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const scrapeResult = await firecrawl.scrape('https://stripe.com', {
    formats: ['markdown']
});

console.log('Scraped content length:', scrapeResult.markdown?.length);

const response = await ai.models.generateContent({
    model: 'gemini-2.5-flash',
    contents: `Extract company information: ${scrapeResult.markdown}`,
    config: {
        responseMimeType: 'application/json',
        responseSchema: {
            type: Type.OBJECT,
            properties: {
                name: { type: Type.STRING },
                industry: { type: Type.STRING },
                description: { type: Type.STRING },
                products: {
                    type: Type.ARRAY,
                    items: { type: Type.STRING }
                }
            },
            propertyOrdering: ['name', 'industry', 'description', 'products']
        }
    }
});

console.log('Extracted company info:', response?.text);
```

For more examples, check the [Gemini documentation](https://ai.google.dev/docs).
