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

# Trending posts

> Returns posts ranked by trending analytics.

<Warning>Requires the Publive analytics engine to be active on the site — returns an empty list if analytics tracking isn't implemented.</Warning>
<Info>Trending ranking refreshes every 5 minutes, plus up to another 5 minutes of CDN caching (up to 10 minutes of lag).</Info>



## OpenAPI

````yaml /openapi/content-delivery.json get /publisher/{publisher_id}/posts/analytics/trending/
openapi: 3.1.0
info:
  title: Publive Content Delivery API
  version: 1.0.0
  description: >-
    Read-only API for delivering publisher content, configuration, and static
    assets. All endpoints require HTTP Basic Auth and are GET requests.
servers:
  - url: https://cds.thepublive.com
security:
  - basicAuth: []
tags:
  - name: Site Configuration
  - name: Content
  - name: Posts
  - name: Forms
  - name: Static Files
  - name: Sitemaps
paths:
  /publisher/{publisher_id}/posts/analytics/trending/:
    get:
      tags:
        - Posts
      summary: Trending posts
      description: >-
        Returns posts ranked by trending analytics.


        <Warning>Requires the Publive analytics engine to be active on the site
        — returns an empty list if analytics tracking isn't
        implemented.</Warning>

        <Info>Trending ranking refreshes every 5 minutes, plus up to another 5
        minutes of CDN caching (up to 10 minutes of lag).</Info>
      operationId: getTrendingPosts
      parameters:
        - $ref: '#/components/parameters/PublisherId'
        - name: duration
          in: query
          required: false
          schema:
            type: string
            enum:
              - 24h
              - 7d
              - 30d
            default: 24h
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 50
        - $ref: '#/components/parameters/Page'
        - name: type
          in: query
          required: false
          schema:
            type: string
            enum:
              - Article
              - Video
              - Web Story
              - Gallery
              - LiveBlog
              - CustomPage
              - CustomEntity
              - Newsletter
          description: Filters to a single post type. Omit to include all types.
      responses:
        '200':
          description: Trending posts
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  message:
                    type: string
                  page_no:
                    type: integer
                  per_page:
                    type: integer
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PostSummary'
        '400':
          description: Invalid `duration` value
          content:
            application/json:
              example:
                duration:
                  - '"invalid" is not a valid choice.'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  parameters:
    PublisherId:
      name: publisher_id
      in: path
      required: true
      schema:
        type: string
      description: Your Publisher ID
    Page:
      name: page
      in: query
      required: false
      schema:
        type: integer
        default: 1
        maximum: 1000
      description: Page number
  schemas:
    PostSummary:
      type: object
      properties:
        id:
          type: integer
        title:
          type: string
        slug:
          type: string
        type:
          type: string
          enum:
            - Article
            - Video
            - Web Story
            - Gallery
            - LiveBlog
            - CustomPage
            - BlankPage
        banner_url:
          type: string
        short_description:
          type: string
        summary:
          type: string
        primary_category:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            slug:
              type: string
        categories:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              slug:
                type: string
        tags:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              slug:
                type: string
        contributors:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              name:
                type: string
              slug:
                type: string
        content_html:
          type: string
        meta_data:
          type: object
          properties:
            access_type:
              type: string
        media_file_banner:
          type: object
          properties:
            id:
              type: integer
            filename:
              type: string
            path:
              type: string
            alt_text:
              type: string
            meta_data:
              type: object
              properties:
                width:
                  type: integer
                height:
                  type: integer
        word_count:
          type: integer
        access_type:
          type: string
        hide_banner_image:
          type: boolean
        banner_description:
          type: string
        language_code:
          type: string
        custom_entity:
          type: object
        absolute_url:
          type: string
        formatted_first_published_at_datetime:
          type: string
        formatted_last_published_at_datetime:
          type: string
    ErrorDetail:
      type: object
      properties:
        detail:
          type: string
  responses:
    Unauthorized:
      description: Invalid or missing credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorDetail'
          example:
            detail: Invalid Auth Credentials
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic Auth using your Publive API key pair, base64-encoded.

````