Is there a way to detect checkbox status in Google Docs API?

I’m trying to figure out how to determine if a checkbox item is ticked or not in a Google Docs document using the API. I’ve set up a checklist, but when I compare the document JSON, it looks the same whether the box is checked or not. The only difference I see is the revision number.

Here’s a quick example of how I’m creating a checkbox:

requests = []
requests.append({
    'insertText': {
        'text': '\n\nTODO:\n',
        'location': {'index': 1}
    }
})
requests.append({
    'createParagraphBullets': {
        'range': {
            'startIndex': 6,
            'endIndex': 7
        },
        'bulletPreset': 'BULLET_CHECKBOX'
    }
})

doc_service.documents().batchUpdate(documentId=doc_id, body={'requests': requests}).execute()

After creating the checkbox, I can manually check or uncheck it. But when I fetch the document using the API, I don’t see any changes:

doc = doc_service.documents().get(documentId=doc_id).execute()
print(json.dumps(doc, indent=2))

Has anyone dealt with this before? Is there a way to detect the checkbox state through the API? Any help would be great!

I’ve grappled with this issue in a recent project. Unfortunately, the Google Docs API doesn’t provide a straightforward method to detect checkbox status. As a workaround, I implemented a system where users append a specific character (e.g., ‘✓’) after checked items. Then, when fetching the document, I parse the content to identify these markers. It’s not perfect, but it allows for some level of checkbox state tracking. Another approach I’ve considered is using comments to indicate checkbox status, though this might clutter the document. Hopefully, Google will address this limitation in future API updates. In the meantime, these manual solutions, while not ideal, can help bridge the gap.

I’ve run into this limitation before and found it frustrating. The Google Docs API does not currently expose the checkbox status, so the JSON remains unchanged whether a box is ticked or not. In practice, I ended up using a custom marker—like a distinct character or pattern—to simulate a checked state. That way, when reading the document, I could parse the marker to determine the intended status. Until Google adds this feature, such workarounds remain the most feasible option for distinguishing checkbox states.

oh man, that sucks! i’ve been tryin to do the same thing and hit this wall too. google docs api is missin some key features :frowning: maybe we could use a special character next to the checkbox? like for checked and for unchecked? not ideal but could work until they update the api. good luck!