Skip to main content

llama readme

LlamaIndex integration for TalorData SERP API

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 llama-index-tools-talordata-serp package brings TalorData’s real-time search capabilities into LlamaIndex, so you can add live search, engine inspection, request history, and usage analytics directly to your LLM workflows and AI agent systems.

Overview

llama-index-tools-talordata-serp provides LlamaIndex 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

Installation

Install from PyPI:

python -m pip install llama-index-tools-talordata-serp

Authentication

1. Get your API key

Sign up at TalorData and get your API key from the dashboard.

2.Use a Talordata SERP API key:

sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Do not use a Talordata dashboard login JWT. Dashboard JWT tokens are for dashboard APIs, while this package calls the SERP request API with Authorization: Bearer <SERP_API_KEY>.

3.You can pass the API key directly:

from llama_index.tools.talordata_serp import TalordataSerpToolSpec

tool_spec = TalordataSerpToolSpec(api_key="sk_xxx")

Or read it from an environment variable in your application code.

Basic Usage

from llama_index.tools.talordata_serp import TalordataSerpToolSpec

tool_spec = TalordataSerpToolSpec(api_key="sk_xxx")
tools = tool_spec.to_tool_list()

Direct ToolSpec Calls

import json

from llama_index.tools.talordata_serp import TalordataSerpToolSpec

tool_spec = TalordataSerpToolSpec(api_key="sk_xxx")

result = tool_spec.search_engine(
    query="latest AI search trends",
    engine="google",
    country="us",
    language="en",
    num=5,
)

print(json.loads(result))

Agent Usage

This example requires the openai extra:

python -m pip install "llama-index-llms-openai>=0.3.0"
import asyncio

from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.talordata_serp import TalordataSerpToolSpec


async def main() -> None:
    tool_spec = TalordataSerpToolSpec(api_key="sk_xxx")

    agent = FunctionAgent(
        tools=tool_spec.to_tool_list(),
        llm=OpenAI(model="gpt-4.1"),
    )

    response = await agent.run("Find three recent search results for coffee market trends.")
    print(response)


asyncio.run(main())

Tools

search_engine

Search Google, Bing, Yandex, or DuckDuckGo and return normalized web results.

result = tool_spec.search_engine(
    query="coffee",
    engine="google",
    country="us",
    language="en",
    num=3,
)

image_search

Search Bing Images or Google Images and return normalized image results.

result = tool_spec.image_search(
    query="coffee",
    engine="bing_images",
    country="us",
    language="en",
    count=3,
)

news_search

Search Google News or Bing News and return normalized news-style results.

result = tool_spec.news_search(
    query="markets",
    engine="google_news",
    country="us",
    language="en",
)

raw_serp_request

Pass an engine and extra JSON parameters directly to the Talordata SERP API. Use this when you need engine-specific parameters that are not exposed by the normalized helpers.

result = tool_spec.raw_serp_request(
    engine="google",
    query="coffee",
    params_json='{"num": 3, "country": "us", "language": "en"}',
)

Response Shape

Normal search tools return a JSON string with this shape:

{
  "query": "coffee",
  "engine": "google",
  "results": [
    {
      "title": "Coffee",
      "link": "https://example.com",
      "snippet": "Coffee article",
      "source": "Example"
    }
  ]
}

Agent-friendly errors are returned as JSON strings:

{
  "error": {
    "type": "SerpApiError",
    "status_code": 401,
    "message": "API key authentication failed"
  }
}

Set include_raw=True on normal tools when the caller needs the full upstream payload.

Resources

Support

For issues with the LlamaIndex 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 LlamaIndex?

Explore the TalorData LlamaIndex Integration Guide

Read the Integration Documentation


TalorData brings real-time search to LlamaIndex, enabling developers to build AI agents and workflows with fresh, structured, and reliable search data.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_tools_talordata_serp-0.1.2.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_tools_talordata_serp-0.1.2.tar.gz.

File metadata

File hashes

Hashes for llama_index_tools_talordata_serp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 469ebca143960dfd7a135d617205b362906dba39a4ee13b5009f50d0142d441d
MD5 dcbb0dfc39890d7d978db196fa516013
BLAKE2b-256 d243806dd98184e90f1602d1188bfe06ab4b786055f37238114664302649a65a

See more details on using hashes here.

File details

Details for the file llama_index_tools_talordata_serp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_talordata_serp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c7bcf3c2f762d8ff1eba7301d0f2e5eb3f41c6936d437fad5b727cbc1f701644
MD5 977122083701c27e9aa48c182c0a032d
BLAKE2b-256 bed5a43bd47788466d0a8bf6371cf63040406fb24d4b0f2d1959f6edabd582cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page