I userd python to call ansauthor=site.user(641) in the cooking website.

then I used ansauthor.top-answer-tags However, it doesn't return anything.

Then I called ansauthor.top-answer-tags.fetch() It can return all top-answer-tags about this user.

However, this method is very unstable. Maybe fetch() requires a lot of running time. So now I can't call fetch() again. I don't why.

top-question-tags also has the same problem.

Is there other ways to return the top-answer-tags?

  • What Python library are you using? – Nathan Osman Dec 3 '11 at 20:00
  • Sorry, I don't understand what "library" mean. Anyway, I at first used "site=stackexchange.Site(stackexchange.Cooking)" to get the cooking website's data. Then I used "ansauthor=site.user(641)" to get user information. Then if I call "ansauthor.top-answer-tags", nothing happened. So I don't know why. Thank you! – Guihua Dec 3 '11 at 21:48
  • By "library", I mean what tool are you using to access the API? – Nathan Osman Dec 3 '11 at 21:51
  • I use python 2.6.5 in Ubuntu. And I edit a *.py program. After finishing it, I execute it. – Guihua Dec 3 '11 at 21:58
  • Yes, but you must be using some Python module that provides stackexchange.Site(), etc. Do you know where that came from? – Nathan Osman Dec 3 '11 at 22:01
  • my library is "Py-StackExchange" downloaded from this website: github.com/lucjon/Py-StackExchange and then I use "import stackexchange" to import this library. Did I miss other library? – Guihua Dec 3 '11 at 22:07
  • Sorry, this is the first time I used python. There are so many things I don't understand. Thank you for your kindness – Guihua Dec 3 '11 at 22:09
  • No problem. I just needed to know what Python tool you were using to access the API. Your best bet for finding a solution is to post your question as an answer to this question. – Nathan Osman Dec 3 '11 at 22:48
  • Thanks! I still can't find the answer in the webpage you referred. I just guess maybe ansauthor.top-answer-tags.fetch() includes a lot of requests. so the number of request is larger than the throttling. Could I set so.throttle_stop = False? Since once I get "httpError 403 forbidden", then I can't use the *.py to get data from stackexchange. Do you think HttpError 403 is caused by over requests? How do I solve it? I just get data from this website to do research. So I need much data. Thanks! – Guihua Dec 4 '11 at 0:17
  • It is true that you will start to run into trouble if you make too many requests too fast. – Nathan Osman Dec 4 '11 at 0:25
  • So can I set so.throttle_stop = False, then let the server to wait rather than give me the error? – Guihua Dec 4 '11 at 0:32
  • I'm not sure. I am not the author of the Python library you are using. But you need to make sure that you are following these guidelines. – Nathan Osman Dec 4 '11 at 0:36
  • @Guihua, if you need a lot of data, but not necessarily recent data, you may want to look at the Stack Exchange data dumps, instead of using the API – dsolimano Dec 5 '11 at 13:23

You must log in to answer this question.

Browse other questions tagged .