I know you can drag skills to a quickslot and then get the skillID from the data in the quickslot. A quick way to do this is to use the Alerter plugin and drag a skill to the alert quickslot and it will display the data value.
You can also get a table of known skills and purchasable skills via lua. I will post the method later if I get a chance.
EDIT: Alas, this table does not have skill IDs, just skill names