Sign In

@decodo/langchain-ts

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@decodo/langchain-ts

LangChain tools for Decodo's Scraper API

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

Decodo LangChain Tools

A Node.js LangChain plugin that enables developers to use Decodo's Scraper API alongside their LangChain applications.

Features

  • Web Scraping: Scrape any URL and retrieve Markdown content
  • Google Search: Search Google and retrieve structured results
  • Amazon Search: Search Amazon and retrieve structured product data
  • Reddit Scraping: Scrape Reddit posts and subreddits
  • Full TypeScript Support: Complete type definitions for all parameters
  • LangChain Integration: Seamless integration with LangChain's Tool system

Installation

npm install @decodo/langchain-ts

Quick Start

To use the tools in this project, you will need a Decodo Advanced Web Scraping API subscription. Free trials are available on the dashboard.

Once you have a plan activated, take a note of your generated username and password:

Decodo dashboard

A simple agentic example:

import dotenv from 'dotenv';
import { ChatOpenAI } from '@langchain/openai';
import { createReactAgent } from '@langchain/langgraph/prebuilt';
import { DecodoUniversalTool } from '@decodo/langchain-ts';

dotenv.config();

const main = async () => {
  const username = process.env.SCRAPER_API_USERNAME!;
  const password = process.env.SCRAPER_API_PASSWORD!;

  const decodoUniversalTool = new DecodoUniversalTool({ username, password });

  const model = new ChatOpenAI({
    model: 'gpt-4o-mini',
  });

  const agent = createReactAgent({
    llm: model,
    tools: [decodoUniversalTool],
  });

  const result = await agent.invoke({
    messages: [
      {
        role: 'user',
        content: 'scrape the wikipedia NBA 2025 season page and tell me who won in 2025?',
      },
    ],
  });

  console.log(result.messages[result.messages.length - 1].content);
};

if (require.main === module) {
  main();
}

Available Tools

See the tools/ directory for a list of available tools.

Examples

See the examples/ directory to see tools in action.

Configuration

All tools accept a DecodoConfig object:

type DecodoConfig = {
  username: string; // Your Web Advanced product username
  password: string; // Your Web Advanced product password
};

API Parameters

See the Scraper API documentation for a list of available parameters

License

MIT

Support

For support, please visit Decodo's documentation or open an issue on GitHub.

Keywords

langchain

FAQs

Package last updated on 03 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts