# Question results

URL: /docs/developers/questions/results

Once questions are live, three things tell you how they are doing: where each one sits in priority, what customers are answering, and how those answers move the priority over time. Orvelt Business shows the same picture on **Research → Priority** as the Research Radar ([how to read it](/hc/business/feedback/manage-priority)).

## See your question library [#see-your-question-library]

### `questions.list` [#questionslist]

Lists every question in the project, active and archived, with its current priority. It is not paginated, and it is the library, not what one customer was asked.

**TypeScript SDK**

```ts
import { questions } from '@orvelt/business';

const result = await questions.list({ projectId: 'PROJECT_ID' });
if (result.error) throw new Error(result.error.message);

const { questions: library, activeCount, activeLimit } = result.data;
const ranked = library
  .filter((question) => question.status === 'active')
  .toSorted((a, b) => b.priority - a.priority);

console.log(`${activeCount} of ${activeLimit} active questions`);
for (const question of ranked) console.log(question.priority, question.question);
```

**Python SDK**

```python
import os
from orvelt_business import Orvelt

with Orvelt(business_api_key=os.environ["ORVELT_BUSINESS_API_KEY"]) as client:
    result = client.questions.list(project_id="PROJECT_ID")
    ranked = sorted(
        (question for question in result.questions if question.status == "active"),
        key=lambda question: question.priority,
        reverse=True,
    )
    print(f"{result.active_count} of {result.active_limit} active questions")
    for question in ranked:
        print(question.priority, question.question)
```

With Auto on, a question near the top still needs answers; one near the bottom is already well understood. Use each `id` as `questionId` below.

## Count the answers to one question [#count-the-answers-to-one-question]

### Tally choices [#tally-choices]

Filter [`answers.list`](/docs/developers/feedback/sync#answerslist-filters) by `questionId` and count `selectedOptions`. This works for `single_select` and `multi_select` questions:

**TypeScript SDK**

```ts
import { answers } from '@orvelt/business';

const tally = new Map<string, number>();
for (let page = 1; ; page += 1) {
  const result = await answers.list({
    projectId: 'PROJECT_ID',
    questionId: 'QUESTION_ID',
    page,
    limit: 100,
  });
  if (result.error) throw new Error(result.error.message);

  for (const answer of result.data.answers) {
    for (const option of answer.selectedOptions) {
      tally.set(option, (tally.get(option) ?? 0) + 1);
    }
  }
  if (page >= result.data.pagination.totalPages) break;
}

console.log(Object.fromEntries(tally));
```

**Python SDK**

```python
import os
from collections import Counter
from orvelt_business import Orvelt

tally = Counter()
with Orvelt(business_api_key=os.environ["ORVELT_BUSINESS_API_KEY"]) as client:
    page = client.answers.list(
        project_id="PROJECT_ID",
        question_id="QUESTION_ID",
        limit=100,
    )
    while page is not None:
        for answer in page.result.answers:
            tally.update(answer.selected_options)
        page = page.next()

print(dict(tally))
```

For `text_only` questions, read the answer text, or add `query` to find answers that mention a word. Add `dateFrom` to compare this month with last.

## Follow priority changes [#follow-priority-changes]

### Get told when a priority moves [#get-told-when-a-priority-moves]

Each time an answer moves an Auto priority, Orvelt sends a [`question.updated` webhook event](/docs/developers/feedback/webhooks) with the question's ID. The event does not carry the priority, so call `questions.list` when it arrives and store each priority with a timestamp to chart how questions rise or fall as customers answer them. A question that keeps falling has been answered well enough; consider retiring it and [adding a new one](/docs/developers/questions/create) about what you still need to learn.