How to export StackOverflow data?
I wanted to show my StackOverflow posts on my personal website with links to the original question. There are multiple options to get the data.
StackExchange data explorer exposes the data using SQL syntax. The home page has a set of already created queries. For me, all I wanted was a way to get my answers in descending order of score and some details about the question. Here is how one can get that
DECLARE @UserId int = ##UserId## SELECT answ.Id "AnswerID", q.Id "QuestionID", answ.Body "AnswerBody", q.Body "QuestionBody", answ.Score "AnswerScore", q.Score "QuestionScore", answ.CreationDate "AnswerDate", q.CreationDate "QuestionDate" FROM Posts answ JOIN Posts q on q.Id = answ.ParentId WHERE answ.PostTypeID = 2 AND answ.OwnerUserId = @UserID ORDER BY answ.Score DESC
The user id can be passed as a parameter.
OR you can check out the same here