I don't know what version of Orion you have, but if you have the latest, with some javascript/jquery you should be able to do a http post to https://<orion ip>:17778/SolarWinds/InformationService/v3/Json/Query
with the body containing your query. e.g.
{
"query":"SELECT NodeID, Caption FROM Orion.Nodes ORDER BY Caption"
}
You will get back a result like
{
"totalRows":1,
"results":[
{
"NodeID": 1,
}
]
}