Skip to main content

Stackexchange API for Python

Project description


[![Build Status](](
[![PyPI version](](

A Friendly wrapper for stackexchange public api used to harvest information about Questions, Answers
and even search for questions.


you can install stackexchange from its official pypi repository.

pip install stackexchange




We can use the stackexchange search api to search in various titles


from stackexchange import search

g = search("python", site="stackoverflow", order="desc")

for item in g:
print item.title
# will help you to see all properties it contains
print dir(item)


### answers

Let's look at the answer api now.


from stackexchange import Answer

a = Answer()
g = a.get_all_answer(site="stackoverflow", order="desc", page=1)

for item in g:
answer_id = item.answer_id
ans = a.get_by_id(answer_id)
comments = a.get_comments(answer_id)
print comments


On Questions api


from stackexchange import Question

q = Question()

g = q.get_all_questions(site="stackoverflow", order="desc")

for item in g:
question_id = item.question_id
ques = q.get_by_id(question_id)

#for getting unanswered questions

g = q.get_unanswered()

#for getting featured questions

g = q.get_featured()



<h4> MIT </h4>

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
stackexchange-0.5.0.tar.gz (3.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page