# ParallelExtractTool

> **Class** in `langchain_parallel`

📖 [View in docs](https://reference.langchain.com/python/langchain-parallel/extract_tool/ParallelExtractTool)

Parallel Extract Tool.

Calls Parallel's Extract API to pull clean, structured content from web
pages. Returns a compact summary string the LLM sees and the full
structured response as a tool artifact.

## Signature

```python
ParallelExtractTool()
```

## Description

**Setup:**

Install `langchain-parallel` and set environment variable
`PARALLEL_API_KEY`.

```bash
pip install -U langchain-parallel
export PARALLEL_API_KEY="your-api-key"
```

**Key init args:**

api_key: Optional[SecretStr]
    Parallel API key. If not provided, will be read from
    PARALLEL_API_KEY env var.
base_url: str
    Base URL for Parallel API. Defaults to "https://api.parallel.ai".
max_chars_per_extract: Optional[int]
    Tool-wide default cap on full_content size (per URL). Only applied
    when full_content is passed as ``True`` (a settings object always
    wins).

**Instantiation:**

```python
from langchain_parallel import ParallelExtractTool

tool = ParallelExtractTool()
```

**Invocation:**

```python
result = tool.invoke({
    "urls": ["https://en.wikipedia.org/wiki/Artificial_intelligence"],
    "search_objective": "Main applications of AI",
    "full_content": False,
})
for r in result:
    print(r["url"], r.get("title"))
```

**Async:**

```python
result = await tool.ainvoke({"urls": [...]})
```

Response shape (``list[dict]``):
Each item carries `url`, `title`, optional `publish_date`, and
either `excerpts` (always present in v1) and/or `full_content`.
Errors carry `error_type` and `http_status_code`.

## Extends

- `BaseTool`

## Properties

- `name`
- `description`
- `args_schema`
- `api_key`
- `base_url`
- `max_chars_per_extract`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-parallel/extract_tool/ParallelExtractTool/validate_environment)

---

[View source on GitHub](https://github.com/parallel-web/langchain-parallel/blob/234dcb368dc21a0291eaf9e7f37c777b5e9a1fcc/langchain_parallel/extract_tool.py#L137)