How to extract data from a user sessions query?

Use can use the User Session API to execute USQL queries and get the data.