For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to Set Up TalorData with LangChain

Set up Talordata with LangChain to fetch real-time SERP data and use structured search results inside AI applications.

Integrate TalorData with LangChain to provide LLM-based agents with reliable, anonymous, and scalable web access for executing real-world data tasks, covering 195 countries and regions.

You can use the langchain-talordata Python package to implement this integration, which supports the following features:

  • TalorSerpTool – TalorData offers a powerful SERP API that allows you to query search engines (Google, Bing, Yandex, DuckDuckGo) using geolocation and advanced customization options—features particularly useful for AI agents requiring real-time web information.

Alternatively, via TalorData's MCP (Model Context Protocol)—a local server providing various scraping and automation tools — Although it is not part of the langchain-talordata package, it can be manually integrated using LangChain's Tool or RequestsWrapper.

How to integrate TalorData with LangChain

1

Get your TalorData API Token

2

Install the TalorData integration

Run the following command to install the TalorData integration package for LangChain:

pip install langchain-talordata
3

Set environment variables

Set your TalorData API Token as an environment variable:

import os
os.environ["TALOR_API_KEY"] = "your-token"
4

Using the TaylorData + LangChain integration

API Reference: SERP API Documentation

Basic Usage

from langchain_talordata import TalorSerpTool

search_tool = TalorSerpTool.from_env()

result = search_tool.invoke({
    "query": "LangChain tutorial",
    "engine": "google",
    "params": {
        "gl": "us",
        "hl": "en",
        "device": "desktop",
    },
})

print(result)

5

Use within an Agent

from langchain_talordata import TalorSerpTool
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
tool = TalorSerpTool.from_env()

# Tool calling without langchain_classic agents
model_with_tools = llm.bind_tools([tool])
response = model_with_tools.invoke("Search for the latest LangChain news")
print(response)

Last updated