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 type | Example path | What it returns |
|---|---|---|
| Collection | /v2/packages/active | One page at a time; you assemble the full set |
| Supercollection | /v2/packages/active/super | Pages enriched with related data via include |
| Report | /v2/packages/active/report | The entire collection in one document, up to 50,000 rows |
| Super report | /v2/packages/active/super/report | The 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:
| contentType | What you get | Best for |
|---|---|---|
json | A nested envelope with the request details and a data array | Applications; accepts as many includes as the budget allows |
csv | A text/csv file | Scripts, scheduled pulls, and Spreadsheet Sync |
xlsx | An Excel workbook | A file that opens in Excel without an import step |
googleSheets | A 302 redirect to a new Google Sheet | One-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 -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:
| rowMode | Rows | Columns you can select |
|---|---|---|
expanded | One row per included record (the default) | The record’s fields plus child fields such as labResults.testTypeName |
collapsed | One row per record | The record’s fields plus derived metadata columns |
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=xlsxCombine 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.
GET https://api.trackandtrace.tools/v2/packages/active/report
?licenseNumber=LIC-000123
&licenseNumber=LIC-000456
&columns=licenseNumber,label,item.name,quantity
&contentType=csvEmail 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.
=IMPORTDATA("https://api.trackandtrace.tools/v2/packages/active/report?licenseNumber=LIC-000123&secretKey=YOUR_SECRET_KEY&contentType=csv&prependCsvMetadata=false")Protect your Sync Link
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.
Related guides
Pulling lab results from the Metrc API
Add normalized THC, CBD, and terpene values to package exports.
Using the Metrc API with Python
Automate exports and pipelines from Python with requests or T3 Scripts.
Metrc API keys explained
Generate the T3 secret key that reports and Spreadsheet Sync rely on.
Metrc API documentation map
See every report endpoint alongside the rest of the API, grouped by domain.
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.