def get_api_query(service, table_id):
 return service.data().ga().get(ids=table_id, start_date='2012-01-01', end_date='2012-01-15', metrics='ga:visits', dimensions='ga:source,ga:keyword', sort='-ga:visits', filters='ga:medium==organic', start_index='1', max_results='25')

def get_api_query ( service , table_id ) : return service . data ( ) . ga ( ) . get ( ids = table_id , start_date = '2012-01-01' , end_date = '2012-01-15' , metrics = 'ga:visits' , dimensions = 'ga:source,ga:keyword' , sort = '-ga:visits' , filters = 'ga:medium==organic' , start_index = '1' , max_results = '25' )
returns a query object to retrieve data from the core reporting api .