Skip to content

Business insights ​

Social listening rules, alerts, clusters and matched posts. Every method returns the raw GraphQL data with the outer wrapper removed. Methods marked untested are mutations that were never called live, because they spend money, start a checkout or change account data.

insights.config(opts?) ​

Get the insights config for the viewer.

insights.list(opts?) ​

List the viewer's insight rules.

insights.get(id, opts?) ​

Get an insight rule by id.

insights.create(title, advancedQuery, opts?) ​

Create an insight rule. Untested.

insights.update(id, opts?) ​

Update an insight rule. Pass title, tags, advanced_query and notifications_enabled through opts. Untested.

insights.remove(id, opts?) ​

Delete an insight rule. Untested.

insights.buildQuery(originalQuery, opts?) ​

Turn a plain description into an advanced query. Pass previous_query through opts to refine one. Untested.

insights.setAlerts(id, notificationsEnabled, advancedQuery, opts?) ​

Turn alerts for an insight rule on or off. Untested.

insights.overview(opts?) ​

Get the overview tab with top clusters and posts. Pass the sort and limit variables through opts.

insights.groups(opts?) ​

List insight clusters.

insights.group(restId, opts?) ​

Get an insight cluster and its posts.

insights.filters(opts?) ​

Get the monitor tab filters.

insights.monitor(opts?) ​

Get monitored posts. Pass filters such as q, sentiment, start_date and end_date through opts.

insights.matchedPostMetrics(id, fromTime, toTime, opts?) ​

Get matched post metrics for an insight rule.

insights.postCount(id, fromTime, toTime, opts?) ​

Get the post count over time for an insight rule.

not affiliated with X Corp.