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

# /substack/posts/comments

> Get comments of a Substack post by publication (subdomain or custom domain) and numeric post id. Returns the threaded comment tree: each comment has id, text, author, created_at, depth, parent_id, reaction_count and reactions, restack_count, reply_count, and nested replies.

**Price:** 10 credits

**⚠️ Common errors:** 412: Post not found, or the publication is not a valid Substack publication



## OpenAPI

````yaml /openapi/news-publishing.json post /api/substack/posts/comments
openapi: 3.1.0
info:
  title: Any Site API
  description: >+
    Any Site API provides programmatic access to data from LinkedIn, Instagram,
    Twitter, and other platforms.


    ## Authentication


    All API endpoints require an `access-token` header with a valid API token.
    Tokens can be created in the [dashboard](https://app.anysite.io/).


    ## Pricing


    Each endpoint has a credit cost listed in its description. Credits are
    deducted from your token balance per request.

  version: 0.0.1
servers: []
security:
  - AccessToken: []
paths:
  /api/substack/posts/comments:
    post:
      tags:
        - /substack
      summary: /substack/posts/comments
      description: >-
        Get comments of a Substack post by publication (subdomain or custom
        domain) and numeric post id. Returns the threaded comment tree: each
        comment has id, text, author, created_at, depth, parent_id,
        reaction_count and reactions, restack_count, reply_count, and nested
        replies.


        **Price:** 10 credits


        **⚠️ Common errors:** 412: Post not found, or the publication is not a
        valid Substack publication
      operationId: __api_substack_posts_comments_post
      parameters:
        - name: access-token
          in: header
          required: true
          schema:
            anyOf:
              - type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubstackPostCommentsPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SubstackComment'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SubstackPostCommentsPayload:
      properties:
        timeout:
          type: integer
          maximum: 1500
          minimum: 20
          default: 300
        publication:
          type: string
          minLength: 1
        post_id:
          type: integer
          exclusiveMinimum: 0
        count:
          type: integer
          minimum: 1
      type: object
      required:
        - publication
        - post_id
        - count
    SubstackComment:
      properties:
        '@type':
          type: string
          default: SubstackComment
        id:
          type: integer
        text:
          anyOf:
            - type: string
            - type: 'null'
        author:
          anyOf:
            - $ref: '#/components/schemas/SubstackCommentAuthor'
            - type: 'null'
        created_at:
          anyOf:
            - type: string
            - type: 'null'
        edited_at:
          anyOf:
            - type: string
            - type: 'null'
        depth:
          type: integer
          default: 0
        parent_id:
          anyOf:
            - type: integer
            - type: 'null'
        reaction_count:
          anyOf:
            - type: integer
            - type: 'null'
        reactions:
          additionalProperties:
            type: integer
          type: object
          default: {}
        restack_count:
          anyOf:
            - type: integer
            - type: 'null'
        is_pinned:
          type: boolean
          default: false
        is_deleted:
          type: boolean
          default: false
        reply_count:
          type: integer
          default: 0
        replies:
          items:
            $ref: '#/components/schemas/SubstackComment'
          type: array
          default: []
      type: object
      required:
        - id
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    SubstackCommentAuthor:
      properties:
        '@type':
          type: string
          default: SubstackCommentAuthor
        id:
          anyOf:
            - type: integer
            - type: 'null'
        name:
          anyOf:
            - type: string
            - type: 'null'
        handle:
          anyOf:
            - type: string
            - type: 'null'
        image:
          anyOf:
            - type: string
            - type: 'null'
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
        input: {}
        ctx:
          type: object
      type: object
      required:
        - loc
        - msg
        - type
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: access-token
      description: API token from the dashboard

````