Skip to main content

LlamaIndex Readers Integration: Zyte-Serp

ZyteSerp can be used to add organic search results from Google Search. It takes a query and returns top search results urls.

Instructions for ZyteSerpReader

Setup and Installation

pip install llama-index-readers-zyte-serp

Secure an API key from Zyte to access the Zyte services.

Using ZyteSerpReader

  • Initialization: Initialize the ZyteSerpReader by providing the API key and the option for extraction ("httpResponseBody" or "browserHtml").

    from llama_index.readers.zyte_serp import ZyteSerpReader
    
    zyte_serp = ZyteSerpReader(
        api_key="your_api_key_here",
        extract_from="httpResponseBody",  # or "browserHtml"
    )
    
  • Loading Data: To load search results, use the load_data method with the query you wish to search.

documents = zyte_serp.load_data(query="llama index docs")

Example Usage

Here is an example demonstrating how to initialize the ZyteSerpReader and get top search URLs. Further the content from these URLs can be loaded using ZyteWebReader in "article" mode to obtain just the article content from webpage.

from llama_index.readers.zyte_serp import ZyteSerpReader
from llama_index.readers.web.zyte.base import ZyteWebReader

# Initialize the ZyteSerpReader with your API key
zyte_serp = ZyteSerpReader(
    api_key="your_api_key_here",  # Replace with your actual API key
)

# Get the search results (URLs from google search results)
search_urls = zyte_serp.load_data(query="llama index docs")

# Display the results
print(search_urls)

urls = [result.text for result in search_urls]

# Initialize the ZyteWebReader to load the content from search results
zyte_web = ZyteWebReader(
    api_key="your_api_key_here",  # Replace with your actual API key
    mode="article",
)

documents = zyte_web.load_data(urls)
print(documents)

Metadata

Release files for llama-index-readers-zyte-serp 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-readers-zyte-serp 0.5.0
File Size Uploaded
llama_index_readers_zyte_serp-0.5.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-readers-zyte-serp 0.5.0
File Interpreter ABI Platform
llama_index_readers_zyte_serp-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / llama_index_readers_zyte_serp-0.5.0.tar.gz

Download URL llama_index_readers_zyte_serp-0.5.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8b8d3980a99876db91570562cbb914373d234c0c2940b84a4da91b2e4838ef01
BLAKE2b-256 checksum
How to use checksums
12543eb4ab17f8e1396f83d4e1a6da2ffacfdffee88c29e32a33f98a27624906
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_readers_zyte_serp-0.5.0-py3-none-any.whl

Download URL llama_index_readers_zyte_serp-0.5.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6966b94cc55e2b8729584b568fae220dec9b7cbbc5b16759846855ecb369861d
BLAKE2b-256 checksum
How to use checksums
c98147bd76b673c56dcc9df1f09202e8ed2f85ff3b14717b56f248807d7e6b8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page