This project aims to provide a Java wrapper to the Stack Exchange API.

  • SDK supports Stack Exchange API V2.2

Getting Started

There are two interfaces to the library.

  • Query Interface
  • Facade Interface


  • Asynchronous API Examples of using the API asynchronously are described in Asynchronous API.

  • Advanced Usage Advanced usage like changing API providers or paging through the results are described in Advanced Usage.

  • Spring Configuration If you plan to use the library in conjunction with Spring framework, this brief tutorial will guide you. Spring Configuration

  • Query API Query API provides a Builder like syntax to the StackOverflow? API.There are similar Query interfaces for Answers, Comments, Timelines, Badges etc.

  • Switch Site Fetching records from different site are described here.

  • Advance Search Advance search feature available in SDK.

Code Snippet

StackExchangeApiQueryFactory queryFactory = StackExchangeApiQueryFactory

// Get all questions.
String filter = "default";
Paging paging = new Paging(1, 100);
PagedList<Question> questions = queryFactory.newQuestionApiQuery()

//Get questions by answer ids. 
long answerId = 21859130; 
PagedList<Question> question3s =


Source code is available under my sanjivsingh/stackoverflow-java-sdk repository.


Please feel free to raise bugs/issues at GitHub issues

Or You can contact me here sanjiv.singh


stackoverflow-java-sdk artifacts have been upload to Maven Central.

Now, You simply add maven dependency in your project POM





and start experimenting with SDK.

| improve this answer | |

In this case the right repository config would be like:

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .