Topic Tree

Get the topic tree for a keyword search to visualize conversation branches.

GET /api/iq/keyword_search/{search_id}/topic_tree

Parameters

search_idSearch ID
platformOptional — "twitter" (default) | "bluesky" | "youtube"

Request Example

curl -X GET "https://rolli.ai/api/iq/keyword_search/7232/topic_tree?platform=twitter" \
  -H "X-ROLLI-TOKEN: your_token" \
  -H "X-ROLLI-USER-ID: your_user_id" \
  -H "Content-Type: application/json"
    
fetch("https://rolli.ai/api/iq/keyword_search/7232/topic_tree?platform=twitter", {
  method: "GET",
  headers: {
    "X-ROLLI-TOKEN": "your_token",
    "X-ROLLI-USER-ID": "your_user_id",
    "Content-Type": "application/json"
  },
})
  .then(res => res.json())
  .then(console.log);
    
require "net/http"
require "uri"
require "json"

uri = URI("https://rolli.ai/api/iq/keyword_search/7232/topic_tree?platform=twitter")
req = Net::HTTP::Get.new(uri)
req["X-ROLLI-TOKEN"] = "your_token"
req["X-ROLLI-USER-ID"] = "your_user_id"
req["Content-Type"] = "application/json"

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(req)
end

puts res.body
    
import requests
import json

url = "https://rolli.ai/api/iq/keyword_search/7232/topic_tree?platform=twitter"
headers = {
    "X-ROLLI-TOKEN": "your_token",
    "X-ROLLI-USER-ID": "your_user_id",
    "Content-Type": "application/json"
}response = requests.get(url, headers=headers)

print(response.json())
    

Response Fields

Field NameDescription
dataArray of topic trees

Node types

Root Node Structure

Field NameDescription
platformPlatform identifier (e.g., "twitter", "bluesky", "youtube")
id_hash256Internal analysis hash ID
created_atTopic tree creation date
nameNode name or description
childrenArray of children nodes

Non-Leaf Node Structure

Field NameDescription
nameNode name or description
childrenArray of children nodes

Pre-Leaf Node Structure

Field NameDescription
nameNode name or description
valueBranch weight (number of posts aggregated under this node)
created_atArray of children post creation dates
post_urlArray of children post URLs
childrenArray of children nodes (the individual post leaf nodes)
summarySummary describing the main theme of this branch
sentimentSentiment classification of the posts (“positive”, “negative”, “mixed”)

Leaf Node Structure

Field NameDescription
namePost text (truncated in some cases)
urlPost URL
usernamePost author's username
profile_urlPost author's profile image URL
user_descriptionPost author's profile description
created_atPost creation timestamp

Response Example

{
  "data": [
    {
      "platform": "twitter",
      "id_hash256": "a756fdc4e8b2c3f4e5d6a7b8c9d0e1f2a3b4c",
      "created_at": "2026-01-05 12:00:00",
      "name": ".",
      "children": [
        {
          "name": "General Lifestyle Topics",
          "children": [
            {
              "name": "Daily Routines",
              "value": 3,
              "created_at": [
                "2026-01-01 08:15:00",
                ...
              ],
              "post_url": [
                "https://example.com/post/1",
                ...
              ],
              "children": [
                {
                  "name": "Starting the day with a quiet morning routine and a warm drink.",
                  "url": "https://example.com/post/1",
                  "username": "user_example_1",
                  "profile_url": "https://example.com/profile/1.png",
                  "user_description": "Example user profile description",
                  "created_at": "2026-01-01 08:15:00"
                },
                ...
              ],
              "summary": "Posts describing common daily routines and simple habits.",
              "sentiment": "neutral"
            }
          ]
        },
        ...
      ]
    }
  ]
}