> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.docs.siftsy.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.siftsy.com/_mcp/server.

# Sample comments behind a post analysis

GET https://api.siftsy.app/analyst/v1/posts/{postId}/analysis/comments

Requires `comments:read` and `posts:read`. A **sample of comments
behind** `GET /posts/{postId}/analysis` — the evidence for the mix
bars, content topics, and messages. Hidden comments are excluded.

Siftsy is an analysis platform, not a comment exporter. Do not use
this route to dump a full comment section. Prefer `source=notables`
(engagement + relevance), `content` (grouped onto creator
topics/messages), or `all` (union). Sampled rows include
`sampleReasons`. `meta.groups` always lists content topic and
message membership.

Narrow the sample with mix-bar buckets (`sentiment`, `content`,
`topic`, `relevance`, `consensus`). Repeat a parameter or
comma-separate to OR values within a dimension; different
dimensions combine with AND.

Rate class `comments` (120 / minute, 1,000 / day per key) — enough
to sample every post in a 500-post workspace once a day.

Reference: https://api.docs.siftsy.com/api-reference/siftsy-analyst-api/list-analysis-comments

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.
- `X-Api-Key` header (required) — API Key authentication via header

## Servers

- `https://api.siftsy.app/analyst/v1` (Production, default)
- `http://localhost:3000/analyst/v1` (Local development)

## Request

### Path parameters

- `postId` (string, required)

### Query parameters

- `cursor` (string, optional)
- `limit` (integer, optional, default: 25)
- `source` (enum, optional) — How to sample comments behind this analysis. Prefer `notables` (engagement + relevance), `content` (grouped onto creator topics/messages), or `all` (union). This is evidence, not a full-thread export.
  - Allowed values: `all`, `notables`, `content`
- `sentiment` (string, optional) — Only comments whose overall sentiment falls in these mix-bar buckets. Comma-separate or repeat to match several (`positive,lean_positive`). Values: `positive`, `lean_positive`, `neutral`, `lean_negative`, `negative`. Score version 3 uses a five-bucket split (neutral is 4.5–5.5); v1/v2 have no unused middle band.
- `content` (string, optional) — Only comments whose content sentiment (alignment with the post / creator) falls in these buckets. Same keys as `sentiment`. Score version 2+ comments; unscored comments are excluded.
- `topic` (string, optional) — Only comments whose topic sentiment (reception of the subject) falls in these buckets. Same keys as `sentiment`.
- `relevance` (string, optional) — Only comments in these relevance mix-bar buckets. Canonical keys match metrics (`positive`, `lean_positive`, `neutral`, `lean_negative`, `negative`). Dashboard labels also work: `on_topic`, `relevant`, `general`, `off_topic`.
- `consensus` (string, optional) — Only comments in these consensus mix-bar buckets. Canonical keys match metrics. Dashboard labels also work: `agreeing`, `discussing`, `debating`, `fighting`. Consensus is how the commenter is reacting to other commenters, not to the post.

## Response

### 200

Sample of comments behind this analysis

- `data` (list of Comment, optional)
- `meta` (EnvelopeCommentsMeta, optional)

## Errors

### 400 Bad Request Error

Invalid request

- `any`

### 404 Not Found Error

Resource not found

- `any`

## Types

### Comment

- `id` (string, optional, nullable)
- `postId` (string, optional, nullable)
- `text` (string, optional, nullable)
- `username` (string, optional, nullable)
- `timestamp` (string, optional, nullable)
- `replyTo` (string, optional, nullable)
- `engagement` (CommentEngagement, optional)
- `scores` (CommentScores, optional) — Per-comment scores on the 1–10 scale. `content` and `topic` are populated for score version 2+ comments.
- `buckets` (CommentBuckets, optional) — Mix-bar bucket for each score, using the same keys as `GET /posts/{postId}/metrics`. Null when that score is missing.
- `sampleReasons` (list of enum, optional) — Why this comment was included when `source` is set (`notable`, `content`).
  - Allowed values: `notable`, `content`

### EnvelopeCommentsMeta

### CommentEngagement

- `likes` (double, optional, nullable)
- `replies` (double, optional, nullable)

### CommentScores

Per-comment scores on the 1–10 scale. `content` and `topic` are populated for score version 2+ comments.

- `sentiment` (double, optional, nullable)
- `content` (double, optional, nullable)
- `topic` (double, optional, nullable)
- `relevance` (double, optional, nullable)
- `consensus` (double, optional, nullable)
- `confidence` (double, optional, nullable)

### CommentBuckets

Mix-bar bucket for each score, using the same keys as `GET /posts/{postId}/metrics`. Null when that score is missing.

- `sentiment` (enum, optional, nullable)
  - Allowed values: `positive`, `lean_positive`, `neutral`, `lean_negative`, `negative`
- `content` (enum, optional, nullable)
  - Allowed values: `positive`, `lean_positive`, `neutral`, `lean_negative`, `negative`
- `topic` (enum, optional, nullable)
  - Allowed values: `positive`, `lean_positive`, `neutral`, `lean_negative`, `negative`
- `relevance` (enum, optional, nullable)
  - Allowed values: `positive`, `lean_positive`, `neutral`, `lean_negative`, `negative`
- `consensus` (enum, optional, nullable)
  - Allowed values: `positive`, `lean_positive`, `neutral`, `lean_negative`, `negative`

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "string",
      "postId": "string",
      "text": "string",
      "username": "string",
      "timestamp": "string",
      "replyTo": "string",
      "engagement": {
        "likes": 1.1,
        "replies": 1.1
      },
      "scores": {
        "sentiment": 1.1,
        "content": 1.1,
        "topic": 1.1,
        "relevance": 1.1,
        "consensus": 1.1,
        "confidence": 1.1
      },
      "buckets": {
        "sentiment": "positive",
        "content": "positive",
        "topic": "positive",
        "relevance": "positive",
        "consensus": "positive"
      },
      "sampleReasons": [
        "notable"
      ]
    }
  ],
  "meta": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.siftsy.app/analyst/v1/posts/postId/analysis/comments"

querystring = {"sentiment":"positive","content":"positive","topic":"negative","relevance":"on_topic","consensus":"fighting"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.siftsy.app/analyst/v1/posts/postId/analysis/comments?sentiment=positive&content=positive&topic=negative&relevance=on_topic&consensus=fighting';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.siftsy.app/analyst/v1/posts/postId/analysis/comments?sentiment=positive&content=positive&topic=negative&relevance=on_topic&consensus=fighting"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.siftsy.app/analyst/v1/posts/postId/analysis/comments?sentiment=positive&content=positive&topic=negative&relevance=on_topic&consensus=fighting")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.siftsy.app/analyst/v1/posts/postId/analysis/comments?sentiment=positive&content=positive&topic=negative&relevance=on_topic&consensus=fighting")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.siftsy.app/analyst/v1/posts/postId/analysis/comments?sentiment=positive&content=positive&topic=negative&relevance=on_topic&consensus=fighting', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.siftsy.app/analyst/v1/posts/postId/analysis/comments?sentiment=positive&content=positive&topic=negative&relevance=on_topic&consensus=fighting");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.siftsy.app/analyst/v1/posts/postId/analysis/comments?sentiment=positive&content=positive&topic=negative&relevance=on_topic&consensus=fighting")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```