pgo586
By "quickest way" do you mean the fastest to write or the fastest to execute? Also, you say that you want to check content in a "given course" but then you talk about 1 API call per course, which makes it sound like you want a list of all the courses that are unused.
I'm going to answer it like you want a list of courses, not just to check whether one course is unused or not.
There is only one API call that I know of that will meet your requirements of no more than one API call per course. That's the API call that generates the unused_courses report. You can throw in a call to get a list of reports and one to check the progress, which might need to be made multiple times if you're really impatient, but that's still just 3 calls for all of your courses.
Your requirement that you're going to do this with just 1 call per course mostly fantasy. Reports run in the background because they take some time to process and you cannot expect immediate results. On the other hand, API calls are made to come back quickly so that the application making them doesn't have to wait or the connection be held open for the minutes (maybe longer if things the servers are busy).
The unused_courses report involves finding courses that have no assignments, no files, no discussions, no modules, no quizzes, and no content pages. Each of those has its own controller in Canvas, which means there's an API call for each of them. That's 6 API calls per course.
There is one other possibility, but someone who understands it better than me will have to chime in. That's GraphQL. This is what Canvas uses to do the new analytics and for the user cards from the roster page. GraphQL can pull data from multiple sources. The legacyNode and node items have all of those things under them, I just don't know how to connect them all together and then make it work with allCourses. Or if it even will?
For example, from the legacyNode courses class, there are connectors for assignment groups, assignments, grading periods, group sets, groups, modules, sections, submissions, and users. In my limited playing around, that means you can connect those together, but it leaves out discussions, quizzes, and content pages. Most discussions and quizzes will appear under assignments ... as long as they're graded, but my practice quiz for the final doesn't get included.
There's also a node class with some connections, but it also looks to be missing some of the connectors needed to tie all of the information together. This makes sense; if connectors existed for everything, then you would basically have free reign on the database and could write some really bad queries that killed performance.
There's no documentation on Canvas' implementation of GraphQL, but it was demonstrated to a technical audience at the 2018 InstructureCon. At the presentation, the Canvas engineers didn't quite consider it ready for prime time.