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

# Search

> Search the web with a Perplexity-shaped request.

Send a `query` and the provider as `model` (`tavily`, `linkup`, `firecrawl`,
`deepseek`, `perplexityai`, `zai`; see GET /v3/search/models), optionally
`max_results`. `search_domain_filter` is taken by `tavily`, `linkup` and
`perplexityai`, `country` by `tavily` and `perplexityai`; any other provider
answers either with a 400. Results come back as `{title, url, snippet}` items; `provider`
and `cost` (USD) are Eden AI extensions. With the Perplexity SDK, pass the
provider through `extra_body={"model": "tavily"}`.



## OpenAPI

````yaml https://api.edenai.run/v3/docs/openapi.json post /v3/search
openapi: 3.1.0
info:
  title: Eden AI API V3
  version: 3.0.0
servers:
  - url: https://api.edenai.run
    description: Production server
security: []
paths:
  /v3/search:
    post:
      tags:
        - Search
      summary: Search
      description: >-
        Search the web with a Perplexity-shaped request.


        Send a `query` and the provider as `model` (`tavily`, `linkup`,
        `firecrawl`,

        `deepseek`, `perplexityai`, `zai`; see GET /v3/search/models),
        optionally

        `max_results`. `search_domain_filter` is taken by `tavily`, `linkup` and

        `perplexityai`, `country` by `tavily` and `perplexityai`; any other
        provider

        answers either with a 400. Results come back as `{title, url, snippet}`
        items; `provider`

        and `cost` (USD) are Eden AI extensions. With the Perplexity SDK, pass
        the

        provider through `extra_body={"model": "tavily"}`.
      operationId: search_v3_search_post
      requestBody:
        content:
          application/json:
            schema:
              properties:
                query:
                  type: string
                  minLength: 1
                  title: Query
                  description: The search query. At most 128 characters on `deepseek`.
                model:
                  anyOf:
                    - type: string
                    - type: 'null'
                  title: Model
                  description: >-
                    Search provider, e.g. `tavily`. Optional when the provider
                    is in the path (`POST /v3/search/{provider}`). List the ids
                    with GET /v3/search/models.
                max_results:
                  type: integer
                  maximum: 20
                  minimum: 1
                  title: Max Results
                  description: >-
                    Most results to return (1-20). A provider may return fewer;
                    on `zai` the results are cut to this number after the
                    search.
                  default: 10
                search_domain_filter:
                  anyOf:
                    - items:
                        type: string
                      type: array
                      maxItems: 20
                      minItems: 1
                    - type: 'null'
                  title: Search Domain Filter
                  description: >-
                    Domains to restrict results to, or, with a leading `-`,
                    domains to exclude (`-pinterest.com`). Allow and deny
                    entries cannot be mixed. Up to 20.
                country:
                  anyOf:
                    - type: string
                      pattern: ^[A-Za-z]{2}$
                    - type: 'null'
                  title: Country
                  description: >-
                    ISO 3166-1 alpha-2 country code to bias results toward, e.g.
                    `US`.
              additionalProperties: false
              type: object
              required:
                - query
              title: SearchBody
              description: >-
                Request body for ``POST /v3/search``.


                Perplexity's Search API shape (`query`, `max_results`,
                `search_domain_filter`,

                `country`) plus `model`, the Eden AI provider that runs the
                search. Any other

                field (`search_recency_filter`, `max_tokens_per_page`, `depth`,
                ...) is refused

                with a 422 naming it (`extra="forbid"`): the facade maps only
                these fields onto

                each provider, so an unmapped one is never dropped without an
                error.
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
      security:
        - AuthBearer: []
components:
  schemas:
    SearchResponse:
      properties:
        id:
          type: string
          title: Id
          description: Eden AI request id; quote it when reporting a problem.
        results:
          items:
            $ref: '#/components/schemas/SearchResult'
          type: array
          title: Results
        provider:
          type: string
          title: Provider
          description: 'Eden extension: provider that ran the search.'
        cost:
          type: number
          title: Cost
          description: 'Eden extension: cost in USD.'
      type: object
      required:
        - id
        - results
        - provider
        - cost
      title: SearchResponse
      description: >-
        Search results, in Perplexity's response shape. `provider` and `cost`
        are Eden extensions.
    SearchResult:
      properties:
        title:
          type: string
          title: Title
          description: Page title; empty when the provider returns none.
          default: ''
        url:
          type: string
          title: Url
          description: Result URL.
        snippet:
          type: string
          title: Snippet
          description: Text excerpt of the page.
          default: ''
        date:
          anyOf:
            - type: string
            - type: 'null'
          title: Date
          description: 'Always null: the date a provider may report is not carried through.'
        last_updated:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Updated
          description: 'Always null: the date a provider may report is not carried through.'
      type: object
      required:
        - url
      title: SearchResult
      description: One search result, in Perplexity's result shape.
  securitySchemes:
    AuthBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.