LangChain integration for TalorData SERP API
Installation • Quick Start • Tools • Resources
PyPI version Python versions License: MIT
TalorData helps developers and AI applications connect to real-time, structured, and reliable search data through a single SERP API. With support for Google, Bing, News, Images, Shopping, Maps, Scholar, Trends, and more, TalorData makes it easier to build AI agents, search copilots, SEO workflows, and data-driven automations powered by live search results.
The langchain-talordata package brings TalorData’s real-time search capabilities into LangChain, so you can add live search, engine inspection, request history, and usage analytics directly to your LLM workflows and AI agent systems.
Overview
langchain-talordata provides LangChain tools for TalorData SERP API, enabling your AI agents to:
- Search - Query search engines with geo-targeting and language customization
- Inspect engines - Discover supported engines and engine-specific parameters
- Query history - Fetch SERP request history with filters
- View statistics - Retrieve usage statistics by date range and engine
This package provides:
TalorDataSerpAPIWrapperfor direct sync and async API accessTalorDataSerpToolfor creating LangChain tools- 20+ search types across four major search engines
- support for search, history, and statistics endpoints
Installation
pip install langchain-talordata
Quick start
1. Get your API key
Sign up at TalorData and get your API key from the dashboard.
2. Set up authentication
import os
os.environ["TALOR_API_KEY"] = "your-token"
3. Modern agent usage
from langchain_talordata import TalorDataSerpTool
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
tool = TalorDataSerpTool.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)
4. Search tool
from langchain_talordata import TalorDataSerpTool
search_tool = TalorDataSerpTool.from_env()
result = search_tool.invoke({
"query": "LangChain tutorial",
"engine": "google",
"params": {
"gl": "us",
"hl": "en",
"device": "desktop",
},
})
print(result)
Search parameters:
query: optional search query textengine: optional engine key such asgoogle,google_news,google_images,bing,duckduckgoparams: optional engine-specific parameter object- common
paramsfields includegl,hl,device,location, andno_cache - use
talor_serp_list_enginesto inspect detailed parameters for a specific engineparamsalso accepts a JSON string when returned by a model tool call, for example:
result = search_tool.invoke({
"query": "LangChain tutorial",
"engine": "google",
"params": "{\"hl\": \"zh-CN\", \"gl\": \"cn\"}",
})
5. History tool
from langchain_talordata import TalorDataSerpTool
history_tool = TalorDataSerpTool.history_from_env()
result = history_tool.invoke({
"page": 1,
"page_size": 20,
"search_query": "langchain",
"search_engine": "google",
"status": "success",
"timezone": "Asia/Shanghai",
})
print(result)
History parameters:
page: page number, default1page_size: page size, default20search_query: optional keyword filtersearch_engine: optional engine filter such asgoogleorbingstatus:all,success, orerrorstart_time: optional unix timestamp in secondsend_time: optional unix timestamp in secondstimezone: optional timezone header such asAsia/Shanghaior+08:006. Statistics tool
from langchain_talordata import TalorDataSerpTool
statistics_tool = TalorDataSerpTool.statistics_from_env()
result = statistics_tool.invoke({
"start_date": "2026-06-01",
"end_date": "2026-06-05",
"engines": "google,bing",
"timezone": "+08:00",
})
print(result)
Statistics parameters:
start_date: required, formatYYYY-MM-DDend_date: required, formatYYYY-MM-DDengines: optional comma-separated engine keys such asgoogle,bingtimezone: optional timezone offset such as+08:007. Bind multiple tools
from langchain_talordata import TalorDataSerpTool
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
tools = TalorDataSerpTool.tools_from_env()
model_with_tools = llm.bind_tools(tools)
response = model_with_tools.invoke("Show my SERP usage statistics for 2026-06-01 to 2026-06-05")
print(response)
bind_tools() only lets the model generate tool_calls. To actually execute the selected tool, either:
-
call
tool.invoke(...)directly, or -
use an agent workflow that executes tools automatically Tools
-
talor_serp_search- search the web with engine-specific parameters -
talor_serp_list_engines- inspect supported engines and detailed parameter schemas -
talor_serp_history- query historical SERP requests -
talor_serp_statistics- query usage statistics for a date range Compatibility note
If you are using modern package versions such as:
langchain-core>=1.0langchain-classic>=1.0langchain-openai>=1.0avoidlangchain_classic.agents.create_openai_functions_agent()and other legacyinitialize_agent/AgentType.OPENAI_FUNCTIONSflows with chat models. Those classic agent paths callllm.invoke(..., callbacks=...), while modernBaseChatModel.invoke()forwards callbacks throughconfig, which can lead to:
TypeError: BaseLLM.generate_prompt() got multiple values for keyword argument 'callbacks'
Use one of these approaches instead:
-
llm.bind_tools([tool])for direct tool calling -
langchain.agents.create_agent(...)for new agent workflows -
agent.invoke(...)instead of deprecatedagent.run(...)Features -
compatible with LangChain tool workflows
-
supports multiple Talor SERP engines such as Google, Bing, Yandex, and DuckDuckGo
-
exposes engine schema metadata for parameter-aware integrations
-
includes helper APIs for usage history and statistics Resources
-
PyPI: langchain-talordata
-
TalorData: talordata.com
Support
For issues with the LangChain integration package, report an issue in the GitHub repository.
For TalorData SERP API account, quota, or API key issues, contact TalorData support through the support channel listed in your TalorData account or dashboard.
For detailed integration tutorials and API documentation, visit the TalorData Documentation.
Learn More
Ready to build AI agents with real-time search in LangChain?
Explore the TalorData LangChain Integration Guide
Read the Integration Documentation
TalorData brings real-time search to LangChain, enabling developers to build AI agents and workflows with fresh, structured, and reliable search data.
Metadata
Release files for langchain-talordata 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| langchain_talordata-0.1.5.tar.gz | 145.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_talordata-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 311.5 kB
Release files / langchain_talordata-0.1.5.tar.gz
| Download URL | langchain_talordata-0.1.5.tar.gz |
|---|---|
| Size | 145.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b3f840c8e30a54f0a10df02c98e0815e375a44f055439ea2bd2d3cb35b348d7
|
|
BLAKE2b-256 checksum How to use checksums |
ae2b3591d910b2ff6cae06fe1a10137b0ae29b7cc9c89c66af5552da9585df7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / langchain_talordata-0.1.5-py3-none-any.whl
| Download URL | langchain_talordata-0.1.5-py3-none-any.whl |
|---|---|
| Size | 165.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3633bf256e68ad037786cf54319d9f9b8f175e829d12a608798b3d2f8a5f7cb
|
|
BLAKE2b-256 checksum How to use checksums |
1dcbfff5ae19241b6ac2df685f769b349821bba8f9340c5cd1aefd5a2f5722cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for langchain-talordata 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.