Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8242521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:11:49+00:00 2026-06-07T21:11:49+00:00

i am kind of new with google apis and JavaScript, Does any one have

  • 0

i am kind of new with google apis and JavaScript,

Does any one have a example or a tutorials of how i can connect with the Google-Big Query api using JavaScript and load data from the sample tables to a simple HTML page.

Thanks in advance for this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:11:50+00:00Added an answer on June 7, 2026 at 9:11 pm

    Try something like this:

    <html>
      <head>
        <script src="https://apis.google.com/js/client.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script>
          // User Submitted Variables
          var project_id = 'XXXXXXXXXXX';
          var client_id = 'XXXXXXXXXXXXXXXXXX.apps.googleusercontent.com';
    
          var config = {
            'client_id': client_id,
            'scope': 'https://www.googleapis.com/auth/bigquery'
          };
    
          function showProjects() {
            var request = gapi.client.bigquery.projects.list();
            request.execute(function(response) {     
                $('#result_box').html(JSON.stringify(response, null));
            });
          }
    
          function showDatasets() {
            var request = gapi.client.bigquery.datasets.list({
              'projectId':'publicdata'
            });
            request.execute(function(response) {     
                $('#result_box').html(JSON.stringify(response.result.datasets, null));
            });
          }
    
          function runQuery() {
           var request = gapi.client.bigquery.jobs.query({
              'projectId': project_id,
              'timeoutMs': '30000',
              'query': 'SELECT TOP(repository_language, 5) as language, COUNT(*) as count FROM [publicdata:samples.github_timeline] WHERE repository_language != "";'
            });
            request.execute(function(response) {     
                console.log(response);
                $('#result_box').html(JSON.stringify(response.result.rows, null));
            });
          }
    
          function auth() {
            gapi.auth.authorize(config, function() {
                gapi.client.load('bigquery', 'v2');
                $('#client_initiated').html('BigQuery client initiated');
                $('#auth_button').fadeOut();
                $('#projects_button').fadeIn();
                $('#dataset_button').fadeIn();
                $('#query_button').fadeIn();
            });
          }
    
        </script>
      </head>
    
      <body>
        <h2>BigQuery + JavaScript Example</h2>
        <button id="auth_button" onclick="auth();">Authorize</button>
        <div id="client_initiated"></div>
        <button id="projects_button" style="display:none;" onclick="showProjects();">Show Projects</button>
        <button id="dataset_button" style="display:none;" onclick="showDatasets();">Show datasets</button>
        <button id="query_button" style="display:none;" onclick="runQuery();">Run Query</button>
        <div id="result_box"></div>
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am kind of new to JavaScript but I have a requirement where I
I'm kind of new to JQuery and was wondering how can I have the
Google have been suspended my android market account. I will get a new one
I'm pretty new to javascript and google maps. I have an input that, when
I am kind of new to the Eclipse IDE. I have a hierarchy of
I am using google maps but i can't get map marker for these kind
With google analytics you can track ecommerce events, http://code.google.com/apis/analytics/docs/tracking/gaTrackingEcommerce.html I was wondering if this
I am new to Google Maps, so I have most likely missed something very
Firstly, the Google Chart API example from Google (it is javascript) actually <script type=text/javascript>
I have a service variable that is initialized : service = new google.gdata.calendar.CalendarService('timeless'); This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.