0

I need to get the question/answer content from Stack Overflow site using the username.

I know we are able to retrieve data using the question id, using this API call:

http://api.stackexchange.com/2.1/users/{id}

Is there a method to fetch questions and answered publish by a particular user?

Something like:

http://api.stackexchange.com/2.1/users/{username}
4

2 回答 2

1

注意,您提到的方法将按用户 ID 返回用户,而不是按问题 ID 提问。

你应该把它改成

http://api.stackexchange.com/2.1/users/{id}

http://api.stackexchange.com/2.1/questions/{id}

回到您的问题,没有可用的方法可以通过用户名给您问题/答案,您可以尝试的是先获取用户的 ID,然后分别尝试以下方法来获取用户的问题/答案。

//Questions by user id :
http://api.stackexchange.com/2.1/users/{id}/questions?

//Answers by user id
http://api.stackexchange.com/2.1/users/{id}/answers?
于 2014-05-30T05:29:52.533 回答
0

干得好:

http://api.stackoverflow.com/1.1/users/1759197/questions?answers=true

1759197 应替换为用户 ID(在这种情况下,即您的 ID)

于 2013-12-05T16:46:02.740 回答