The SQL API expose the power of PostGIS as a web service. You can fire any select query against the database and retrieve the result set as GeoJSON.
Basically you call the API endpoint with q=select.... like this:
Where "mydb" is your MyGeoCloud database.
You can enable server side caching of the result by using
&lifetime=[seconds]. You can use this on long running queries.
Some non-GeoJSON properties are included in the JSON:
Is an object that describes the structure of the result set.
As above, but with column headings for use the a Extjs grid.
True or false
If above is false this will contain the error message.
For use in cross browser scripting, you can "pad" the return JSON with a function (This is know as JSONP):