How to Export Metrc Data to CSV, Excel, and Google Sheets

Audits, compliance reviews, and month-end reconciliation all start with the same request: get the complete dataset into a spreadsheet. This guide shows how to export Metrc data with T3 reports, which load an entire collection in one request and return it in the format you need.

Updated

Collections vs. reports

Reports are part of the T3 API for Metrc, which offers four ways to read the same data. The difference is how much you get back per request:

Endpoint typeExample pathWhat it returns
Collection/v2/packages/activeOne page at a time; you assemble the full set
Supercollection/v2/packages/active/superPages enriched with related data via include
Report/v2/packages/active/reportThe entire collection in one document, up to 50,000 rows
Super report/v2/packages/active/super/reportThe entire collection plus include data, up to 5,000 rows

Every report shares a budget of 10,000 Metrc requests. A request estimated to exceed it is rejected with Report Request Too Large before any data loads, so an oversized request costs nothing but the round trip.

Which datasets can be exported

Report endpoints cover packages (active, on hold, inactive, in transit, and transferred), plants by growth phase, plant batches, harvests, incoming, outgoing, rejected, and hub transfers along with their manifests, tags, tag orders, items, strains, locations, sales receipts, and processing jobs. The report endpoint list on the T3 wiki has every path.

Choose an output format

The contentType parameter controls what comes back:

contentTypeWhat you getBest for
jsonA nested envelope with the request details and a data arrayApplications; accepts as many includes as the budget allows
csvA text/csv fileScripts, scheduled pulls, and Spreadsheet Sync
xlsxAn Excel workbookA file that opens in Excel without an import step
googleSheetsA 302 redirect to a new Google SheetOne-off exports you plan to share or edit

The three tabular formats carry identical rows and title-cased headers, so unitOfMeasureAbbreviation becomes Unit Of Measure Abbreviation. By default, eight preamble rows describe the report (license, filters, sort, and generation time), which puts headers on row 9. Add prependCsvMetadata=false to put them on row 1:

curl
curl -H "X-T3-API-Key: $T3_API_KEY" \
  -o active-packages.csv \
  "https://api.trackandtrace.tools/v2/packages/active/report?licenseNumber=LIC-000123&contentType=csv&prependCsvMetadata=false&columns=label,item.name,quantity,unitOfMeasureAbbreviation"

A note on Google Sheets exports

By default, a generated sheet is readable and writable by anyone with the link, so treat the URL like the data itself. Pass sheetVisibility=private together with an email that belongs to a Google account to share it with one person instead. Every request creates a new sheet that is never deleted, so use csv for anything recurring.

Shape the report

Pick and rename columns

columns takes a comma-separated list of fields. Omit it to get each report’s defaults; for active packages those are label, locationName, item.name, quantity, and unitOfMeasureAbbreviation. An unrecognized name returns a 400 that lists every valid field, which makes discovery easy. To rename headers, columnHeaderOverrides matches names positionally, so ,,,Unit renames only the fourth column.

Filter and sort rows

Reports use the same filter and sort syntax as collections: filter=quantity__gte:100, repeated for multiple conditions, with filterLogic=or to match any of them, and sort=label:asc. While you are building a request, add rowLimit=10. A limited report has the same shape as the full one, so you can confirm filters and columns without loading everything.

Attach related data with include

Super reports accept include to join related records, such as lab results, source harvests, or package history. Tabular formats accept at most one include, because a flat grid cannot represent two independent child collections; JSON accepts as many as the budget allows. rowMode controls how the join lands:

rowModeRowsColumns you can select
expandedOne row per included record (the default)The record’s fields plus child fields such as labResults.testTypeName
collapsedOne row per recordThe record’s fields plus derived metadata columns
Active packages with Total THC, as Excel
GET https://api.trackandtrace.tools/v2/packages/active/super/report
  ?licenseNumber=LIC-000123
  &include=labResults
  &rowMode=collapsed
  &columns=label,item.name,quantity,metadata.indexedLabResults.totalTHC.value
  &filter=quantity__gte:100
  &sort=label:asc
  &contentType=xlsx

Combine several licenses

Reports are the only endpoints that accept more than one license. Repeat licenseNumber for up to 20 licenses, and add licenseNumber to columns so each row is labeled. Row caps and the request budget apply to the total across every license, and a multi-license report is all-or-nothing.

Two licenses in one CSV
GET https://api.trackandtrace.tools/v2/packages/active/report
  ?licenseNumber=LIC-000123
  &licenseNumber=LIC-000456
  &columns=licenseNumber,label,item.name,quantity
  &contentType=csv

Email large exports instead of waiting

An inline report request waits up to 240 seconds before returning a 504. For anything larger, add delivery=email&email=you@example.com. The response is an immediate receipt, and the file (or, for Google Sheets, a shared link) arrives by email once the report is generated. Errors that happen after the receipt are emailed too, so nothing fails silently.

Keep a spreadsheet in sync with Metrc

Spreadsheet Sync turns a report URL into a live spreadsheet. Generate a secret key, build a Sync Link with the Sync Link tool (report path, license number, secret key, and contentType=csv), then paste it into IMPORTDATA() in Google Sheets or use it as a Power Query web source in Excel. Google Sheets refreshes the import about once per hour, and identical report requests are served from a five-minute cache.

Google Sheets, cell A1
=IMPORTDATA("https://api.trackandtrace.tools/v2/packages/active/report?licenseNumber=LIC-000123&secretKey=YOUR_SECRET_KEY&contentType=csv&prependCsvMetadata=false")

Protect your Sync Link

A Sync Link contains your secret key, so anyone who has it can load your Metrc data. Keep it out of shared documents, and delete the key if a link leaks. The Spreadsheet Sync guide walks through setup step by step.

Export without writing code

Not every export needs a script. The T3 Super Reports page shows the available reports and a video walkthrough, and Spreadsheet Sync needs nothing more than a formula. When you are ready to automate, the same report endpoints sit alongside hundreds of others in the T3 API, and the Python guide shows how to call them. Most reports require a T3+ subscription.

The best way to talk to Metrc

The T3 API gives developers one consistent REST interface to Metrc data across every Metrc state, with interactive OpenAPI documentation, predictable JSON, and reports that export full datasets in a single request.

Track & Trace Tools is not affiliated with Metrc.