Raw API Dumps
read_when:
- Using
gog <service> rawcommands for lossless Google API JSON. - Passing Google API responses into scripts, debuggers, or LLM workflows.
- Reviewing sensitive-field behavior for raw output.
Raw commands return the canonical Google API response shape instead of gog's normal curated table/JSON output. They are useful when a script needs a field that gog does not model yet, or when debugging an API object exactly as Google returns it.
#Commands
gog calendar rawgog contacts rawgog docs rawgog drive rawgog forms rawgog gmail rawgog people rawgog sheets rawgog slides rawgog tasks raw
#Examples
gog drive raw <fileId> --pretty
gog docs raw <docId> --json > doc-api.json
gog docs raw <docId> --tab "Notes" --pretty
gog docs raw <docId> --all-tabs --json > doc-tabs-api.json
gog gmail raw <messageId> --format metadata --json
gog sheets raw <spreadsheetId> --include-grid-data --json
gog sheets raw <spreadsheetId> --sheet "Quarterly Data" --include-grid-data --json
gog sheets raw --sheet selects one exact tab title on the server, reducing the response before it is downloaded. Titles such as A1 and titles containing apostrophes are treated as tab names. Spreadsheet-level metadata remains in the raw response; grid data still requires --include-grid-data. Omitting --sheet returns every tab as before.
Raw output preserves Google's JSON fields directly, including explicit zero IDs and indexes, false flags, empty values, nulls, and fields added after gog's Google SDK version. Pretty printing retains that structure, and untrusted-content wrapping marks fetched text without dropping API fields. Drive still applies its documented default redaction, and selecting one Docs tab projects that tab's content into the legacy document shape. These operations also preserve explicit values and unknown fields in the retained content.
gog docs raw --tab resolves a tab title or ID and projects that tab into the legacy top-level Document fields such as body, lists, and inlineObjects. --all-tabs keeps the canonical Documents.Get response and populates its recursive tabs tree. Without either flag, the command keeps the existing first-tab response.
gog people raw and gog contacts raw also accept email identifiers. They scan contact pages before selecting a unique resource: repeated records for the same resource count once, while distinct contacts sharing an email are ambiguous. If Google repeats a page token, lookup stops with a pagination error instead of paging indefinitely.
Use service-native field masks when available:
gog drive raw <fileId> --fields 'id,name,mimeType,owners(emailAddress)' --json
gog contacts raw people/c123 --person-fields names,emailAddresses,phoneNumbers --json
#Safety Model
Raw output is intentionally less opinionated than normal gog output. It may include private document content, contact data, event attendees, Gmail payloads, or service-specific metadata.
Drive has the highest capability-URL risk. By default, gog drive raw redacts fields such as thumbnailLink, webContentLink, exportLinks, resourceKey, properties, appProperties, and embedded thumbnail bytes unless the user explicitly names fields via --fields.
Sheets warns when grid data or developer metadata could expose sensitive data, but keeps output lossless. Docs and Slides may include short-lived image URLs.
For the full sensitive-field review, read Raw API Sensitive Field Audit.
#Automation Tips
- Prefer
--jsonfor scripts. - Prefer
--prettyfor humans. - Use
--wrap-untrustedwhen raw/fetched output will be pasted into an LLM or - Use narrow
--fieldsor service-specific field masks whenever possible. - Do not pipe raw output into logs or LLMs unless you are comfortable with the
agent context. It preserves IDs and URLs while marking fetched free-text fields as external untrusted content.
object's full Google API payload.