LangChain integration for Talor SERP API — 33 search engines in one tool
Project description
langchain-talor-serp
LangChain integration for TalorData's SERP APIs
Installation • Quick Start • Tools • Resources
LangChain integration for the Talor SERP API.
This package provides:
TalorSerpAPIWrapperfor direct sync and async API accessTalorSerpToolfor creating LangChain tools- bundled engine schemas for 30+ search engines
- support for search, history, and statistics endpoints
Overview
langchain-talor-serp provides LangChain tools for TalorData's SERP APIs, 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
Installation
pip install langchain-talor-serp
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_talor_serp 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)
4. Search tool
from langchain_talor_serp 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)
Search parameters:
query: required 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 engine
params also 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_talor_serp import TalorSerpTool
history_tool = TalorSerpTool.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:00
6. Statistics tool
from langchain_talor_serp import TalorSerpTool
statistics_tool = TalorSerpTool.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:00
7. Bind multiple tools
from langchain_talor_serp import TalorSerpTool
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
tools = TalorSerpTool.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 parameterstalor_serp_list_engines- inspect supported engines and detailed parameter schemastalor_serp_history- query historical SERP requeststalor_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.0
avoid langchain_classic.agents.create_openai_functions_agent() and other
legacy initialize_agent / AgentType.OPENAI_FUNCTIONS flows with chat models.
Those classic agent paths call llm.invoke(..., callbacks=...), while modern
BaseChatModel.invoke() forwards callbacks through config, 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 callinglangchain.agents.create_agent(...)for new agent workflowsagent.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-talor-serp
- TalorData: talordata.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_talor_serp-0.1.4.tar.gz.
File metadata
- Download URL: langchain_talor_serp-0.1.4.tar.gz
- Upload date:
- Size: 140.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
169dfaeb479a208882c666140e9009eb392a7c652619dd7ca98805c36918a65e
|
|
| MD5 |
2737ce6169ecf9715c1c20c253b6e1e7
|
|
| BLAKE2b-256 |
3adedb735558b38856e2c03ba3a526db0b7988611e4152bc8cca7b3c3db92789
|
File details
Details for the file langchain_talor_serp-0.1.4-py3-none-any.whl.
File metadata
- Download URL: langchain_talor_serp-0.1.4-py3-none-any.whl
- Upload date:
- Size: 168.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
380e6cfed8ab736a5d0a349c0f374fb022bbb579f9bbec3c99ba3e6080f2b264
|
|
| MD5 |
7ee118cdb4a86805960fa581943c8911
|
|
| BLAKE2b-256 |
05fb341f4dc8687f6f8ce2008e51b9a877e56145d22a58510a5b66125deffcd5
|