# Share a Google Colab Notebook as HTML — Without Sharing the Runtime

Canonical: https://commareports.com/with/colab
Published: 2026-08-22

> Colab sharing hands people a runtime they can re-execute. Export the notebook to HTML and publish it to Comma instead: a read-only page with outputs frozen, comments anchored to a cell, and a revision per run.

# Share a Colab notebook as HTML

Colab's share button shares a _runtime_. That's exactly right when the
other person is going to run the thing, and exactly wrong when they're
going to read it. A stakeholder opening a shared Colab link gets a Google
sign-in, a code cell at the top of the document, a "Run all" button, and
the standing possibility of changing the numbers they were asked to
review.

What that reader wants is the output: charts, tables, the narrative
between them. That's a static export — and the export is one line.

## Export and publish, from inside the notebook

```python
!jupyter nbconvert --to html --no-input /content/notebook.ipynb

import os, requests
requests.patch(
    f"https://commareports.com/api/v1/reports/{os.environ['COMMA_REPORT_ID']}",
    headers={"Authorization": f"Bearer {os.environ['COMMA_API_TOKEN']}"},
    json={
        "title": "Weekly analysis",
        "html": open("/content/notebook.html").read(),
    },
    timeout=30,
)
```

`--no-input` drops the code cells and keeps the outputs and markdown —
the audience-facing document. Drop the flag when the audience is
technical; many teams keep both, as two reports with two URLs.

Put the token in Colab's **Secrets** panel (`userdata.get("COMMA_API_TOKEN")`),
not in a cell. Use a [scoped token](/docs/api-tokens) with `reports:write`
so a leaked notebook can't do anything else.

`PATCH` on a saved report id gives one URL with a revision per run, so
last month's link opens this month's analysis and the two can be
[diffed](/share-html-report).

## What the published version gives you

- **Frozen outputs.** Nobody re-runs the analysis by accident, and what a
  reviewer saw is what a revision recorded.
- **Comments on a chart.** Pinned to the figure, not floating in a
  thread — see [commenting on HTML](/comment-on-html). The reader needs
  no Google account.
- **Interactive plots survive.** Plotly and Altair figures exported into
  the HTML keep working inside the sandbox — see
  [interactive HTML reports](/interactive-html-reports).
- **Access you control.** Private, team-visible, domain-gated, or named
  reviewers. See the [sharing model](/docs/sharing).

## Limits

- **HTML body: 5 MB.** A notebook with many inline images passes it —
  downsample figures, or attach the heavy ones as [assets](/docs/api).
- **Scripts run, sandboxed**: `allow-scripts`, no `allow-same-origin`.

## Try it

Comma is free — unlimited reports, unlimited commenters, unlimited
revision history.

**[Create your first report →](https://commareports.com/)**

### Related

- [Jupyter notebooks](/with/jupyter) — nbviewer alternative, in detail
- [R Markdown](/share-rmarkdown-report) · [EDA reports](/share-eda-report)
- [Google Docs for HTML](/google-docs-for-html)
