diff --git a/README.md b/README.md index 4be80fe..1abed59 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ scraper = webt.Scraper( out_json = scraper.scrape("https://www.example.com") ``` -## Web Search (SERP API) +## Web Search (AI SERP API) ```python import webtranspose as webt diff --git a/pyproject.toml b/pyproject.toml index c6e934c..e5e352f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [tool.poetry] name = "webtranspose" -version = "0.3.0" -description = "APIs for the internet" +version = "0.3.1" +description = "Reliable APIs for the website data" authors = ["Mike Gee "] readme = "README.md" diff --git a/src/webtranspose/__init__.py b/src/webtranspose/__init__.py index e4f2fa5..5a9fe5c 100644 --- a/src/webtranspose/__init__.py +++ b/src/webtranspose/__init__.py @@ -2,7 +2,7 @@ __author__ = """Mike Gee""" __email__ = "mike@webtranspose.com" -__version__ = "0.3.0" +__version__ = "0.3.1" from .chat import * from .crawl import * diff --git a/src/webtranspose/search.py b/src/webtranspose/search.py index aea0af9..aa56a10 100644 --- a/src/webtranspose/search.py +++ b/src/webtranspose/search.py @@ -3,8 +3,17 @@ from .webt_api import run_webt_api +def search(query, api_key=None) -> dict: + """ + Search for a query using the Web Transpose API. -def search(query): + Args: + query (str): The query to search for. + api_key (str, optional): The API key to use for authentication. Defaults to None. + + Returns: + dict: The search results. + """ if api_key is None: api_key = os.environ.get("WEBTRANSPOSE_API_KEY") @@ -21,7 +30,17 @@ def search(query): raise ValueError("Must provide api_key or set WEBTRANSPOSE_API_KEY in environment variables.") -def search_filter(query): +def search_filter(query, api_key=None) -> dict: + """ + Search for a query using the Web Transpose API with filtering. + + Args: + query (str): The query to search for. + api_key (str, optional): The API key to use for authentication. Defaults to None. + + Returns: + dict: The filtered search results. + """ if api_key is None: api_key = os.environ.get("WEBTRANSPOSE_API_KEY")