> ## Documentation Index
> Fetch the complete documentation index at: https://old-docs.you.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search (Legacy)

<Note>
  **Before You Get Started**

  Get a free API Key at [you.com/platform](https://you.com/platform)
</Note>

### Search Operators

| Operator | Description                                                                | Example                              |
| -------- | -------------------------------------------------------------------------- | ------------------------------------ |
| site     | Searches for webpages from a particular domain (including subdomains)      | `site:uscourts.gov USA v. Enron`     |
| filetype | Searches for webpages that are of the specified file type                  | `USA v. Enron filetype:pdf`          |
| lang     | Searches for webpages that are in a particular language (ISO 639-1 format) | `Modelo lang:es`                     |
| +        | Searches for webpages that contain the exact term after the `+`            | `Enron +GAAP`                        |
| -        | Searches for webpages that do not contain the exact term after the `-`     | `guitar -prs`                        |
| AND      | Logical operator to combine expressions                                    | `guitar +prs AND +silversky`         |
| OR       | Logical operator to combine expressions                                    | `guitar -prs AND -silversky`         |
| NOT      | Negation of expressions                                                    | `USA v. Enron NOT site:uscourts.gov` |


## OpenAPI

````yaml get /search
openapi: 3.0.0
info:
  title: You.com Search API
  description: Get the best search results from web and news sources
  version: 0.0.1
servers:
  - url: https://ydc-index.io
security:
  - ApiKeyAuth: []
paths:
  /search:
    get:
      summary: Returns a list of search index hits from query
      parameters:
        - name: query
          in: query
          required: true
          description: >-
            Search query used to retrieve relevant results from index. You may
            also include [search operators](#search-operators) to refine your
            search.
          schema:
            type: string
        - name: num_web_results
          in: query
          required: false
          description: >-
            Specifies the maximum number of web results to return. Range `1 ≤
            num_web_results ≤ 100`.
          schema:
            type: integer
        - name: freshness
          in: query
          required: false
          description: >-
            Specifies the freshness of the results to return. Provide either one
            of `day`, `week`, `month`, `year`, or a date range string in the
            format `YYYY-MM-DDtoYYYY-MM-DD`.
          schema:
            type: string
        - name: offset
          in: query
          required: false
          description: >-
            Indicates the `offset` for pagination. The `offset` is calculated in
            multiples of `num_web_results`. For example, if `num_web_results =
            5` and `offset = 1`, results 5–10 will be returned. Range `0 ≤
            offset ≤ 9`.
          schema:
            type: integer
        - name: country
          in: query
          required: false
          description: >-
            Country Code, one of `['AR', 'AU', 'AT', 'BE', 'BR', 'CA', 'CL',
            'DK', 'FI', 'FR', 'DE', 'HK', 'IN', 'ID', 'IT', 'JP', 'KR', 'MY',
            'MX', 'NL', 'NZ', 'NO', 'CN', 'PL', 'PT', 'PH', 'RU', 'SA', 'ZA',
            'ES', 'SE', 'CH', 'TW', 'TR', 'GB', 'US']`.
          schema:
            type: string
        - name: safesearch
          in: query
          required: false
          description: >-
            Configures the safesearch filter for content moderation. `off` -  no
            filtering applied.`moderate` - moderate content filtering (default).
            `strict` - strict content filtering.
          schema:
            type: string
      responses:
        '200':
          description: A JSON object containing search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  hits:
                    type: array
                    items:
                      properties:
                        url:
                          type: string
                          description: The URL of the specific search result.
                          example: https://you.com
                        title:
                          type: string
                          description: The title or name of the search result.
                          example: The World's Greatest Search Engine!
                        description:
                          type: string
                          description: >-
                            A brief description of the content of the search
                            result.
                          example: Search on YDC
                        favicon_url:
                          type: string
                          description: >-
                            The URL of the favicon of the search result's
                            domain.
                          example: https://someurl.com/favicon
                        thumbnail_url:
                          type: string
                          description: URL of the thumbnail.
                          example: https://www.somethumbnailsite.com/thumbnail.jpg
                        snippets:
                          type: array
                          description: >-
                            An array of text snippets from the search result,
                            providing a preview of the content.
                          items:
                            type: string
                            example: >-
                              I'm an AI assistant that helps you get more done.
                              What can I help you with?
                  latency:
                    type: number
                    description: >-
                      Indicates the time (in seconds) taken by the API to
                      generate the response.
                    example: 1
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        The unique API Key required to authorize API access. Learn how to get
        yours in the [“Get your API key” section of the
        documentation](/get-started/quickstart#get-your-api-key).

````