you
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AsyncYouClient searchly.providers.you_provider.you Async client for You.com API. |
🛈 DocStrings¶
You.com API client implementing search protocols.
AsyncYouClient
¶
Bases: HttpSessionMixin, WebSearchProvider, NewsSearchProvider
Async client for You.com API.
Source code in src/searchly/providers/you_provider/you.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
__init__
¶
Initialize You.com client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_key
|
str | None
|
You.com API key. Defaults to YOU_API_KEY env var. |
None
|
base_url
|
str
|
Base URL for the API. |
'https://api.ydc-index.io'
|
Source code in src/searchly/providers/you_provider/you.py
news_search
async
¶
news_search(
query: str,
*,
max_results: int = 10,
country: CountryCode | None = None,
language: LanguageCode | None = None,
**kwargs: Any,
) -> NewsSearchResponse
Execute a news 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 (news endpoint does not support country filtering). |
None
|
language
|
LanguageCode | None
|
Ignored (news endpoint does not support language filtering). |
None
|
**kwargs
|
Any
|
Additional You.com-specific options. |
{}
|
Returns:
| Type | Description |
|---|---|
NewsSearchResponse
|
Unified news search response. |
Source code in src/searchly/providers/you_provider/you.py
web_search
async
¶
web_search(
query: str,
*,
max_results: int = 10,
country: CountryCode | None = None,
language: LanguageCode | None = None,
safesearch: SafeSearchLevel = "moderate",
freshness: FreshnessFilter | 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
|
Country code for regional results (uppercase). |
None
|
language
|
LanguageCode | None
|
Language code for results (converted to uppercase). |
None
|
safesearch
|
SafeSearchLevel
|
Content moderation level. |
'moderate'
|
freshness
|
FreshnessFilter | str | None
|
Filter by recency ("day", "week", "month", "year"). |
None
|
**kwargs
|
Any
|
Additional You.com-specific options. |
{}
|
Returns:
| Type | Description |
|---|---|
WebSearchResponse
|
Unified web search response. |
Source code in src/searchly/providers/you_provider/you.py
example
async
¶
Example usage of AsyncYouClient.