PHPackages                             hurah/canvas-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hurah/canvas-api

ActiveLibrary[API Development](/categories/api)

hurah/canvas-api
================

A set of classes that helps with communicating with the Instructure Canvas API.

v1.0.53(3mo ago)1330↓90%MITPHPPHP ^8.2CI failing

Since Jan 27Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/antonboutkam/php-canvas-api)[ Packagist](https://packagist.org/packages/hurah/canvas-api)[ RSS](/packages/hurah-canvas-api/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (7)Versions (53)Used By (0)

Canvas API SDK for PHP
======================

[](#canvas-api-sdk-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/e1f27a97849a4f2a913ff4e83e87c92e77921dbeaf5e2e227269d80a08edf065/68747470733a2f2f706f7365722e707567782e6f72672f68757261682f63616e7661732d6170692f762f737461626c65)](https://packagist.org/packages/hurah/canvas-api)[![License](https://camo.githubusercontent.com/3a04a07929f5e4fc1fcc711ce9cbedcf1eb0b9e2a88d685624528f3ea6460ca7/68747470733a2f2f706f7365722e707567782e6f72672f68757261682f63616e7661732d6170692f6c6963656e7365)](https://packagist.org/packages/hurah/canvas-api)[![CircleCI Build](https://camo.githubusercontent.com/eba248e58dbe495ce091758daf78956605249c512b6c834e59d832470bc80c4a/68747470733a2f2f706f7365722e707567782e6f72672f68757261682f7068702d63616e7661732d6170692f636972636c656369)](https://packagist.org/packages/hurah/php-canvas-api)

---

This library is a PHP SDK for the Instructure Canvas API, designed to simplify communication with Canvas by providing statically typed classes for most API endpoints. It supports both collection and single entity operations. The SDK is still in development but is already being used in small production environments. .
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#this-library-is-a-php-sdk-for-the-instructure-canvas-api-designed-to-simplifycommunication-with-canvas-by-providing-statically-typed-classes-for-most-apiendpoints-it-supports-both-collection-and-single-entity-operations-the-sdk-isstill-in-development-but-is-already-being-used-in-small-production-environments)

Features
--------

[](#features)

- **Statically typed classes**: Provides typed classes for most API endpoints.
- **Collections and entities**: Easily handle both collections and single entities in a clean object-oriented manner implementing php's Iterator and ArrayAccess interfaces.
- **Centralized communication**: All communication goes through an instance of the `Canvas` object.
- **[Symfony Console](https://symfony.com/doc/current/components/console.html) Commands**: Includes commands for manual communication with the API, offering examples, [excellent](https://symfony.com/doc/current/components/console.html)documentation and testing tools.

---

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require hurah/canvas-api
```

Usage
=====

[](#usage)

Basic Setup
-----------

[](#basic-setup)

Create an instance of the Canvas object and authenticate with your API credentials:

```
use Hurah\CanvasApi\Canvas;

$canvas = new Canvas('your-api-url', 'your-access-token');
```

Fetching Data
-------------

[](#fetching-data)

Example: fetch a collection
---------------------------

[](#example-fetch-a-collection)

```
use Hurah\CanvasApi\Canvas;

$oCourseCollection = $canvas->getCourses();
foreach ($oCourseCollection as $oCourse) {
    echo $oCourse->getName();
}
```

Example: Single Entity
----------------------

[](#example-single-entity)

```
$oCourse = $canvas->getCourse(123);
echo $course->getName();
```

Example: Create a new Course
----------------------------

[](#example-create-a-new-course)

```
$oCourse = new Course();
$oCourse->setName('Some name');
$oCourse->setDescription('Some description');
$oCourse->setSomeOtherProperty('...')
$oCourse = $canvas->createCourse($oCourse);

// The same object is returned containing the course
// id and other default properties.
$oCourse->getId()
```

Contributing
------------

[](#contributing)

Contributions and feedback are welcome! Please keep in mind that this software is in beta and comes as is. Use it at your own risk.

1. Fork the repository.
2. Create your feature branch: git checkout -b feature/my-new-feature.
3. Commit your changes: git commit -m 'Add some feature'.
4. Push to the branch: git push origin feature/my-new-feature.
5. Open a pull request.

---

Links
-----

[](#links)

- [Packagist Page](https://packagist.org/packages/hurah/canvas-api)
- [Instructure Canvas API Documentation](https://canvas.instructure.com/doc/api/)
- [Local SDK documentation index](doc/index.md)

---

Author
------

[](#author)

[Anton Boutkam](https://antonboutkam.nl) - Teacher Software Development at [ROC Amstelland](https://www.rocva.nl/MBO-onderwijs/MBO-Colleges/MBO-College-Amstelland)

CicleCI build status
--------------------

[](#cicleci-build-status)

[![CircleCI](https://camo.githubusercontent.com/a28969a38dbc187082d8b39fcfc0c17bb959705d5ffe61353af6046e8b08f489/68747470733a2f2f646c2e636972636c6563692e636f6d2f7374617475732d62616467652f696d672f67682f616e746f6e626f75746b616d2f7068702d63616e7661732d6170692f747265652f6d61696e2e7376673f7374796c653d737667)](https://dl.circleci.com/status-badge/redirect/gh/antonboutkam/php-canvas-api/tree/main)

- v1.0.51 attempt to add mastery paths
- v1.0.39 removed print\_r
- v1.0.40 added documentation index under `doc/index.md`
- v1.0.41 added mastery path support (`getModuleItemSequence`, `selectMasteryPath`) with endpoint models, commands, and tests
- v1.0.38 exposing lots of new endpoints with codex generated code
- v1.0.23 added ability to get course students
- v1.0.22 upgrade dependencies
- v1.0.21 initialized frozenAttributes in Assignment, was breaking unit testing.
- v1.0.20 upgraded various dependencies
- v1.0.18 improved README.md
- v1.0.17 removed Account part due to insufficient privileges on my Canvas account.
- v1.0.16 added Assignments, AssignmentGroups, CourseCommands, CourseSubmissionCommands, PageCommands, QuizQuestionCommands
- v1.0.15 bugfix Added missing properties to Assignment endpoint
- v1.0.13 bugfix Made setters nullable
- v1.0.12 added Lots of endpoints
- v1.0.11 added Canvas::getUserCourses(int $iCanvasId):CourseCollection
- v1.0.10 added QuizQuestionGetCommand, QuizQuestionListCommand
- v1.0.9 added QuizQuestion
- v1.0.8 updated QuizQuestion
- v1.0.7 updated QuizQuestionGroup
- v1.0.6 updated QuizQuestionGroup
- v1.0.5 updated Quiz
- v1.0.3 added Quiz

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance79

Regular maintenance activity

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Recently: every ~27 days

Total

51

Last Release

110d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/27406772?v=4)[⚒ Anton Boutkam](/maintainers/antonboutkam)[@antonboutkam](https://github.com/antonboutkam)

---

Top Contributors

[![antonboutkam](https://avatars.githubusercontent.com/u/27406772?v=4)](https://github.com/antonboutkam "antonboutkam (165 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hurah-canvas-api/health.svg)

```
[![Health](https://phpackages.com/badges/hurah-canvas-api/health.svg)](https://phpackages.com/packages/hurah-canvas-api)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19564.8M1.6k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M396](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M517](/packages/shopware-core)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
