Google Docs to Forms - Formswrite.com logo
BlogPricing

Canvas LMS Data and Analytics APIs: Developer Reference Guide

Formswrite Team

February 15, 2026

Canvas LMS Data and Analytics APIs: Developer Reference Guide

Canvas LMS Data and Analytics APIs: Developer Reference Guide

Canvas LMS provides several APIs and data services for analytics, reporting, and institutional data integration. This guide covers the key data-related APIs every Canvas developer and admin should know.

Canvas Data APIs Overview

ServicePurposeAccess
Analytics APICourse and student analyticsREST API
Canvas Data 2Full data warehouse exportInstitutional subscription
SIS Import APIStudent Information System syncREST API (admin)
Outcomes APILearning outcomes trackingREST API
Submissions APIAssignment and grade dataREST API
GraphQL APIFlexible data queriesGraphQL endpoint
Live EventsReal-time event streamingWebhook-based

Analytics API

The Analytics API provides aggregated data about courses, students, and assignments.

Course-Level Analytics

bash# Get course participation data
curl "https://yourschool.instructure.com/api/v1/courses/5/analytics/activity" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response:
json[
  {
    "date": "2026-02-01",
    "views": 145,
    "participations": 37
  },
  {
    "date": "2026-02-02",
    "views": 120,
    "participations": 42
  }
]

Student-Level Analytics

bash# Get a specific student's activity in a course
curl "https://yourschool.instructure.com/api/v1/courses/5/analytics/users/142/activity" \
  -H "Authorization: Bearer YOUR_TOKEN"

Assignment Analytics

bash# Get assignment statistics for a course
curl "https://yourschool.instructure.com/api/v1/courses/5/analytics/assignments" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response:
json[
  {
    "assignment_id": 10,
    "title": "Chapter 1 Quiz",
    "due_at": "2026-02-10T23:59:00Z",
    "points_possible": 20,
    "min_score": 8,
    "max_score": 20,
    "median": 16,
    "first_quartile": 13,
    "third_quartile": 18,
    "tardiness_breakdown": {
      "on_time": 0.85,
      "late": 0.10,
      "missing": 0.05
    }
  }
]

Python: Course Analytics Dashboard

pythonimport requests

CANVAS_URL = "https://yourschool.instructure.com"
TOKEN = "your_token"
headers = {"Authorization": f"Bearer {TOKEN}"}

def get_course_analytics(course_id):
    # Get participation
    activity = requests.get(
        f"{CANVAS_URL}/api/v1/courses/{course_id}/analytics/activity",
        headers=headers
    ).json()

    # Get assignment stats
    assignments = requests.get(
        f"{CANVAS_URL}/api/v1/courses/{course_id}/analytics/assignments",
        headers=headers
    ).json()

    # Get student summaries
    students = requests.get(
        f"{CANVAS_URL}/api/v1/courses/{course_id}/analytics/student_summaries",
        headers=headers,
        params={"per_page": 100}
    ).json()

    return {
        "total_views": sum(d.get("views", 0) for d in activity),
        "total_participations": sum(d.get("participations", 0) for d in activity),
        "assignments_count": len(assignments),
        "students_count": len(students),
        "avg_page_views": sum(s.get("page_views", 0) for s in students) / max(len(students), 1),
    }

stats = get_course_analytics(5)
print(f"Total views: {stats['total_views']}")
print(f"Students: {stats['students_count']}")
print(f"Avg page views per student: {stats['avg_page_views']:.1f}")

Submissions and Grades API

Get All Submissions for an Assignment

pythonresponse = requests.get(
    f"{CANVAS_URL}/api/v1/courses/5/assignments/10/submissions",
    headers=headers,
    params={"per_page": 100, "include[]": ["user"]}
)

for sub in response.json():
    print(f"{sub['user']['name']}: {sub.get('score', 'ungraded')}/{sub.get('assignment', {}).get('points_possible', '?')}")

Grade a Submission

pythonresponse = requests.put(
    f"{CANVAS_URL}/api/v1/courses/5/assignments/10/submissions/142",
    headers=headers,
    json={
        "submission": {
            "posted_grade": "85"
        },
        "comment": {
            "text_comment": "Great work on the analysis section!"
        }
    }
)

Bulk Grade Export

pythondef export_grades(course_id):
    # Get all assignments
    assignments = requests.get(
        f"{CANVAS_URL}/api/v1/courses/{course_id}/assignments",
        headers=headers,
        params={"per_page": 100}
    ).json()

    # Get all students
    students = requests.get(
        f"{CANVAS_URL}/api/v1/courses/{course_id}/users",
        headers=headers,
        params={"enrollment_type[]": "student", "per_page": 100}
    ).json()

    # Build grade matrix
    grades = {}
    for assignment in assignments:
        subs = requests.get(
            f"{CANVAS_URL}/api/v1/courses/{course_id}/assignments/{assignment['id']}/submissions",
            headers=headers,
            params={"per_page": 100}
        ).json()
        for sub in subs:
            if sub["user_id"] not in grades:
                grades[sub["user_id"]] = {}
            grades[sub["user_id"]][assignment["name"]] = sub.get("score")

    return grades, assignments, students

SIS Import API

The SIS (Student Information System) Import API allows bulk user and enrollment management via CSV files.

Upload SIS CSV

bashcurl -X POST "https://yourschool.instructure.com/api/v1/accounts/1/sis_imports" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "[email protected]" \
  -F "import_type=instructure_csv"

CSV Format Examples

users.csv:
csvuser_id,login_id,password,first_name,last_name,email,status
STU001,[email protected],Welcome123!,Alice,Johnson,[email protected],active
STU002,[email protected],Welcome123!,Bob,Williams,[email protected],active
courses.csv:
csvcourse_id,short_name,long_name,status,start_date,end_date
BIO101,BIO101,Biology 101,active,2026-01-15,2026-05-15
CHEM201,CHEM201,Chemistry 201,active,2026-01-15,2026-05-15
enrollments.csv:
csvcourse_id,user_id,role,status
BIO101,STU001,student,active
BIO101,STU002,student,active
CHEM201,STU001,student,active

Python: SIS Import

pythonimport requests

with open("users.csv", "rb") as f:
    response = requests.post(
        f"{CANVAS_URL}/api/v1/accounts/1/sis_imports",
        headers={"Authorization": f"Bearer {TOKEN}"},
        files={"attachment": ("users.csv", f, "text/csv")},
        data={"import_type": "instructure_csv"}
    )

import_id = response.json()["id"]
print(f"SIS import started: {import_id}")

# Check status
status = requests.get(
    f"{CANVAS_URL}/api/v1/accounts/1/sis_imports/{import_id}",
    headers=headers
).json()
print(f"Status: {status['workflow_state']}")

Outcomes API

Learning Outcomes track student mastery of specific skills or standards.

Create an Outcome

bashcurl -X POST "https://yourschool.instructure.com/api/v1/accounts/1/outcome_groups/1/outcomes" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Scientific Method",
    "description": "Student can apply the scientific method",
    "mastery_points": 3,
    "ratings": [
      {"description": "Exceeds", "points": 4},
      {"description": "Meets", "points": 3},
      {"description": "Approaching", "points": 2},
      {"description": "Below", "points": 1}
    ]
  }'

Get Outcome Results

pythonresponse = requests.get(
    f"{CANVAS_URL}/api/v1/courses/5/outcome_results",
    headers=headers,
    params={"per_page": 100}
)

for result in response.json().get("outcome_results", []):
    print(f"User {result['links']['user']}: {result['score']} / {result['possible']}")

Canvas GraphQL API

Canvas has a GraphQL API for more flexible data queries:
bashcurl -X POST "https://yourschool.instructure.com/api/graphql" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "{ course(id: \"5\") { name assignmentsConnection { nodes { name dueAt pointsPossible } } } }"
  }'

Python: GraphQL Query

pythonquery = """
{
  course(id: "5") {
    name
    enrollmentsConnection {
      nodes {
        user {
          name
          email
        }
        type
        grades {
          currentScore
          finalScore
        }
      }
    }
  }
}
"""

response = requests.post(
    f"{CANVAS_URL}/api/graphql",
    headers=headers,
    json={"query": query}
)

data = response.json()["data"]["course"]
print(f"Course: {data['name']}")
for enrollment in data["enrollmentsConnection"]["nodes"]:
    grades = enrollment.get("grades", {})
    print(f"  {enrollment['user']['name']}: {grades.get('currentScore', 'N/A')}%")

Canvas Data 2 (Data Warehouse)

Canvas Data 2 is Instructure's data warehouse service that provides access to your institution's full Canvas data for business intelligence and reporting.

What It Provides

  • Complete tables: users, courses, enrollments, submissions, grades, page views
  • Updated daily
  • Accessible via API or direct database connection
  • Supports SQL queries

Access

Canvas Data 2 requires an institutional Canvas subscription. Contact your Instructure account manager to enable it.

Live Events

Canvas Live Events send real-time notifications when things happen in Canvas:
  • Student submits an assignment
  • Quiz attempt completed
  • Grade posted
  • Course enrollment changed
  • User login
Events are delivered via AWS SQS or HTTPS webhooks and can be used to build real-time dashboards, trigger automations, or sync with external systems.

Getting Quiz Content into Canvas

While these data APIs are great for reading and analyzing Canvas data, creating quiz content remains a challenge. The API requires building each question individually with complex JSON.
Formswrite provides a simpler path: convert Google Docs into Canvas QTI packages and import them through Canvas's built-in import feature. This works alongside any API-based reporting or automation you build.

FAQ

What is Canvas Data 2?

Canvas Data 2 is Instructure's data warehouse service that provides daily exports of all your Canvas data (users, courses, grades, activity) for analytics and reporting.

Does Canvas support xAPI?

Canvas doesn't natively generate xAPI statements, but you can use LTI integrations (like H5P) that generate xAPI data, or build a custom integration using Canvas Live Events.

Can I export grades via the API?

Yes. Use the Submissions API (GET /api/v1/courses/:id/assignments/:id/submissions) to retrieve scores, or use the Analytics API for aggregated grade statistics.

What is Canvas GraphQL used for?

The GraphQL API provides flexible data queries — you can request exactly the fields you need in a single request, unlike the REST API which returns fixed data structures.

Summary

Canvas provides comprehensive data and analytics APIs for institutional reporting, student tracking, and system integration. For content creation — especially quizzes — pair these APIs with Formswrite to convert documents into Canvas-ready QTI packages automatically.

Share this post with your network


Formswrite - Google Docs to Forms Converter

Create forms in seconds, not hours

Convert Google Docs to Forms with one click

Save hours on quiz creation every month.

No more manual form creation. No more formatting hassles.

We care about your data in our privacy policy

© 2026 Formswrite. All Rights Reserved.