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!
I'm trying to use the Canvas API to track module completion in my course. However, I'm encountering different types of module completion indicators - some modules show checkmarks, while others display completion progress like '1 out of 1/x.' Can someone guide me on how to retrieve grading information and module completion status using the Canvas API? Specifically, I'd like to know which API endpoint to use for this purpose. Any help or insights would be greatly appreciated!
It can be achieved in many different ways. I've written several types of scripts to achieve retrieval of course grading information in varying formats but never by module completion rate. To my knowledge, there's no readily available API end-point for this, so you will have to get busy coding it yourself.
First, you need to understand Learning Paths in Canvas. These are set on a per-module basis and determine how the modules behave - for example, whether or not the assignments show the check-mark you mention upon completion. They may also just not be grayed out if a student has progressed to them and more. So look it up and experiment with it until you understand it.
Secondly, be very specific about what you want to know. Do you want to know how far all of your students has progressed in a certain module? Do you want to know the average module completion rate for each student? Do you want it presented in a spreadsheet? These are all different things that require different approaches although they all build on the same data.
Thirdly, ensure that all your courses and content creators have a well-defined system for course, module and learning path design. Quite often with these things, having good structure in a course and systematic, consistent approaches to the settings of modules, learning paths and assignment creation should precede any additional coding. You cannot write a code for a chaotic system in which each course behaves differently, so if that's the case, I'd suggest you sort all this out first.
With that said, you're looking at a mix of the Courses, Modules, Submissions and Students API end-points but depending on complexity, you may not need to use them all.
Here is some code which can list the modules completed for students. I have put in a test limiting to a specific student, just to speed up the process for testing purposes.
# Module Completion.py
import csv
from canvasapi import Canvas
import html
import re
import requests
# Example setup for connecting to a Canvas API instance
API_URL = "https://your-canvas-instance.com/"
API_KEY = "your_api_key_here"
auth_token = API_KEY # You can also use this directly in your request headers
canvas = Canvas(API_URL, API_KEY)
course = canvas.get_course(13845)
print(course.name)
print("")
print("Students")
students = course.get_users(enrollment_type=['student'])
modules = course.get_modules()
for student in students:
# if student.name == "Jack Smith":
if student.id == 713345:
print(student.name)
print(student.id)
headers = {
"Authorization": f"Bearer {auth_token}"
}
response = requests.get(url, headers=headers)
modules = response.json()
# Display module-level completion status
for module in modules:
module_id = module.get("id")
module_name = module.get("name")
state = module.get("state")
completed_at = module.get("completed_at")
status = "✅ Completed" if state == "completed" else "❌ Not Completed"
timestamp = f"at {completed_at}" if completed_at else ""
print(f"{module_name} (ID: {module_id}): {status} {timestamp}")
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