> For the complete documentation index, see [llms.txt](https://docs.scraperapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scraperapi.com/integrations/llm-integrations/langchain-integration/quick-start.md).

# Quick Start

Scrape HTML, text, or markdown from any webpage:

```python
import os
os.environ["SCRAPERAPI_API_KEY"] = "API_KEY"
from langchain_scraperapi.tools import ScraperAPITool

tool = ScraperAPITool()

# Get text content
result = tool.invoke({
    "url": "https://quotes.toscrape.com/",
    "output_format": "text",
    "render": True
})
print(result)
```

<table><thead><tr><th width="326">Parameters</th><th>Details</th></tr></thead><tbody><tr><td><code>URL</code> (required)</td><td>Target page URL</td></tr><tr><td><code>OUTPUT_FORMAT</code></td><td><code>"text"</code> | <code>"markdown"</code> (default returns HTML)</td></tr><tr><td><code>COUNTRY_CODE</code></td><td><code>country_code</code> – e.g. "us", "de"</td></tr></tbody></table>

For the full list of supported parameters, please visit [this](/control-and-optimization/supported-parameters.md) page.

### ScraperAPIGoogleSearchTool

Get Google Search results in a structured JSON or CSV format:

```python
import os
os.environ["SCRAPERAPI_API_KEY"] = "API_KEY"
from langchain_scraperapi.tools import ScraperAPIGoogleSearchTool

google_search = ScraperAPIGoogleSearchTool()

results = google_search.invoke({
    "query": "what is langchain",
    "num": 20,
    "output_format": "json"
})
print(results)
```

<table><thead><tr><th width="326">Parameters</th><th>Details</th></tr></thead><tbody><tr><td><code>QUERY</code> (required)</td><td>Search terms.</td></tr><tr><td><code>OUTPUT_FORMAT</code></td><td><code>"json"</code> (default) or <code>"csv"</code>.</td></tr><tr><td><code>COUNTRY_CODE</code></td><td><code>country_code</code> – e.g. "us", "de".</td></tr></tbody></table>

For the full list of supported parameters, please visit [this](/structured-data-endpoints/search-and-insights/google/google-serp-api.md) page.

### ScraperAPIAmazonSearchTool

Get Amazon Product Search results in a structured JSON or CSV format:

```python
import os
os.environ["SCRAPERAPI_API_KEY"] = "API_KEY"
from langchain_scraperapi.tools import ScraperAPIAmazonSearchTool

amazon_search = ScraperAPIAmazonSearchTool()

products = amazon_search.invoke({
    "query": "noise cancelling headphones",
    "tld": "co.uk",
    "page": 2
})
print(products)
```

<table><thead><tr><th width="326">Parameters</th><th>Details</th></tr></thead><tbody><tr><td><code>QUERY</code> (required)</td><td>Product Search terms.</td></tr><tr><td><code>OUTPUT_FORMAT</code></td><td><code>"json"</code> (default) or <code>"csv"</code>.</td></tr><tr><td><code>COUNTRY_CODE</code></td><td><code>country_code</code> – e.g. "us", "de".</td></tr></tbody></table>

For the full list of supported parameters, please visit [this](/structured-data-endpoints/e-commerce/amazon/amazon-search-api.md) page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scraperapi.com/integrations/llm-integrations/langchain-integration/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
