There are Google Play Developer API endpoints for that:
The Google API client libraries can be used to call them.
The mentioned tools and packages (e.g. fastlane supply) do exactly that under the hood.