How to automate Trello board export to CSV

Trello has no setting that sends you a CSV of a board every week. You can still get there. This page covers what the built-in export does, then shows how to schedule your own export.

What Trello offers out of the box

From Atlassian's documentation on exporting Trello data:

Both are manual. Someone has to click Export each time. Users on the Atlassian Community have asked for scheduled exports, and the answers there point to workarounds, not a built-in feature.

Option 1: Schedule a script against the Trello API

This option works on any plan, because it reads the board data directly instead of using the Premium CSV button.

1. Get credentials

Create a Trello Power-Up/API key in Trello's developer admin pages and generate a token for your account. Treat the token like a password. Anyone who has it can read your boards.

2. Find the board ID

Open the board and add .json to its URL. The id field at the top is the board ID. You can also use the short code in the board URL.

3. Write the export script

`python

import csv, os, datetime, requests

KEY, TOKEN = os.environ["TRELLO_KEY"], os.environ["TRELLO_TOKEN"]

BOARD = os.environ["TRELLO_BOARD"]

auth = {"key": KEY, "token": TOKEN}

base = f"https://api.trello.com/1/boards/{BOARD}"

lists = {l["id"]: l["name"] for l in requests.get(f"{base}/lists", params=auth).json()}

cards = requests.get(f"{base}/cards", params=auth).json()

fname = f"trello-{datetime.date.today():%Y-%m-%d}.csv"

with open(fname, "w", newline="", encoding="utf-8") as f:

w = csv.writer(f)

w.writerow(["card_name","list","labels","due","last_activity","url"])

for c in cards:

w.writerow([

c["name"],

lists.get(c["idList"], ""),

"; ".join(l.get("name","") for l in c.get("labels", [])),

c.get("due") or "",

c.get("dateLastActivity",""),

c.get("shortUrl",""),

])

print("wrote", fname)

`

This endpoint returns the board's open cards. If you also need archived cards, check Trello's REST API reference for the card filter options.

4. Schedule it

0 7 * * 1 cd /path/to/export && /usr/bin/python3 trello_export.py

5. Deliver the file

Write the file into a folder your Google Drive or Dropbox desktop client syncs, or add an upload step with that service's API.

Option 2: Use the Premium CSV URL

On a Premium Workspace, the board's CSV export has its own URL, which is the board URL with .csv. A scheduled job can download that URL. It needs an authenticated session, though, so for unattended runs the API route above is usually easier to keep working.

Option 3: An automation platform

General automation tools such as Zapier or Make can connect to Trello and spreadsheets. Check their current Trello triggers and actions, and their pricing, against your needs before you commit. They usually work best for syncing cards row by row, not for producing a dated full-board snapshot.

Pitfalls

Where Sundayfile fits

We make Sundayfile. It does not schedule or pull exports. What it does is take a Trello board CSV (or a HubSpot contacts or deals CSV) that you already have, map it to one fixed column layout, keep it under a client workspace and give you a clean client-type-date.csv. If your problem is messy, inconsistent files rather than remembering to export, it saves the cleanup step.

Try it