Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/0.3.1/fix reference issue #25

Merged
merged 3 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]

readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/webtranspose/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """Mike Gee"""
__email__ = "[email protected]"
__version__ = "0.3.0"
__version__ = "0.3.1"

from .chat import *
from .crawl import *
Expand Down
23 changes: 21 additions & 2 deletions src/webtranspose/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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")

Expand Down
Loading