0

I'm using google.appengine.api urlfetch to preform the following freebase MQL query:

https://api.freebase.com/api/service/mqlread?queries={"q1": {"query": [{"subjects": [{"name|=": ["doubt","trust"]}], "type": "/media_common/quotation", "name": null, "author": []}]}}

This works as expected on my local setup. Once I deploy to Google AppEngine I get the following error:

File "/base/python_runtime/python_lib/versions/1/google/appengine/api/urlfetch.py", line 263, in fetch
return rpc.get_result()
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 604, in get_result
return self.__get_result_hook(self)
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/urlfetch.py", line 365, in _get_fetch_result
raise DownloadError(str(err))
DownloadError: ApplicationError: 2

From my google searches it looks like freebase may be blocking the request from appengine. I have tried using http://wiki.freebase.com/wiki/Google_API_Client_Libraries#Python with the same results.

waigani
  • 3,570
  • 5
  • 46
  • 71

1 Answers1

0

Try using Freebase API key. This might help.

Shay Erlichmen
  • 31,691
  • 7
  • 68
  • 87
  • I'm getting {u'code': 100, u'message': u'Invalid API Key (Key not found)', u'stat': u'fail'}. I registered the freebase service and added the Simple API key for browser apps to the query: '&key=apikeystringhere' – waigani May 29 '12 at 20:06
  • I've added the API key issue as a new question: http://stackoverflow.com/questions/10807184/setup-api-key-for-freebase-queries-from-appengine – waigani May 29 '12 at 21:51
  • @waigani I see the new question is resolved, is the current issue fixed also? – Shay Erlichmen May 30 '12 at 08:02