Worth noting that some of this isn’t always 💯 possible. If some instances have blocked other instances where users have interacted with a post, your numbers and their numbers will diverge. The host of the content generally will have the most complete numbers, but it might be possible for that to be wrong if the server doesn’t have authorized fetch enabled (ie: server a has content, blocks server b, server c boosts the content but does not block c, c boosts/upvotes/favorites it. A now doesn’t know about any metrics from server C, despite being the original source of content).
You probably want to look into $XDG_CONFIG_HOME and the freedesktop spec documentation if you are interested in more of where these standards come from:
https://specifications.freedesktop.org/basedir-spec/latest/ar01s02.html
(and more generally)
https://www.freedesktop.org/wiki/Specifications/