{"id":38,"date":"2014-09-30T19:35:41","date_gmt":"2014-09-30T19:35:41","guid":{"rendered":"http:\/\/ontsandquants.com\/wp\/?p=38"},"modified":"2014-09-30T19:35:41","modified_gmt":"2014-09-30T19:35:41","slug":"google-bigquery-apis","status":"publish","type":"post","link":"http:\/\/ontsandquants.com\/wp\/?p=38","title":{"rendered":"Google BigQuery APIs"},"content":{"rendered":"<p>As part of my consulting assignment I need to download geopolitical event data from the <a href=\"http:\/\/gdeltproject.org\" target=\"_blank\">GDELT Project<\/a>. This data is available as a public dataset on Google&#8217;s BigQuery. There are APIs for BigQuery in Python and R. Google provides a <a href=\"https:\/\/cloud.google.com\/bigquery\/bigquery-api-quickstart\" target=\"_blank\">tutorial for BigQuery<\/a> using Python or Java. Hadley Wickham has written an <a href=\"https:\/\/github.com\/hadley\/bigrquery\" target=\"_blank\">R API<\/a> that is available from GitHub (it&#8217;s not on CRAN yet).<\/p>\n<p>It is very helpful to be able to access these data sources from R or Python programmatically. One little pitfall I encountered using the Python API and OAuth2.0: The authentication request returned an error telling me that I needed a project name. Since that wasn&#8217;t part of the client_secret.json I was confused. It turns out that one has to set the project name on the Consent screen portion of the <a href=\"http:\/\/https:\/\/console.developers.google.com\" target=\"_blank\">Google Developers Console<\/a>. After doing that I was able to obtain a credential for my application.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of my consulting assignment I need to download geopolitical event data from the GDELT Project. This data is available as a public dataset on Google&#8217;s BigQuery. There are APIs for BigQuery in Python and R. Google provides a tutorial for BigQuery using Python or Java. Hadley Wickham has written an R API that &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/ontsandquants.com\/wp\/?p=38\"> <span class=\"screen-reader-text\">Google BigQuery APIs<\/span>Read More &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/ontsandquants.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/38"}],"collection":[{"href":"http:\/\/ontsandquants.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ontsandquants.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ontsandquants.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/ontsandquants.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=38"}],"version-history":[{"count":2,"href":"http:\/\/ontsandquants.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/38\/revisions"}],"predecessor-version":[{"id":41,"href":"http:\/\/ontsandquants.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/38\/revisions\/41"}],"wp:attachment":[{"href":"http:\/\/ontsandquants.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=38"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ontsandquants.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=38"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ontsandquants.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=38"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}