I need to develop a job to store data on Stack Overflow. I want to know how to access the Stack Exchange API with Python, and how to use the API.
I need to develop a job to store data on Stack Overflow. I want to know how to access the Stack Exchange API with Python, and how to use the API.
The Stack Exchange API is all RESTful, that is, you just need to make HTTP requests for a particular URL, and you get a response in JSON. There is no official client for Python, but Renan found one on GutHub . From what I've researched (I'm not a Python user), if you want to do the nail, you'd just have to use httplib
( http.client
in Python 3) to make the requests.
The documentation on all methods available in the API can be found at link .
I'll give you some information about Stack Overflow: both here and in the matrix in English people generally do not like asking questions for tutorials. There is even a standard reason for closing questions when it comes to that.
That's just a tip. Since you will actually do some work on the subject, I will tell you two sources:
If you have questions, both have some documentation. When you have a more specific problem, do not hesitate to open an issue. But that's a very specific problem, okay? Always make some rubber ducking before.
In addition to the responses from bfavaretto and Renan , giving a quick search on StackApps , I found this question , linking to the pyso , which works correctly for Python 2.6 and already provides several methods for data acquisition.
With a quick review of this lib, you can see that it was developed using urllib and urllib2 to make HTTP requests.