AsyncSearch1API
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| HttpSessionMixin searchly.http Gives a provider one `anyenv.HttpSession`, opened on first use. |
||
| WebSearchProvider searchly.base Protocol for web search providers. |
â‹” Inheritance diagram¶
graph TD
56640480["client.AsyncSearch1API"]
1226828128["http.HttpSessionMixin"]
2751680898["builtins.object"]
4037333726["base.WebSearchProvider"]
1073422405["typing.Protocol"]
3481597255["typing.Generic"]
1226828128 --> 56640480
2751680898 --> 1226828128
4037333726 --> 56640480
1073422405 --> 4037333726
3481597255 --> 1073422405
2751680898 --> 3481597255
🛈 DocStrings¶
Bases: HttpSessionMixin, WebSearchProvider
Async client for Search1API.
Note: Search1API does not support country filtering. The country parameter is accepted for protocol compatibility but is ignored.
Source code in src/searchly/providers/search1_provider/client.py
__init__
¶
Initialize Search1API client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_key
|
str | None
|
API key for Search1API. Defaults to SEARCH1API_KEY env var. |
None
|
base_url
|
str
|
Base URL for the API. |
'https://api.search1api.com'
|
Source code in src/searchly/providers/search1_provider/client.py
web_search
async
¶
web_search(
query: str,
*,
max_results: int = 10,
country: CountryCode | None = None,
language: LanguageCode | None = None,
search_service: SearchService = "google",
time_range: TimeRange | None = None,
include_sites: list[str] | None = None,
exclude_sites: list[str] | None = None,
**kwargs: Any,
) -> WebSearchResponse
Execute a web search query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Search query string. |
required |
max_results
|
int
|
Maximum number of results to return. |
10
|
country
|
CountryCode | None
|
Ignored (Search1API does not support country filtering). |
None
|
language
|
LanguageCode | None
|
Language code for results. |
None
|
search_service
|
SearchService
|
Search engine to use ("google" or "bing"). |
'google'
|
time_range
|
TimeRange | None
|
Time range filter ("day", "week", "month", "year"). |
None
|
include_sites
|
list[str] | None
|
List of sites to include in search. |
None
|
exclude_sites
|
list[str] | None
|
List of sites to exclude from search. |
None
|
**kwargs
|
Any
|
Additional Search1API-specific options. |
{}
|
Returns:
| Type | Description |
|---|---|
WebSearchResponse
|
Unified web search response. |