# YouSearchAPIWrapper

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/utilities/you/YouSearchAPIWrapper)

Wrapper for you.com Search and News API.

To connect to the You.com api requires an API key which
you can get at https://api.you.com.
You can check out the docs at https://documentation.you.com/api-reference/.

You need to set the environment variable `YDC_API_KEY` for retriever to operate.

Attributes
----------
ydc_api_key: str, optional
    you.com api key, if YDC_API_KEY is not set in the environment
endpoint_type: str, optional
    you.com endpoints: search, news, rag;
    `web` and `snippet` alias `search`
    `rag` returns `{'message': 'Forbidden'}`
    @todo `news` endpoint
num_web_results: int, optional
    The max number of web results to return, must be under 20.
    This is mapped to the `count` query parameter for the News API.
safesearch: str, optional
    Safesearch settings, one of off, moderate, strict, defaults to moderate
country: str, optional
    Country code, ex: 'US' for United States, see api docs for list
search_lang: str, optional
    (News API) Language codes, ex: 'en' for English, see api docs for list
ui_lang: str, optional
    (News API) User interface language for the response, ex: 'en' for English,
               see api docs for list
spellcheck: bool, optional
    (News API) Whether to spell check query or not, defaults to True
k: int, optional
    max number of Documents to return using `results()`
n_hits: int, optional, deprecated
    Alias for num_web_results
n_snippets_per_hit: int, optional
    limit the number of snippets returned per hit

## Signature

```python
YouSearchAPIWrapper()
```

## Extends

- `BaseModel`

## Properties

- `ydc_api_key`
- `endpoint_type`
- `num_web_results`
- `safesearch`
- `country`
- `search_lang`
- `ui_lang`
- `spellcheck`
- `k`
- `n_snippets_per_hit`
- `n_hits`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/utilities/you/YouSearchAPIWrapper/validate_environment)
- [`warn_if_set_fields_have_no_effect()`](https://reference.langchain.com/python/langchain-community/utilities/you/YouSearchAPIWrapper/warn_if_set_fields_have_no_effect)
- [`warn_if_deprecated_endpoints_are_used()`](https://reference.langchain.com/python/langchain-community/utilities/you/YouSearchAPIWrapper/warn_if_deprecated_endpoints_are_used)
- [`raw_results()`](https://reference.langchain.com/python/langchain-community/utilities/you/YouSearchAPIWrapper/raw_results)
- [`results()`](https://reference.langchain.com/python/langchain-community/utilities/you/YouSearchAPIWrapper/results)
- [`raw_results_async()`](https://reference.langchain.com/python/langchain-community/utilities/you/YouSearchAPIWrapper/raw_results_async)
- [`results_async()`](https://reference.langchain.com/python/langchain-community/utilities/you/YouSearchAPIWrapper/results_async)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/utilities/you.py#L50)