-1

Is there a Java wrapper for the current version of Stack Overflow? I have been looking at here and here, but they seem to be outdated for current API version. I keep getting connection refused when running their example code. I do have an API key.

StackExchangeApiQueryFactory queryFactory = StackExchangeApiQueryFactory.newInstance("MyApplicationKey");
    QuestionApiQuery query = queryFactory.newQuestionApiQuery();

List<Question> questions = query.withSort(Question.SortOrder.HOT).withPaging(new Paging(1, 20)).withTimePeriod(new TimePeriod(new Date(), new Date())).withFetchOptions(EnumSet.of(FilterOption.INCLUDE_BODY, FilterOption.INCLUDE_COMMENTS)).list();
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Goosal Tapal
  • 205
  • 1
  • 2
  • 5
  • Connection refused is happening at the network level, not the API level. You need to debug that first (IP address/hostname, port, firewall, etc) using Wireshark. – Jim Garrison Jul 17 '17 at 18:18
  • I have my proxy set up, and it's working fine with other things. I am getting an `StackExchangeApiException`. – Goosal Tapal Jul 17 '17 at 18:28

1 Answers1

0

This was an internal proxy mixup. Make sure your proxy is set properly. Also, if you are using an IDE, make sure that Automatic Proxy Configuration is chosen in its settings.

Goosal Tapal
  • 205
  • 1
  • 2
  • 5