> ## Documentation Index
> Fetch the complete documentation index at: https://docs.geekflare.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LlamaIndex

> Use Geekflare in LlamaIndex agents with the llama-index-tools-geekflare package, with tools for search, web scraping, brand data, screenshots, and website diagnostics.

The `llama-index-tools-geekflare` package gives LlamaIndex agents Geekflare as a tool spec: web and Google SERP search, page scraping to Markdown or structured JSON, page metadata, brand identity, screenshots, URL-to-PDF, and website diagnostics. It's built on the official [Python SDK](https://pypi.org/project/geekflare-api/) and requires Python 3.10+ and `llama-index-core` 0.12 to 0.14.

## Install

```bash theme={null}
pip install llama-index-tools-geekflare
```

## Set your API key

Get an API key at [dash.geekflare.com](https://dash.geekflare.com) and set it as an environment variable:

```bash theme={null}
export GEEKFLARE_API_KEY="YOUR_API_KEY"
```

Replace `YOUR_API_KEY` with your Geekflare API key. You can also pass the key directly with `GeekflareToolSpec(api_key="YOUR_API_KEY")`. An optional `timeout` (in seconds, default 180) controls how long each call can run.

## Use the tools in an agent

`GeekflareToolSpec().to_tool_list()` returns all 15 tools.

```python theme={null}
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.anthropic import Anthropic
from llama_index.tools.geekflare import GeekflareToolSpec

agent = FunctionAgent(
    tools=GeekflareToolSpec().to_tool_list(),
    llm=Anthropic(model="claude-sonnet-5-5"),
)
response = await agent.run("Is the TLS certificate on example.com close to expiring?")
print(response)
```

## Select only the tools you need

Give the agent only the tools it needs by filtering on the tool name:

```python theme={null}
spec = GeekflareToolSpec()
tools = [t for t in spec.to_tool_list() if t.metadata.name in {"search", "scrape"}]
```

## Call tools directly

```python theme={null}
from llama_index.tools.geekflare import GeekflareToolSpec

geekflare = GeekflareToolSpec()
geekflare.search("latest stable python release", limit=5)
geekflare.search("best project management software", serp=True,
                 city="London,England,United Kingdom")
geekflare.scrape("https://example.com", formats=["markdown"])
```

## Tools

Each tool returns the API's JSON response as a dict. API errors raise `GeekflareAPIError`, which agents receive as a tool error.

| Tool name | Purpose and key arguments |
| :- | :- |
| `search` | Web, news, and image search. Set `serp=True` for the full Google results page (AI Overview, People Also Ask) by `location` country code or `city`. Also supports `limit`, `source`, `time`, `include_domains`, `exclude_domains`, `scrape`, and `grounded_answer`. |
| `scrape` | Page content as `markdown` (default), `markdown-llm`, `text`, `html`, or `json`, using `formats`. Use `template="product"` or `template="contact"` for structured data. Also supports `render_js`, `wait_time`, and `device`. |
| `meta_scrape` | Title, description, canonical URL, Open Graph, and Twitter Card metadata. |
| `brand` | Logos, colors, fonts, and social profiles. `mode="enriched"` adds company intelligence. |
| `screenshot` | A hosted image URL. Supports `full_page`, `device`, `image_type`, and `selector`. |
| `url_to_pdf` | A hosted PDF URL. Supports `paper_format` and `orientation`. |
| `site_status` | Check whether a site is up. |
| `dns_records` | DNS records. Use `types` to pick record types. |
| `dnssec` | DNSSEC configuration. |
| `tls_scan` | TLS protocol support and certificate details. |
| `redirect_check` | The full redirect chain of a URL. |
| `broken_links` | Broken links on a page. |
| `load_time` | Page load time. |
| `mixed_content` | HTTP resources loaded on HTTPS pages. |
| `lighthouse` | Lighthouse audit. Supports `device`. Slower than the other tools. |

## Notes

* Each call spends credits from your Geekflare account. See [Credit Consumption](/api-credit-mapping) and [pricing](https://geekflare.com/pricing/).
* Geekflare works with public pages only.

## Links

> **[PyPI](https://pypi.org/project/llama-index-tools-geekflare/)**
>
> `llama-index-tools-geekflare` on PyPI.

> **[GitHub](https://github.com/geekflare/llama-index-tools-geekflare)**
>
> Source code (MIT license).

> **[Python SDK](https://pypi.org/project/geekflare-api/)**
>
> The official SDK this package is built on.

> **[LangChain](/integrations/langchain)**
>
> Use Geekflare tools in LangChain agents.

> **[MCP Server](/mcp/overview)**
>
> Connect Geekflare to AI clients through MCP.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.