-1

I am trying to retrieve 150 results by querying freebase's db directly I'm passing in my API key which is working fine, I have upped the QPS limit in the google api console to 1000 but when retrving the images i recive the following error:

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "userRateLimitExceededUnreg",
    "message": "User Rate Limit Exceeded. Please sign up",
    "extendedHelp": "https://code.google.com/apis/console"
   }
  ],
  "code": 403,
  "message": "User Rate Limit Exceeded. Please sign up"
 }
}

Is there any way I can run the json query every 1 second ten times thus receiving the first 100 results? here is all of my current Javascript (which I assume could be written into less functions but this is for testing purposes so far):

    /*autosuggest  pre ouput*/ 
$(function() {
  $("#myinput_one").suggest({  
    "filter": null,
    "lang": "en",
    "key" : "***",
    "output": "(all)",
    "limit": 5,
  }).bind("fb-select", function(e, data) {$("#response1 pre").text(JSON.stringify(data, null, '  '));
prettyPrint();
 $("#response1").show();
             });
}); 
/*autosuggest & description*/ 
$(function() {
  $("#myinput").suggest({    
    "filter": "(all type:/automotive/model)",  
    "lang": "en",   
    "key" : "***",    
    "output": "(description)", 
  }).bind("fb-select", function(e, data) {
  $('#output').append("<li>" + data.name + "</li></li> " + data.output.description.wikipedia[0] + "</li>");
});
});
/*related search function*/
      $(function() {
        $("#myinput").change(function() {
          var search_service = 'https://www.googleapis.com/freebase/v1/search';
          var params = {
            "filter": "(all type:/automotive/model)",
            "type": "/automotive/model",
            "query": $("#myinput").val(),
            'output': '(description)'
            'limit': 150,
            "id": null,
            "key": "***",
         "name": null,
          };
          $.getJSON(search_service+'?callback=?',params, function(response) {
              $("#related ul").empty();
              for (var i=0; i<response['result'].length; i++) {
                var related_entity = response['result'][i];
                var list_item = $('<li></li>');
                var container = $('<div class="related_entity"></div>');
                list_item.append(container);
                container.append($('<img src="https://usercontent.googleapis.com/freebase/v1/image' + related_entity['mid'] + '">'));
                container.append($('<br/><a href="http://freebase.com"' + related_entity['mid'] + ' target="_blank">' + related_entity['name'] + '</a>'));
                container.append($('<br/><p>' + related_entity['wikipedia'] + '</p>')); 
                $("#related ul").append(list_item);
              } 
              $("#related").show();
          });
            });
        $("#myinput").val("ford").change();
      });

and here is the snippet throughing up the error:

/*related search function*/
  $(function() {
    $("#myinput").change(function() {
      var search_service = 'https://www.googleapis.com/freebase/v1/search';
      var params = {
      "filter": "(all type:/automotive/model)",
      "type": "/automotive/model",
      "query": $("#myinput").val(),
      'output': '(description)',
      'limit': 150,
      "id": null,
      "key": "***",
      "name": null,     
      };
      $.getJSON(search_service+'?callback=?',params, function(response) {
          $("#related ul").empty();
          for (var i=0; i<response['result'].length; i++) {
            var related_entity = response['result'][i];
            var list_item = $('<li></li>');
            var container = $('<div class="related_entity"></div>');
            list_item.append(container);
            container.append($('<img src="https://usercontent.googleapis.com/freebase/v1/image' + related_entity['mid'] + '">'));
            container.append($('<br/><a href="http://freebase.com"' + related_entity['mid'] + ' target="_blank">' + related_entity['name'] + '</a>'));
            container.append($('<br/><p>' + related_entity['wikipedia'] + '</p>'));

The 403 error is only appearing on the images, and i am no were near the 100,000 daily requests currently i'm at 150 for the whole month. Any help is greatly appriciated Kind regards Chris

Tom Morris
  • 10,490
  • 32
  • 53
vimes1984
  • 1,684
  • 3
  • 26
  • 59
  • @Tom Morris thanks for that edit I completly missed the api key I thought I had edited them all out! – vimes1984 Jul 06 '13 at 15:41
  • Well, the reason I didn't describe the edit with a comment was so people wouldn't go looking for it, but now that it's obvious, I'd make sure you invalidate that API key. – Tom Morris Jul 06 '13 at 15:48
  • I had deleted it right before posting the comment:D – vimes1984 Jul 06 '13 at 19:22

1 Answers1

1

I don't see the image API in the documentation any more, so Google could be in the process of deprecating it (or they could just have forgotten to document it).

As a first guess, I'd try adding ?key=YOUR_API_KEY to the Image service URL and see if that helps.

Tom Morris
  • 10,490
  • 32
  • 53
  • excuse the lapse in the response that didn't help though :( they seem to have come back up again all by them selves – vimes1984 Jul 16 '13 at 22:03