The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
This API is working great for students:
https://xxx.test.instructure.com/api/v1/courses/:courseid/analytics/users/:userid/activity
But it is limited to student data.
How are folks using the API to get high level activity data by course?
Hello!
What are you trying to achieve?
Doing guesses without knowing it, are you probably looking for this API endpoint?
GET /api/v1/courses/:course_id/analytics/student_summaries
Returns a summary of per-user access information for all students in a course. This includes total page views, total participations, and a breakdown of on-time/late status for all homework submissions in the course.
Each student’s summary also includes the maximum number of page views and participations by any student in the course, which may be useful for some visualizations (since determining maximums client side can be tricky with pagination).
@sgergely - I'm trying to come up with a proxy for participation in the course. The analytics endpoint is just what I need, however, it only picks up students, not teachers! Is there any way the endpoint could be opened up for all user roles?
We would love to see this too - basically the same endpoints for the Teacher Role as we have for students when looking at activity and participation in courses.
@lmurray2 - in the meantime, what we are attempting to do is cobble a Teacher Participation report by looking at common teacher activities (entering grades, submission comments, updating assignments, using a rubric, etc.) that are present in the DAP table schemas. It's less straightforward than querying the API (you have to download all the incremental data you want from the tables, convert it into something readable, then filter for the information you want) but you can get pretty granular. And if you're comfortable using something like Node.js a lot of that can be automated with JavaScript.
Ask Your Data can probably do a lot of that for you in the GUI, but I like having the raw data too.
That sounds like a lot of workaround to get teacher participation. I'd love to see how you are leveraging node.js and javascript for automations. I have several automations built in python.
It is, and to be honest I'm not 100% it would be worth it except we need the data for several other reasons institutionally anyway.
I did use Ask Your Data to show me teacher participation (it gave it to me in increments of seconds per course) for a set of courses and that was very useful as an overview but I would need to ask more explicitly for what that actually represents as actions. Which is why I was looking at how to get the raw data, but I might try this anyway and create a Pinboard for it. (btw thanks @sgergely for showing me that recently)
(Editing to add that I'm using Node because I came at this first using Postman and newman - I'm not that familiar with Python. But since the Client Library is built off it, it's probably a more efficient approach)
@lmurray2 What are you trying to measure when you are analyzing teacher participation?
While it doesn't provide as much data as the Analytics API endpoint does for students, you can look at a user's Access Report to find out what content within a course they have accessed, times viewed, times participated (if applicable), and last viewed. By adding ".json" to the end of the URL you can get the raw data for the Access Report. (https://yourURL.instructure.com/courses/1234/users/123/usage.json)
The following offer some tools for extracting the Access Report data for an entire course:
Oh I didn't know you could do that either (the adding .json) - will definitely try this!
Awesome! Thanks, James. I will definitely review these materials. It's great to see others coding novel solutions. This is really the area I'm most interested in Canvas.
Just another idea @lmurray2 since I haven't myself written this yet for this particular purpose (I have however used live events for analytics reports on specific sorts of events, like downloading files), but potentially you could get activity data based on Canvas Live Events (you would filter events based on the teacher role, among any other things that are relevant to you).
Re Live Events, is there a simple, local setup that I can get started for this, or does it require an AWS setup on my end? Any tips on that? What's the lift for a local (easy) setup?
@lmurray2 , you will need to subscribe to the Instructure Live Events stream (we subscribe to the complete stream, but you could also be selective if you wanted), which in our case, it meant that we needed to set up an AWS queue as the repository for the events they send (it was easy to follow their instructions for setup). Having said this, it's been a few years and they may have other alternatives too. Our 'pipeline' then consists in an AWS Lambda function that regularly polls the queue for.
new events, and ingests them (via api) over to our Splunk instance. Once in Splunk, we can write (SPL) queries over these events filtering them as needed (usually also joining to Canvas data, which we also happen to ingest into Splunk via a special Splunk add-on described in https://github.com/splunk/dap2_addon_for_splunk ). A similar AWS/Splunk solution was open sourced a few years back (see https://github.com/Harvard-University-iCommons/canvas-live-events-splunk by Colin Murtaugh). I'm also happy to share our code if you are interested too (I believe the AWS function is likely almost equivalent though). Let me know if you'd like any more information on what we are doing.
BTW, here's another thread that discusses this: https://community.canvaslms.com/t5/Data-and-Analytics-Group/Forwarding-Canvas-Activity-Logs-External...
Currently, I have developed a tool to grab data from a course based on the Users ID, Enrollment, and Course ID.
We use this data to see the activity of Instructors within a course.
Here are a couple of examples of how the tool is using the API:
Grab a paginated list of active courses and include student enrolled and the instructors.
//your.instructure.com/api/v1/accounts/{account_id}/courses?completed=false&state=available&per_page=100&page={page}&include[]=total_students&include[]=teachers
This call not only confirms enrolled instructors and provides the "last activity" variable that shows when an instructor was last active.
//your.instructure.com/api/v1/courses/{course_id}/users?enrollment_type=teacher&include[]=enrollments
Once an application has access to a Course ID and User ID, it can filter through most information.
is the tool these two api's or is there more to it? Thanks for sharing!
The tool itself is Modular. Its designed to take on any permitted API call, store the requested data, filter that data into a table and then display that data to the user. One of the requests in the program was for recent instructor activity, so I used that as an example. The tool overall is designed to compare qualitative data to the current quantitative data.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in