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

# Search the web

> Find ranked web results for a query.

Find sources, then pass a result's `link` to [Fetch a web page](https://docs.sanfoundation.com/api-reference/web-fetch.md) to read its content.

Follow `next_page` with the same query and country until it is `null`. Optional answer and knowledge-panel blocks appear only when available.


## OpenAPI

````yaml https://api.sanfoundation.com/openapi.json GET /v1/web/search
openapi: 3.0.0
info:
  title: SAN API
  description: >-
    Web data and context for agents, served by a network of miners running real
    browsers on residential connections. One resource per thing an agent asks
    for: search the web, read the news, find places, hotels and flights, and
    quote a symbol. Present an API key as `Authorization: Bearer san_...`. Every
    response is snake_case JSON and every error is `{ error: { code, message,
    param } }`.
  version: 0.0.1
  contact: {}
servers: []
security: []
tags:
  - name: web
    description: Web search
  - name: news
    description: News search
  - name: places
    description: Places search
  - name: hotels
    description: Stays search
  - name: flights
    description: Flight search
  - name: finance
    description: Quotes and charts
  - name: shopping
    description: Products and sellers
  - name: account
    description: Plan and remaining budget
paths:
  /v1/web/search:
    get:
      tags:
        - web
      summary: Search the web
      description: >-
        Ranked web results for a query, plus the panels the results page
        carries: a knowledge panel, a direct answer and nearby places. Fetched
        by a miner on a residential connection.
      operationId: WebController_search
      parameters:
        - name: page
          required: false
          in: query
          description: 1 based, up to 5. Use `next_page` from the response.
          schema:
            type: number
            example: 1
        - name: country
          required: false
          in: query
          description: ISO 3166-1 alpha-2. Defaults to `us`.
          schema:
            type: string
            example: us
        - name: query
          required: true
          in: query
          schema:
            example: best pour over kettle
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebSearchResponseDto'
        '400':
          description: A parameter is missing, invalid or not recognized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorDto'
        '401':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorDto'
        '429':
          description: Monthly quota exhausted. Hard stop, no overage.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorDto'
        '503':
          description: No miner and no fallback could serve the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorDto'
      security:
        - api_key: []
        - x-api-key: []
components:
  schemas:
    WebSearchResponseDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Id of this request. Quote it when reporting a problem.
        took_ms:
          type: number
          example: 1420
          description: How long the request took, in milliseconds.
        request:
          type: object
          additionalProperties: true
          description: >-
            The parameters as accepted, after defaults and normalization. What
            the request actually ran with.
          example:
            query: coffee
            country: us
            page: 1
        next_page:
          type: number
          nullable: true
          example: 2
          description: >-
            The next page to ask for, or null when there is no further page.
            Never a page this endpoint would reject.
        results:
          type: array
          items:
            $ref: '#/components/schemas/WebResultDto'
        knowledge_panel:
          type: object
          additionalProperties: true
          description: >-
            The entity panel for the query, when one is shown. Beside `title`,
            `type`, `description` and `source`, every fact is its own top-level
            string key with a normalized name (`date_of_birth`, `origin`).
          example:
            title: Coffee
            type: Drink
            description: Coffee is a beverage brewed from roasted coffee beans.
            source:
              name: Wikipedia
              link: https://en.wikipedia.org/wiki/Coffee
            origin: Ethiopia
        answer:
          $ref: '#/components/schemas/AnswerDto'
        local_places:
          description: >-
            Nearby businesses shown for a local query. Use the places resource
            for a full list.
          type: array
          items:
            $ref: '#/components/schemas/LocalPlaceDto'
      required:
        - id
        - took_ms
        - request
        - next_page
        - results
    PublicErrorDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/PublicErrorBodyDto'
      required:
        - error
    WebResultDto:
      type: object
      properties:
        position:
          type: number
          example: 1
          description: Rank within this page, 1 based.
        title:
          type: string
          example: How to brew better coffee
        link:
          type: string
          example: https://example.com/brewing-guide
          description: Destination URL; absent when the destination could not be resolved.
        displayed_link:
          type: string
          example: example.com
          description: The host as shown to a reader.
        snippet:
          type: string
          example: A short extract from the page.
        date:
          type: string
          example: 3 Sep 2026
          description: Publication date, when one is shown.
      required:
        - position
        - title
    AnswerDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - calculator
            - weather
            - dictionary
            - translation
            - unit_converter
            - currency
            - snippet
            - finance
          example: snippet
          description: What kind of answer this is. Absent when it is unclear.
        title:
          type: string
          example: Coffee
        result:
          type: string
          example: 3 minutes
          description: The short direct answer, when there is one.
        snippet:
          type: string
          example: Longer supporting text.
        link:
          type: string
          example: https://example.com/coffee
    LocalPlaceDto:
      type: object
      properties:
        position:
          type: number
          example: 1
        name:
          type: string
          example: Radio Coffee and Beer
        type:
          type: string
          example: Coffee shop
        address:
          type: string
          example: 3504 Manchaca Rd
        rating:
          type: number
          example: 4.6
        reviews:
          type: number
          example: 1198
      required:
        - position
        - name
    PublicErrorBodyDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - unauthorized
            - missing_parameter
            - invalid_parameter
            - not_found
            - quota_exceeded
            - rate_limited
            - unavailable
            - expired
            - internal_error
          example: missing_parameter
        message:
          type: string
          example: Missing parameter `query`.
        param:
          type: string
          example: query
          description: The parameter at fault, when one parameter is at fault.
      required:
        - code
        - message
  securitySchemes:
    api_key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: 'Public API key: `Authorization: Bearer san_...`.'
    x-api-key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: The same public API key, as a header.

````

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