There is indeed a way: Just use an appropriate filter with /questions
or /search
.
For example, you can get roughly the JSON equivalent of page How do I get a GreaseMonkey/UserScript to interact with the Live Preview?How do I get a GreaseMonkey/UserScript to interact with the Live Preview? with this query:
The key is to configure the filter
not only to include the /questions
elements you want,
but also the /answers
elements and even the /comments
elements.
(Or just reuse the above filter.)
If in the filter's question
fields you have selected answers
,
the API will apply the filter's answer
fields to determine what answer fields
to include.
If in the filter's answer
fields you have selected comments
,
the API will apply the filter's comment
fields to determine what comment fields
to include in the answer parts of the questions result of your /questions
query.
Likewise for the question's immediate comments.
So why have I not found this during my initial search for a solution? (I am answering my own question here)
Two reasons:
- It is not enough, when assessing the
/questions
query type, to read the page /docs/questions-by-ids (or /docs/questions for that matter), you also need to follow the link "question objects" to get enlightened. - The term "filter" for the filters is misleading. "transitive results structure specifiers" would be more appropriate.
My conclusion: There is room left for improvement of the API documentation, but the API itself is quite flexible.