stackexchange-api

how to decode the Stack Exchange API response

﹥>﹥吖頭↗ 提交于 2021-02-08 03:48:53
问题 I am trying to retrieve the response of stack exchange api like [http://api.stackexchange.com/2.2/tags?order=desc&sort=popular&site=stackoverflow] I am using the following code to retrieve the response import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; public class RetrieveAllTag { public

Get all unaccepted answers within a date range at user level using Stack Exchange API

末鹿安然 提交于 2020-07-03 12:59:46
问题 I am able to retrieve a list of all my answers, within a given date range, by using this below curl command: curl "https://api.stackexchange.com/2.2/users/10348758/answers?page=1&pagesize=100&fromdate=1588291200&todate=1592179200&order=desc&sort=activity&site=stackoverflow&access_token=my-access-token&key=my-key" | gunzip I need to find the list of my unaccepted answers within a given date range. According to the documentation these fields can be applied to the answer type. In the

Get the link of question and answer at user level using Stack Exchange API

别来无恙 提交于 2020-06-28 09:22:01
问题 Based on my previous question, I am able to get the list of all unaccepted answers within a date range at the user level using Stack Exchange API with the following curl command : curl "https://api.stackexchange.com/2.2/users/10348758/answers?page=1&pagesize=100&fromdate=1588291200&todate=1592179200&order=desc&sort=activity&site=stackoverflow&access_token=my-access-token&key=my-key" | gunzip | jq '.items[] | select(.is_accepted == false)' The JSON response for the above command is something

How to get information from different objects with 1 call?

只愿长相守 提交于 2020-04-18 06:12:36
问题 I need to have list of tags with 3 fields: tag_name tag_description counter_of_posts. Since counter_of_posts is a field of tag-object and tag_description (excerpt) is a field of tag_wiki , how can I get needed information with one call? 回答1: This is impossible - you need at least 2 calls (more if you have more than 20 tags). One call to /api.stackexchange.com/2.2/tags/tag_names/info?order=desc&sort=popular&site=sitename to get the tag's name (which is given) and the counter and one to api

Encoding calling api format

谁说胖子不能爱 提交于 2020-01-25 09:06:08
问题 I try to execute the following command to receive information: library(stackr) stack_users(1144035, "reputation-history", site = "stackoverflow", num_pages=1000000, pagesize=100, encoding = "UTF-8") However I receive following error and the code stops. No encoding supplied: defaulting to UTF-8. [1] "Error: Error: lexical error: invalid char in json text.\n Too\n (right here) ------^\n\n" How can I fix it? I added the enconding in the command but again the error is the same. 来源: https:/

Encoding calling api format

雨燕双飞 提交于 2020-01-25 09:06:05
问题 I try to execute the following command to receive information: library(stackr) stack_users(1144035, "reputation-history", site = "stackoverflow", num_pages=1000000, pagesize=100, encoding = "UTF-8") However I receive following error and the code stops. No encoding supplied: defaulting to UTF-8. [1] "Error: Error: lexical error: invalid char in json text.\n Too\n (right here) ------^\n\n" How can I fix it? I added the enconding in the command but again the error is the same. 来源: https:/

StackExchange API - Deserialize Date in JSON Response

≯℡__Kan透↙ 提交于 2020-01-03 20:13:28
问题 I am trying to use stackexchange api. In this link I am trying to get some users information. If you run, it you will get the JSON response. { "items": [ { "badge_counts": { "bronze": 5630, "silver": 4212, "gold": 267 }, "account_id": 11683, "is_employee": false, "last_modified_date": 1398827800, "last_access_date": 1398799412, "reputation_change_year": 34829, "reputation_change_quarter": 7965, "reputation_change_month": 7965, "reputation_change_week": 930, "reputation_change_day": 60,