From 524170d97a4beae3c42718ef1542453ffdac194a Mon Sep 17 00:00:00 2001 From: cere Date: Tue, 16 Jan 2024 03:14:52 -0500 Subject: [PATCH] add search support (not just suggestions) --- piped_api/client.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/piped_api/client.py b/piped_api/client.py index 3b165b1..c7c3137 100644 --- a/piped_api/client.py +++ b/piped_api/client.py @@ -155,3 +155,16 @@ class PipedClient: kwargs.update({'params': {'query': search_query}}) return self._get_json(f"/suggestions", **kwargs) + + def get_search_results(self, search_query: str, **kwargs) -> t.List[str]: + """ + Obtains search results for a query. + + ### Parameters: + - `search_query` - The query to get search results for + - `**kwargs` - Additional keyword arguments to pass to `requests.Session.get` + """ + + kwargs.update({'params': {'q': search_query, 'filter': 'all'}}) + + return self._get_json(f"/search", **kwargs) \ No newline at end of file