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

# Trending articles

> Retrieve trending articles for a specific topic, language, and optionally country



## OpenAPI

````yaml /openapi/bonai-news-api.json get /trendings
openapi: 3.0.3
info:
  title: Bonai News API
  version: '2024-01-01'
  description: >-
    A comprehensive news aggregation and search API providing access to
    articles, publishers, and trending topics across multiple languages and
    countries.
servers:
  - url: https://api.bonai.io/news
    description: Production
security: []
paths:
  /trendings:
    get:
      summary: Trending articles
      description: >-
        Retrieve trending articles for a specific topic, language, and
        optionally country
      operationId: getTrendingArticles
      parameters:
        - name: date
          in: query
          description: Date for trending articles (defaults to current)
          schema:
            type: string
        - name: topic
          in: query
          required: true
          description: Topic to get trends for
          schema:
            type: string
            minLength: 1
        - name: language
          in: query
          required: true
          description: Language code
          schema:
            type: string
            minLength: 1
        - name: country
          in: query
          description: Country code
          schema:
            type: string
        - name: limit
          in: query
          description: Number of results per page
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 25
        - name: page
          in: query
          description: Page number
          schema:
            type: integer
            minimum: 1
            default: 1
        - $ref: '#/components/parameters/ApiVersionHeader'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTrendingTopicResponse'
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKey: []
components:
  parameters:
    ApiVersionHeader:
      name: api-version
      in: header
      required: false
      schema:
        type: string
        enum:
          - '2024-01-01'
      description: API version to consume. Defaults to the latest version (2024-01-01).
  schemas:
    GetTrendingTopicResponse:
      type: object
      required:
        - success
        - size
        - totalHits
        - hitsPerPage
        - page
        - totalPages
        - timeMs
        - data
      properties:
        success:
          type: boolean
          enum:
            - true
        size:
          type: integer
          description: Number of items in the current page
        totalHits:
          type: integer
          description: Total number of matching items
        hitsPerPage:
          type: integer
          description: Maximum items per page applied for this request
        page:
          type: integer
          description: Current page number
        totalPages:
          type: integer
          description: Total number of pages
        timeMs:
          type: number
          description: Query execution time in milliseconds
        data:
          type: array
          items:
            $ref: '#/components/schemas/Article'
    ErrorResponse:
      type: object
      required:
        - success
        - code
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
        code:
          type: integer
          description: HTTP status code
        message:
          type: string
        fields:
          type: array
          description: Validation details. Empty for non-validation errors.
          items:
            type: object
            required:
              - name
              - type
              - description
            properties:
              name:
                type: string
              type:
                type: string
                description: body, params, query, or headers
              description:
                type: string
    Article:
      type: object
      required:
        - title
        - url
        - excerpt
        - thumbnail
        - language
        - paywall
        - contentLength
        - date
        - authors
        - keywords
        - publisher
      properties:
        title:
          type: string
        url:
          type: string
          format: uri
        excerpt:
          type: string
        thumbnail:
          type: string
          format: uri
          nullable: true
        language:
          type: string
          description: Language code, for example en
        paywall:
          type: boolean
        content:
          type: string
          description: >-
            Full article content. Only returned by GET /article when your plan
            includes it.
        contentLength:
          type: integer
        date:
          type: string
          format: date-time
          description: Publish date (ISO 8601)
        authors:
          type: array
          items:
            type: string
        keywords:
          type: array
          items:
            type: string
        publisher:
          $ref: '#/components/schemas/ArticlePublisher'
    ArticlePublisher:
      type: object
      required:
        - name
        - url
        - favicon
      properties:
        name:
          type: string
          description: Publisher name. May be empty when the publisher is not recognized.
        url:
          type: string
          description: Publisher origin (scheme and host).
        favicon:
          type: string
          description: Publisher favicon, or a {origin}/favicon.ico fallback.
  securitySchemes:
    apiKey:
      type: apiKey
      name: api-key
      in: header
      description: >-
        Your Bonai API key. Create one in the Bonai console
        (https://console.bonai.io).

````