Skip to content
OpenSmartRoute
Skillv1.0.0

google-docs-md

Export Google Docs as clean markdown via native URL parameter. No auth needed for public docs. Use when fetching Google Doc content for vault ingestion, runbook building, or any doc-to-markdown pipeli

by joelhooks(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from joelhooks/joelclaw (skills/google-docs-md/SKILL.md). Install upstream with npx skills add joelhooks/joelclaw --skill google-docs-md. Copyright stays with the author.

Google Docs Markdown Export

Google Docs natively supports markdown export via a URL parameter. This is the most reliable way to get markdown from a Google Doc — better than defuddle, jina, or any scraping tool.

URL Pattern

For any Google Doc URL like:

https://docs.google.com/document/d/{DOC_ID}/edit?tab=t.0

Replace everything after the document ID with export?format=md:

https://docs.google.com/document/d/{DOC_ID}/export?format=md

Extracting the Document ID

The DOC_ID is the long alphanumeric string between /d/ and the next /:

# From any Google Docs URL, extract the ID:
echo "https://docs.google.com/document/d/1mt8aYM88Jj5qkep1xYC5vj0wBlbX2u6gdxhf_puaiQI/edit?tab=t.0" \
  | grep -oP '(?<=/d/)[^/]+'
# → 1mt8aYM88Jj5qkep1xYC5vj0wBlbX2u6gdxhf_puaiQI

Fetching

# Public docs — no auth needed, follow the 307 redirect:
curl -L "https://docs.google.com/document/d/${DOC_ID}/export?format=md" -o output.md

# Private docs — needs OAuth bearer token:
curl -L "https://docs.google.com/document/d/${DOC_ID}/export?format=md" \
  -H "Authorization: Bearer ${TOKEN}" -o output.md

Important: The endpoint returns a 307 redirect. Always use curl -L (follow redirects) or equivalent.

Other Export Formats

The same pattern works for other formats:

  • export?format=pdf — PDF
  • export?format=docx — Word
  • export?format=txt — Plain text
  • export?format=html — HTML
  • export?format=epub — ePub

Batch Pattern

When you have a list of Google Doc URLs (e.g. extracted from Front emails):

# Extract doc IDs from a file of URLs
grep -oP '(?<=/d/)[^/]+' urls.txt | sort -u | while read id; do
  echo "Fetching $id..."
  curl -sL "https://docs.google.com/document/d/${id}/export?format=md" \
    -o "docs/${id}.md"
  sleep 1  # Be polite
done

When to Use

  • Always prefer this over defuddle/scraping for Google Docs
  • Works for public docs without any authentication
  • Native markdown quality is superior to any HTML→markdown conversion
  • Handles tables, formatting, links, images (as URLs) correctly

Limitations

  • Private docs require a valid OAuth token (use gog when available)
  • Very large docs may take a few seconds
  • Images are referenced as URLs, not embedded
  • Comments and suggestions are not included in the export

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/joelhooks-joelclaw-google-docs-md/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

joelhooks-joelclaw-google-docs-md.ocm.jsonjson
{
  "ocm": "1",
  "id": "joelhooks-joelclaw-google-docs-md",
  "kind": "skill",
  "name": "google-docs-md",
  "description": "Export Google Docs as clean markdown via native URL parameter. No auth needed for public docs. Use when fetching Google Doc content for vault ingestion, runbook building, or any doc-to-markdown pipeline.",
  "publisher": "joelhooks",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "google-docs",
      "markdown",
      "export",
      "content-extraction",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Export Google Docs as clean markdown via native URL parameter. No auth needed for public docs. Use when fetching Google Doc content for vault ingestion, runbook building, or any doc-to-markdown pipeline."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/joelhooks/joelclaw",
      "path": "skills/google-docs-md/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/joelhooks/joelclaw/blob/HEAD/skills/google-docs-md/SKILL.md",
      "key": "joelhooks/joelclaw/skills/google-docs-md/SKILL.md"
    }
  },
  "instructions": "# Google Docs Markdown Export\n\nGoogle Docs natively supports markdown export via a URL parameter. This is the most reliable way to get markdown from a Google Doc — better than defuddle, jina, or any scraping tool.\n\n## URL Pattern\n\nFor any Google Doc URL like:\n```\nhttps://docs.google.com/document/d/{DOC_ID}/edit?tab=t.0\n```\n\nReplace everything after the document ID with `export?format=md`:\n```\nhttps://docs.google.com/document/d/{DOC_ID}/export?format=md\n```\n\n## Extracting the Document ID\n\nThe DOC_ID is the long alphanumeric string between `/d/` and the next `/`:\n\n```bash\n# From any Google Docs ",
  "cost": {
    "context_tokens": 582
  }
}

Fetch it by URL: GET /api/v1/registry/joelhooks-joelclaw-google-docs-md/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.