Google Docs now supports exporting directly to Markdown by tweaking the URL. Take any Google Doc URL like:
https://docs.google.com/document/d/1mt8aYM88Jj5qkep1xYC5vj0wBlbX2u6gdxhf_puaiQI/edit?tab=t.0Replace everything after the document ID with export?format=md:
https://docs.google.com/document/d/1mt8aYM88Jj5qkep1xYC5vj0wBlbX2u6gdxhf_puaiQI/export?format=mdIf you use curl to test it out, you might get just a 307 redirect:
bash
curl -I "https://docs.google.com/document/d/1mt8aYM88Jj5qkep1xYC5vj0wBlbX2u6gdxhf_puaiQI/export?format=md"
# HTTP/2 307
# location: https://doc-0s-...googleusercontent.com/...Pass -L to follow it and get the actual Markdown:
bash
curl -L "https://docs.google.com/document/d/1mt8aYM88Jj5qkep1xYC5vj0wBlbX2u6gdxhf_puaiQI/export?format=md"This works for any publicly shared document. The full list of supported export formats is in the Drive API docs.
This is particularly useful when interfacing publicly facing Google Docs with agents. At the time of writing, neither r.jina.ai nor markdown.new handle Google Docs conversion well, so the native export?format=md endpoint is the most reliable option.