Skip to content

seanski/StackOverflow-API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stack Overflow

This is a simple gem that utilizes HTTParty and the StackOverflow API.

gem install stack_overflow

The StackOverflow API help can be found at api.stackoverflow.com/1.1/usage

Set API Key

Be sure to set the API Key.

StackOverflow.API_KEY = YOUR_KEY_GOES_HERE You can get your key from StackOverflow by going here : stackapps.com/apps/register

Get all Users

API documentation can be found at api.stackoverflow.com/1.1/usage/methods/users

StackOverflow.get_all_users

By default the api returns the first page of users with 30 per page. This information can be read from the results. To get additional pages or change the pagesize (0-100) you can make call like:

StackOverflow.get_all_users(:page => 2, :per_page => 50)

Get User(s)

API documentation can be found at api.stackoverflow.com/1.1/usage/methods/users-by-ids StackOverflow.get_user(#user_id) You can also get a group of users by using

StackOverflow.get_users([#user_id1, #user_id2, etc])

Get User’s Tags

API documentation can be found at api.stackoverflow.com/1.1/usage/methods/user-tags

StackOverflow.get_user_tags(#user_id)

Get User’s Questions

API documentation can be found at api.stackoverflow.com/1.1/usage/methods/questions

StackOverflow.get_user_questions(#user_id)

Get User’s Answers

API documentation can be found at api.stackoverflow.com/1.1/usage/methods/answers

StackOverflow.get_user_answers(#user_id)

Get Tags

API documentation can be found at api.stackoverflow.com/1.1/usage/methods/tags

StackOverflow.get_tags

Get Tags Synonyms

API documentation can be found at api.stackoverflow.com/1.1/usage/methods/tag-synonyms

StackOverflow.get_tags_synonyms

Work in progress

This is a work in progress as I use the API for my application.

About

HTTParty over the StackOverflow API

Resources

Stars

Watchers

Forks

Packages

No packages published