Ask API - trending questions

Retrieve trending questions across your site.


Since 1.11.6

The trending_questions API is an alternative to the related questions API. Instead of generating questions against a specific article, it returns the questions that are currently trending across your site, which makes it a good fit for pages without an anchor article, such as the home page.

Syntax

const response = await client.api.ask.trendingQuestions(payload, options);

Payload

The payload parameter is an object with the following properties:

Name Type Description
rows integer Number of questions to retrieve.

Return value

A Promise of response object with the following properties:

Name Type Description
related_questions array of strings An array of questions.

Examples

const payload = {
  rows: 5
};
const { related_questions } = await client.api.ask.trendingQuestions(payload);