> ## 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-2024-01-01.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. The API is versioned via the `api-version` header. This is
    version `2024-01-01` which uses a camelCase response envelope. Legacy
    clients may pin to this version.
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/TrendingResponse'
        '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:
        - bearerAuth: []
components:
  parameters:
    ApiVersionHeader:
      name: api-version
      in: header
      required: false
      schema:
        type: string
        enum:
          - '2026-08-01'
          - '2024-01-01'
          - '2022-01-01'
      description: API version to consume. Defaults to the latest version (2026-08-01).
  schemas:
    TrendingResponse:
      type: object
      required:
        - parameters
        - articles
      properties:
        parameters:
          type: object
          description: The query parameters used for this request
        articles:
          type: array
          items:
            $ref: '#/components/schemas/Article'
    ErrorResponse:
      type: object
      required:
        - success
        - code
        - message
      properties:
        success:
          type: boolean
          example: false
        code:
          type: number
          description: HTTP status code
        message:
          type: string
        fields:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              type:
                type: string
              description:
                type: string
    Article:
      type: object
      required:
        - title
        - url
        - excerpt
        - thumbnail
        - language
        - paywall
        - content_length
        - 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.
        content_length:
          type: integer
          description: Length of the article content in characters
        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:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Bonai API key, sent as `Authorization: Bearer <key>`. The `api-key`
        and `x-api-key` headers are also accepted.

````

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