> ## 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 news

> Find news coverage of a topic.

Find coverage of a topic, then use [Fetch a web page](https://docs.sanfoundation.com/api-reference/web-fetch.md) to read a story before summarizing it.

Publication labels can be relative, such as `2 hours ago`. Preserve source links and do not assume every date is a timestamp. Follow `next_page` until it is `null`.


## OpenAPI

````yaml https://api.sanfoundation.com/openapi.json GET /v1/news/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/news/search:
    get:
      tags:
        - news
      summary: Search news stories
      description: >-
        Recent stories for a query, newest and most relevant first, with the
        publisher and how long ago each was published.
      operationId: NewsController_search
      parameters:
        - name: page
          required: false
          in: query
          description: 1 based, up to 5.
          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: coffee prices
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewsSearchResponseDto'
        '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:
    NewsSearchResponseDto:
      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/NewsResultDto'
      required:
        - id
        - took_ms
        - request
        - next_page
        - results
    PublicErrorDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/PublicErrorBodyDto'
      required:
        - error
    NewsResultDto:
      type: object
      properties:
        position:
          type: number
          example: 1
        title:
          type: string
          example: Coffee prices hit a ten year high
        link:
          type: string
          example: https://example.com/story
          description: Destination URL; absent when the destination could not be resolved.
        source:
          type: string
          example: Reuters
          description: Publisher.
        date:
          type: string
          example: 2 hours ago
          description: As shown on the story card.
        snippet:
          type: string
        thumbnail:
          type: string
          description: Card image, when one is shown.
      required:
        - position
        - title
    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.