Skip to main content
Give your AI agent the ability to browse websites, search Google and Amazon in just two lines of code. The langchain-scraperapi package adds three ready-to-use LangChain tools backed by the ScraperAPI service:

Overview

Integration details

Setup

Install the langchain-scraperapi package:

Credentials

Create an account at ScraperAPI and get an API key:

Instantiation

Invocation

Invoke directly with args

Features

1. ScraperAPITool — browse any website

Invoke the raw ScraperAPI endpoint and get HTML, rendered DOM, text, or markdown. Invocation arguments:
  • url (required) – target page URL
  • Optional (mirror ScraperAPI query params):
    • output_format: "text" | "markdown" (default returns raw HTML)
    • country_code: e.g. "us", "de"
    • device_type: "desktop" | "mobile"
    • premium: bool – use premium proxies
    • render: bool – run JS before returning HTML
    • keep_headers: bool – include response headers
For the complete set of modifiers see the ScraperAPI request-customisation docs.
Structured SERP data via /structured/google/search. Invocation arguments:
  • query (required) – natural-language search string
  • Optional: country_code, tld, uule, hl, gl, ie, oe, start, num
  • output_format: "json" (default) or "csv"
Structured product results via /structured/amazon/search. Invocation arguments:
  • query (required) – product search terms
  • Optional: country_code, tld, page
  • output_format: "json" (default) or "csv"

Use within an agent

Here is an example of using the tools in an AI agent. The ScraperAPITool gives the AI the ability to browse any website, summarize articles, and click on links to navigate between pages.

API reference

Below you can find more information on additional parameters to the tools to customize your requests: The LangChain wrappers surface these parameters directly.