Looker Community

Example of create query

I am trying to automate the creation of Looks.
The first step I believe is creating a query and then pass the query Id to create the Look.
Are there any examples of how to convert a SQL to a Query using the api ?
I am having a hard time figuring out all the fields for the api.