Hello,
We have the saved object api in Kibana: https://www.elastic.co/guide/en/kibana/master/saved-objects-api-get.html but it doesn't cover Infra UI objects for now.
In the meantime you could do your own query to the .kibana index and get the document that has the type: infrastructure-ui-source
which is where the settings reside. It's a hacky way of doing it, the format might change over time so I can't guarantee it will work forever.