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:
- CSV export is available only for boards in Premium Workspaces. You find it in the board menu under More > Print and Export.
- JSON export is available to all board members.
- The CSV leaves out comments, and since January 2024 it includes only visible cards (no archived cards) unless you change the export URL as the article explains.
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
- Linux/macOS: add a cron line, for example every Monday at 07:00:
0 7 * * 1 cd /path/to/export && /usr/bin/python3 trello_export.py
- Windows: create a weekly trigger in Task Scheduler that runs
python trello_export.py. - No server: use a scheduled CI job, such as a GitHub Actions workflow with a
schedule:cron trigger, and store the key and token as repository secrets. Then upload the file somewhere or commit it to a private repo.
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
- Token rotation. If someone revokes the token or leaves the company, the job quietly stops. Add a check that alerts you when no new file appears.
- Rate limits. Trello's API has rate limits. One request per board per week is far below them, but loops over many boards should pause between calls.
- Column drift. Write a fixed header row in the script (as above) so every week's file has the same columns. Otherwise any comparison across weeks breaks.
- Custom fields. These come from a separate endpoint (
customFieldItems) and need extra mapping. - Archived cards. Decide up front whether they belong in the snapshot, and filter the same way every time.
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.