Skip to content
A package that will get Trello data organized by label rather than by board
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Trello's labels are per board, so you can't see all the tasks with a given label. Rather than hopping between boards, you can use this script to loop through the labels.

Getting Started

// Give the object enough information to connect to Trello
$batch = new TrelloLabelBatch([Trello API key], [Trello API token], [Trello user whose data you're interested in]);

// Grab the data

// You may now work with the data.

foreach ($batch->get_labels() as $label) {
    foreach ($label->get_cards() as $card) {
        // Whatever you want to do.

The script assumes that you only want to deal in one user's boards.

Notes on Data

A populated batch represents an array of all your labels, each containing the relevant cards.

  • A TrelloLabel object has a color, a name and a list of cards
  • A TrelloCard object has a name, board name and list of labels.

Any given card may appear any number of times.

  • If a card has no labels, it won't appear in the data structure. While Trello boards have a list of its labels, this generates its list by looping through existing cards.
  • If a card has more than one label applied, the card will appear in memory once per label.


PHP and the PHP Curl Extension and Composer. All the other dependencies are handled by Composer.

Built With


This is licensed under the GPL License

You can’t perform that action at this time.