EzDevInfo.com

google-api interview questions

Top google-api frequently asked interview questions

What are the alternatives now that the Google web search API has been deprecated? [closed]

Google Web Search API has been deprecated and replaced with Custom Search API (see http://code.google.com/apis/websearch/).

I wanted to search the whole web but it looks like with the new API only custom sites can be searched.

Is there a way to search the whole web programmatically? I was able to query the old API using JSON from a Java program.


Source: (StackOverflow)

Google's "define: " through an API?

I want to get the result of searches that use special features in Google, like "define: [phrase]" and I can't seem to find relevant information about this.

Does anyone knows where I can get the data in JSON format (like the rest of Google's APIs) without scraping the results page manually?

Thanks, Eli


Source: (StackOverflow)

Advertisements

Alternative to google finance api [closed]

I wanted to use Google Finance API to get stock data about company but this API is deprecated since 2011/26/05.

So my question is simple :)

What do you use as free API to get stock data in real time?


Source: (StackOverflow)

Restrict Login Email with Google OAuth2.0 to Specific Domain Name

I can't seem to find any documentation on how to restrict the login to my web application (which uses OAuth2.0 and Google APIs) to only accept authentication requests from users with an email on a specific domain name or set of domain names. I would like to whitelist as opposed to blacklist.

Does anyone have suggestions on how to do this, documentation on the officially accepted method of doing so, or an easy, secure work around?

For the record, I do not know any info about the user until they attempt to log in through Google's OAuth authentication. All I receive back is the basic user info and email.


Source: (StackOverflow)

Is there a Google Keep API?

Is there a API for Google Keep? I want to make a windows 8 app for Google Keep, so that it synchronizes with your phone.

I looked into the Drive SDK because Google Keep is a extension of Google Drive, but I couldn't find it.


Source: (StackOverflow)

Is there already a Google+ API?

I would like to know if there is already a Google+ API available to the developers. I have not yet found something?

The API is now here available: https://developers.google.com/+/


Source: (StackOverflow)

How can I get stock quotes using Google Finance API?

I'm looking for access to financial data from Google services.

I found this URL that gets the stock data for Microsoft.

What are all the possible parameters that Google allows for this kind of HTTP request? I'd like to see all the different information that I could get.


Source: (StackOverflow)

Error: invalid_client no application name

I am using Google Apps API for my application and trying to authorize it using OAuth2. I have created a project and an application within it using the Google API console. I am using the following URL for authorization:

https://accounts.google.com/o/oauth2/auth&scope=https://www.googleapis.com/auth/admin.directory.user&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&client_id=(my application clientid)

I get the following error,

Error: invalid_client
no application name
Request Details

I have verified the clientid and even the status of admin SDK.


Source: (StackOverflow)

Is there a link to the "latest" jQuery library on Google APIs? [duplicate]

This question already has an answer here:

I use the following for a jQuery link in my <script> tags:

http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js

Is there a link to the "latest" version? Something like the following (which doesn't work):

http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js

(Obviously not necessarily a great plan to link your code to potentially changing libraries but useful in development.)


Source: (StackOverflow)

OAuth2 - Why do access tokens expire?

I am just getting started working with googles API and Oauth2. When the client authorizes my app I am given a "refresh token" and a short lived "access token". Now every time the access token expires, I can POST my refresh token to google and they will give me a new access token.

My question is what is the purpose of the access token expiring? Why cant there just be a long lasting access token instead of the refresh token?

Also, does the refresh token expire?

For more info on Google Oauth2 workflow - http://code.google.com/apis/accounts/docs/OAuth2.html

I appreciate any thoughts on this.

Thanks


Source: (StackOverflow)

Where can I get Google developer key

I am working on Google API like chat, contacts and so on... I am stuck on developer_key as mentioned in gdata doc.

You can get this at https://code.google.com/apis/console:

'developer_key' => ''

I have already:

// OAuth2 Settings, you can get these keys at https://code.google.com/apis/console
'oauth2_client_id' => '',
'oauth2_client_secret' => '',
'oauth2_redirect_uri' => ''

Where can I find developer key?

I found some thing like this

http://code.google.com/apis/youtube/dashboard/gwt/index.html

But I understand this to be only for youtube.


Source: (StackOverflow)

invalid_grant trying to get oAuth token from google

I keep getting an invalid_grant error on trying to get an oAuth token from google to connect to their contacts api. All the information is correct and I have tripple checked this so kind of stumped.

Does anyone know what may be causing this issue? I have tried setting up a different client id for it but I get the same result, I have tried connecting many different ways including trying the force authentication, but still the same result...

Thanks in advance


Source: (StackOverflow)

Access-Control-Allow-Origin error sending a jQuery Post to Google API's

I read a lot for the 'Access-Control-Allow-Origin' error, but I don't understand what I have to fix :(

I'm playing with Google Moderator API, but when I try to add new serie I receive:

XMLHttpRequest cannot load 
https://www.googleapis.com/moderator/v1/series?key=[key]
&data%5Bdescription%5D=Share+and+rank+tips+for+eating+healthily+on+the+cheaps!
&data%5Bname%5D=Eating+Healthy+%26+Cheap
&data%5BvideoSubmissionAllowed%5D=false. 
Origin [my_domain] is not allowed by Access-Control-Allow-Origin.

I tried with and without callback parameter, I tried to add 'Access-Control-Allow-Origin *' to the header. And I don't know how to use $.getJSON here, if apply, because I have to add the Authorization header and I don't know how to do it without beforeCall from $.ajax :/

Any light for this darkness u.u?

That's the code:

<script src="http://www.google.com/jsapi"></script>

<script type="text/javascript">

var scope = "https://www.googleapis.com/auth/moderator";
var token = '';

function create(){
     if (token == '')
      token = doCheck();

     var myData = {
      "data": {
        "description": "Share and rank tips for eating healthily on the cheaps!", 
        "name": "Eating Healthy & Cheap", 
        "videoSubmissionAllowed": false
      }
    };

    $.ajax({

        url: 'https://www.googleapis.com/moderator/v1/series?key='+key,
        type: 'POST',
        callback: '?',
        data: myData,
        datatype: 'application/json',
        success: function() { alert("Success"); },
        error: function() { alert('Failed!'); },
        beforeSend: setHeader

    });
}

function setHeader(xhr) {

  xhr.setRequestHeader('Authorization', token);
}

function doLogin(){ 
    if (token == ''){
       token = google.accounts.user.login(scope);
    }else{
       alert('already logged');
    }
}


function doCheck(){             
    token = google.accounts.user.checkLogin(scope);
    return token;
}
</script>
...
...
<div data-role="content">
    <input type="button" value="Login" onclick="doLogin();">
    <input type="button" value="Get data" onclick="getModerator();">
    <input type="button" value="Create" onclick="create();">
</div><!-- /content -->

Source: (StackOverflow)

google oauth2 redirect_uri with several parameters

How to add a parameters to the google oauth2 redirect_uri?

Just like this redirect_uri=http://www.example.com/redirect.html?a=b.

The b of a=b is random.

Anyone can help ?


Source: (StackOverflow)

Getting Google+ profile picture url with user_id

I know that lots of social network APIs provide a way to construct a url to the profile picture of a user, using their user_id or username. For Facebook it looks like this:

http://graph.facebook.com/user_id/picture?type=square

Now is there something like this for Google Plus? Or any other way to get user's pic without an API call??


Source: (StackOverflow)