It is possible using the details from Salesforce Metadata Api/ Tooling Api to build changesets to retrieve and modify the contents of a change set via the Metadata API.
However, the whole process depends on knowing the "Change Set Name" that can then be used as the Package Name against the Metadata API.
Is there a programmatic way to discover the package names of the changesets that exist in an org?
Ideally this would be an official API.
See also, Salesforce Idea: Expose the native change sets via an API