Hey Michel, I’m Alec, I’m one of the API developers here at Lucid. There is not currently a way to get the size of a document via the API, but we always appreciate a chance to hear more about customer use cases and why something like this might be helpful as we determine future plans for the API. If you have any more context for why an endpoint to get document size would be valuable for your use case, I’d be happy to relay that information to the team for consideration.
As for some of your particular questions, Humas is right that document size is determined by more than just the JSON content, but something you may not have considered that is relevant to document size in Lucid is action history. This is a record kept of movement of shapes, adding shapes, deleting shapes, etc. and is important to how the Undo and Redo functions in the Lucidchart and Lucidspark.
Hopefully this can help explain some of what you’re seeing, and I hope to hear more about your use case. I’m especially curious about if your use case cares about Lucid’s representation of the document size (including things like action history as I explained), or if you care more particularly about size of the document when exported, etc.