# Gemini Built-in Webscraper: Parse PDFs, Images & Sites in Seconds

Source: https://www.youtube.com/watch?v=pycp1b8Gh3o
Recap page: https://rapidrecap.app/video/pycp1b8Gh3o
Generated: 2026-02-04T14:03:55.633+00:00

---
## Quick Overview

Gemini API's built-in URL context tool efficiently processes content from URLs, including text, images, and PDFs, by using an internal index cache for speed or falling back to a live fetch, allowing developers to ground model responses in real-time web data without needing external scrapers.

**Key Points:**
- The Gemini URL Context tool processes content from provided URLs, supporting text (HTML, JSON, XML, etc.), images (PNG, JPEG, WebP), and PDFs.
- The tool uses a two-step retrieval process: first checking an internal index cache for speed, and if unavailable (e.g., a new page), it falls back to a live fetch.
- Function calling, which is required to use tools like URL Context, is currently unsupported when using the URL Context tool alongside Google Search grounding.
- The request limit for the tool allows processing up to 20 URLs per request, with a maximum content size of 34MB per single URL.
- URLs must be publicly accessible on the web; local addresses (like localhost) or private networks are unsupported.
- The URL context data, including token counts from retrieved content, is visible in the `usage_metadata` object of the model output.
- The demonstration shows that the URL context tool successfully identifies and translates numbered parts of a trombone image from a Wikipedia URL into French.

![Screenshot at 00:00: Python code snippet demonstrating the initialization of the Gemini client and the generate\_content call, including passing two documentation URLs within the contents parameter and enabling the url\_context tool in the config.](https://ss.rapidrecap.app/screens/pycp1b8Gh3o/00-00-00.jpg)

**Context:** This video provides a tutorial on utilizing the built-in URL Context tool within the Gemini API, which allows Large Language Models (LLMs) to directly access and process content from specific web page URLs provided in the prompt. This capability enhances grounding by using live web information rather than relying solely on pre-trained data. The demonstration shows how to configure this tool in Python using the `genai` SDK and how it can handle text-based documentation links as well as image and PDF content.

## Detailed Analysis

The video explains and demonstrates the use of the Gemini API's URL Context tool for grounding model responses in external web data. The initial code example shows how to initialize the `genai` client and make a call to `client.models.generate_content` using the `gemini-2.5-flash` model, specifically including two documentation URLs in the content prompt and enabling the `url_context` tool within the configuration. The speaker notes that this tool is one of their favorites because it avoids the need for external scraping tools. The documentation review confirms that the tool supports text (various formats like HTML, JSON, XML), images (PNG, JPEG, WebP), and PDFs. Key limitations include a 20 URL per request limit and a 34MB size limit per URL, and URLs must be publicly accessible. The video then transitions to a Google Colab notebook demonstrating grounding with Google Search, showing that the search tool configuration involves adding `"google_search": {}` to the tools list. A combined example shows how to use both URL context and Google Search grounding simultaneously to answer a question based on a PDF link and current web information. Finally, an example demonstrates the tool's ability to process an image URL (a diagram of a trombone) and correctly identify and translate its numbered parts into French. The retrieved URLs and their success status are visible in the `url_context_metadata` output.

### Gemini API Setup

- Python code imports `genai`; client initialization uses `genai.Client()`; model set to `gemini-2.5-flash`.

### URL Context Tool Configuration

- Tool is enabled by adding `"url_context": {}` inside the `config.tools` list when calling `generate_content`.

### Supported Content Types (Docs Review)

- Text (HTML, JSON, XML, etc.), Images (PNG, JPEG, WebP), and PDF (application/pdf) are supported; Paywalled content, YouTube videos, and Google Workspace files are not.

### Grounding with Google Search

- Enabled by adding `"google_search": {}` to the `tools` configuration.

### Combining Tools

- Both `url_context` and `google_search` can be used together in the same configuration to ground answers using both provided URLs and real-time web search.

### PDF and Image Processing Example

- Demonstrates querying an image URL (trombone diagram) and receiving numbered parts translated into French; also shows querying a PDF link for an earnings report summary.

![Screenshot at 00:00: Python code snippet demonstrating the initialization of the Gemini client and the generate\_content call, including passing two documentation URLs within the contents parameter and enabling the url\_context tool in the config.](https://ss.rapidrecap.app/screens/pycp1b8Gh3o/00-00-00.jpg)
![Screenshot at 00:07: Screenshot from the Gemini API documentation listing supported content types: Text, Image \(various formats\), and PDF.](https://ss.rapidrecap.app/screens/pycp1b8Gh3o/00-00-07.jpg)
![Screenshot at 01:20: The Gemini AI Studio interface showing that the 'URL context' tool is available and can be toggled on in the configuration panel on the right.](https://ss.rapidrecap.app/screens/pycp1b8Gh3o/00-01-20.jpg)
![Screenshot at 02:22: A table from the documentation detailing the features and capabilities of different Gemini model generations \(1.5, 2.0, 2.5, 3\), confirming URL context is supported by Gemini 2.5 Flash-Lite.](https://ss.rapidrecap.app/screens/pycp1b8Gh3o/00-02-22.jpg)
![Screenshot at 06:35: Code cell demonstrating the configuration structure for combining both url\_context and google\_search tools within the config dictionary.](https://ss.rapidrecap.app/screens/pycp1b8Gh3o/00-06-35.jpg)
