Example queries

schema

These queries demonstrate the different output formats available

https://www.uclageo.com/gm_database/api/index.php/schema/list?format=html

https://www.uclageo.com/gm_database/api/index.php/schema/list?format=json

https://www.uclageo.com/gm_database/api/index.php/schema/list?format=csv

These queries demonstrate use of the tables and table_list query string parameters

https://www.uclageo.com/gm_database/api/index.php/schema/list?format=html&tables=intensity_measure,resp_spectra

https://www.uclageo.com/gm_database/api/index.php/schema/list?format=html&tables=intensity_measure,resp_spectra&table_list=false

flatfile

The query below returns 500 entries for the event, event_type, network, station, site, motion, time_series_metadata, intensity_measure, and response_spectra tables sites with VS30 less than 300 m/s (i.e., between 0 and 300 m/s).

flatfile query 1a link

https://www.uclageo.com/gm_database/api/index.php/flatfile?format=html&limit=500&tables=event,event_type,network,station,site,motion,time_series_metadata,intensity_measure,response_spectra&vs30=0-300

or (since these are the default flatfile tables)

flatfile query 1b link

https://www.uclageo.com/gm_database/api/index.php/flatfile?format=html&limit=500&vs30=0-300

One issue you might notice about this query is that computed intensity metrics are returned for all components, which necessarily increases the number of columns and slows down the query. In this case, if all you need only one or some, but not all, components (e.g., RotD50), you can add the “components” option to the query string like this.

flatfile query 2a link

https://www.uclageo.com/gm_database/api/index.php/flatfile?format=html&limit=500&tables=event,event_type,network,station,site,motion,time_series_metadata,intensity_measure,response_spectra&vs30=0-300&components=rotd50

or (since these are the default flatfile tables)

flatfile query 2b link

https://www.uclageo.com/gm_database/api/index.php/flatfile?format=html&limit=500&vs30=0-300&components=rotd50

Now we have a table that lists only the RotD50 component. What if we want to make it more complicated and specify a range of PGA, a range of spectral periods, fill all null fields with “-999”, and sort the values in descending order of PGA? We would then do this.

flatfile query 3a link

https://www.uclageo.com/gm_database/api/index.php/flatfile?format=html&limit=500&tables=event,event_type,network,station,site,motion,time_series_metadata,intensity_measure,response_spectra&vs30=0-300&components=rotd50&pga_rotd50=0.1-0.2&period=0.01-5&fill_null=-999&sortby=pga_rotd50&order=DESC

or (since these are the default flatfile tables)

flatfile query 3b link

https://www.uclageo.com/gm_database/api/index.php/flatfile?format=html&limit=500&vs30=0-300&components=rotd50&pga_rotd50=0.1-0.2&period=0.01-5&fill_null=-999&sortby=pga_rotd50&order=DESC

We could go on and on like this all day because there are so many different possibilities here. I think you get the picture though because that last one was pretty complicated. Feel free to reach out to us if you have any questions about forming these URLs.