Avi Zloof
Avi Zloof

Reputation: 2973

BigQuery res api

I am new to BigQuery and up until now I worked with the bq tool. Now I want to query my data via my web app.

My request is simple I want to query a URL like this xxx.com/schema=x&query="select * from my table" and to get a json, I will make the requests from a specific server IP.

Sound simple so I open the credential tab in the Google developer console and there where so many options

security keys: CLIENT ID, CLIENT SECRET, EMAIL ADDRESS, PUBLIC KEY FINGERPRINTS and JSON security file.

With all the access option and security levels I got lost, I don't know even if my request is possible. How exactly the url for bq query will look like? what should I do?

Upvotes: 3

Views: 133

Answers (1)

Tjorriemorrie
Tjorriemorrie

Reputation: 17282

If users need to use your app with their own BigQuery data, then it's a web application credentials you must use. But it sounds more like it's for your own company/project, so a service account is what you are looking for. More info: https://developers.google.com/accounts/docs/OAuth2#serviceaccount

Then you can use oauth2 authentication, e.g. for python you can read more up here: https://developers.google.com/api-client-library/python/guide/aaa_oauth

Regarding what the URLs should look like, that should not be too difficult. You can find it here: https://developers.google.com/bigquery/docs/reference/v2/

Most of the client libraries have a 'build' function that is developed for the API. You can explore that here: https://developers.google.com/apis-explorer/#p/bigquery/v2/

If you specified your platform I might have assisted more specifically. I have a hard time implementing Google's own APIs on App Engine with django-nonrel; I wish you all the best.

Upvotes: 1

Related Questions