VOOZH about

URL: https://apify.com/free_style_coder/gemini-api

โ‡ฑ Gemini API ยท Apify


Pricing

from $0.60 / actor start

Go to Apify Store

same As Gemini API with Low Cost

Pricing

from $0.60 / actor start

Rating

0.0

(0)

Developer

๐Ÿ‘ Freestylecoder

Freestylecoder

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

1

Monthly active users

11 days ago

Last modified

Share

Gemini Scraper โ€” Apify Actor

Scrapes text responses from Google Gemini by replaying authenticated browser requests. Accepts a list of queries, sends each to Gemini, and saves the full AI-generated response to an Apify dataset.

โš ๏ธ This actor uses Gemini's internal browser API, not the official Gemini REST API. Session cookies are hardcoded in the source and must be refreshed in the code when they expire (~24 hours).


Features

  • Send multiple queries in a single run
  • Only input required: a list of queries
  • Full response text extracted from Gemini's streaming protocol
  • Per-query error isolation โ€” one failure does not stop the rest
  • Dataset output with structured fields: query, response, error, scrapedAt

Input

Only one field is required.

FieldTypeRequiredDescription
queriesstring[]โœ…One or more queries to send to Gemini

Example Input JSON

{
"queries":[
"best smartphones 2026",
"python vs javascript for web development",
"how does quantum computing work"
]
}

Output

Each query produces one record in the default dataset.

Success Record

{
"query":"best smartphones 2026",
"response":"The top smartphones in 2026 include...",
"error":null,
"scrapedAt":"2026-06-19T10:30:00.000Z"
}

Failure Record

{
"query":"best smartphones 2026",
"response":null,
"error":"HTTPError: 403 Forbidden",
"scrapedAt":"2026-06-19T10:30:00.000Z"
}

When Cookies Expire

All session values (cookies, headers, params) are hardcoded at the top of src/main.py under COOKIES, HEADERS, PARAMS, and SESSION_ID.

When requests start returning 401 or 403, refresh the values:

Step-by-step

  1. Open https://gemini.google.com in Chrome while signed in.
  2. Press F12 โ†’ Network tab.
  3. Send any message in Gemini.
  4. Filter by StreamGenerate โ†’ click the request.
  5. Go to Headers โ†’ Request Headers โ†’ copy the Cookie header.
  6. Extract __Secure-STRP, NID, and COMPASS values.
  7. Update COOKIES in src/main.py.
  8. From the same request's Query String Parameters, copy bl and f.sid.
  9. Update PARAMS in src/main.py.
  10. Redeploy the actor.

Project Structure

gemini-actor/
โ”œโ”€โ”€ src/
โ”‚ โ””โ”€โ”€ main.py # Core actor logic + hardcoded session values
โ”œโ”€โ”€ .actor/
โ”‚ โ”œโ”€โ”€ actor.json # Apify actor manifest
โ”‚ โ””โ”€โ”€ INPUT_SCHEMA.json # Input schema(queries only)
โ”œโ”€โ”€ output_schema.json # Dataset view columns
โ”œโ”€โ”€ dataset_schema.json # Per-record field types
โ”œโ”€โ”€ requirements.txt # Python dependencies
โ”œโ”€โ”€ Dockerfile # Container build
โ”œโ”€โ”€ Agent.md # Internal developer/agent guide
โ”œโ”€โ”€ claude.md # AI assistant context file
โ””โ”€โ”€ README.md # This file

Local Development

# Install dependencies
pip install apify requests
# Run locally (requires Apify CLI)
apify run

Dependencies

apify>=2.0.0
requests>=2.31.0

Limitations

  • Session cookies expire in ~24 hours and require a manual code update + redeploy
  • Subject to Gemini's internal rate limits
  • Response format may break if Google updates the StreamGenerate protocol
  • Not suitable for high-volume production use without cookie rotation

License

MIT

You might also like

Gemini AI Scraper

jupri/google-bard

Interact with Gemini AI formerly (Google Bard) and save conversation to dataset

Gemini File Search Builder

yoloshii/gemini-file-search-builder

Build Gemini File Search RAG knowledge bases from any website with automatic citations.

Gemini 3.1 High AI Query API

dev00/gemini-ai-query-api

Send natural language questions to Google's Gemini 3.1 High model and receive clean, structured answers โ€” no API keys or setup required.

dev00

5

Gemini Crypto Exchange Scraper

parseforge/gemini-tickers-scraper

Scrape live price feed from Gemini, a US-regulated exchange. Pair, price, percent change 24h for all available spot pairs. No API key required.

Gemini AI MCP SERVER

bhansalisoft/gemini-ai-mcp-server

Gemini AI MCP SERVER unique tool for Gamini AI functionality integration with apify and other AI tool.

43

AI Search Visibility Tracker โ€” ChatGPT, Perplexity, Gemini

highbrow_fame/ai-search-visibility-tracker

Track brand citations in ChatGPT, Perplexity, Gemini, Google AI Overviews. Multilingual (24 languages incl. Hungarian, German, French, Polish, Czech). Bring-your-own-key โ€” start FREE with Gemini's free tier. Daily diff. Pay-per-query, no monthly minimums. Cheapest GEO/AEO tracker on Apify.

AI Brand Monitor โ€” Perplexity, ChatGPT, Claude & Gemini

khadinakbar/ai-search-brand-monitor

Track brand visibility across Perplexity, ChatGPT, Claude & Gemini AI search MCP-ready. $0.080/result.

132

Gemini Sales Ai

constant_xyloidin/gemini-sales-ai

Turn any URL into a B2B lead. Uses Gemini 2.0 AI to analyze websites, identify pain points, and generate personalized cold emails. Features stealth Playwright scraping and validated JSON output. Ideal for high-ticket sales outreach

Bulk LLM Runner โ€” GPT, Claude, Gemini, Perplexity (No API Key)

fayoussef/bulk-llm-runner

Run hundreds of prompts in parallel across GPT, Claude, Gemini and Perplexity Sonar โ€” plus 400+ other LLMs โ€” without API key. Built-in web search, PDF reading, vision, JSON output and side-by-side model comparison.

๐Ÿ‘ User avatar

youssef farhan

123

5.0