How to retrieve character positions and insertion timestamps from Google Docs using API

I’m working on a project where I need to extract the position index of every character in a Google Docs document along with the timestamp showing when each character was added to the document.

Is there a specific Google API endpoint that can provide this information? I’ve been looking through the Google Docs API documentation but haven’t found a direct method to get character-level insertion data.

Currently I’m monitoring network requests when typing in Google Docs and I notice it makes API calls like:

/save?id=ABC123&sid=xyz789&vc=1&c=1&w=1&flr=0&token=sometoken

The request includes a bundles parameter that looks like this:

bundles: [{"operations":[{"action":"insert","pos":5,"text":"hello"}],"sessionId":"xyz789","requestId":1}]

In this structure:

  • text contains the typed content (“hello” in my example)
  • pos shows where the text was inserted in the document

I’m manually tracking character positions this way, but I’m hoping there’s a cleaner approach using the official Google Docs API to get all character positions and their insertion timestamps for an existing document.

yeah, this is a dead end unfortunately. google keeps that granular data locked down tight and there’s no public way to access it. i’ve tried similar stuff before and always hit the same wall - the docs api just doesn’t go that deep into tracking individual keystrokes or character timestamps.

Unfortunately, the Google Docs API does not provide character-level timestamps or detailed revision history at that level. The API is primarily designed for document structure and content manipulation, rather than analyzing typing patterns in detail.

What you are observing through network monitoring relates to Google’s internal collaborative editing protocol, which tracks these micro-operations to maintain real-time synchronization between users. However, this data is not accessible through public API endpoints.

The closest alternative is the Drive API’s revisions endpoint, which reveals document-level changes at specific intervals, but not individual character insertions. You might also explore the suggestion mode features within the Google Docs API, though they similarly lack the desired timestamp detail.

As it stands, your current network monitoring method appears to be the most thorough approach, albeit not officially supported, and it could be disrupted if Google alters its internal protocols.

I’ve dealt with this before - you can’t get character-level insertion data through official APIs. Those internal operations you’re seeing are part of Google’s operational transformation system for real-time collaboration, but they don’t expose that stuff publicly. One workaround I’ve used: combine the Google Docs API with periodic polling to grab document snapshots at regular intervals. Compare consecutive snapshots and you can figure out where changes happened, though you’ll lose the precise timestamps for individual characters. Another option is Google Apps Script with time-driven triggers to monitor document changes. Won’t give you character-level detail, but it’ll track larger text modifications with timestamps. Your network monitoring approach might work technically, but it’s risky. Google could change their internal API structure anytime without warning and completely break your implementation.