Skip to main content

llama-index readers zyte-serp integration

Project description

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)

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

llama_index_readers_zyte_serp-0.4.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

llama_index_readers_zyte_serp-0.4.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_zyte_serp-0.4.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_zyte_serp-0.4.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}

File hashes

Hashes for llama_index_readers_zyte_serp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1b5aa3a57b3dd651ee2cf29f3eddceec2affdcee4ede41be9a86c5d079d25357
MD5 bd6bc098f32c95f67caf39ad681a8a0b
BLAKE2b-256 e77ea4e7d112b57f2ee5865b3b29f70de2e67a0e9fffff82d6681252a12bcf3a

See more details on using hashes here.

File details

Details for the file llama_index_readers_zyte_serp-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_readers_zyte_serp-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}

File hashes

Hashes for llama_index_readers_zyte_serp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d2f501c0e8ba7f34b4f7adf096e921c66e071f2636536248c7831aef526ed3f
MD5 681d9f99bb52ed2b530d6304979a4b27
BLAKE2b-256 a353780aefb0a13a6c6542db4829151becadac54270cf18e2201f972ef92204b

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 Pingdom Monitoring Sentry Error logging StatusPage Status page