Screenshot / Code Snippet
An excerpt from the README:
First, initialize your client. You can omit the API key, but it's strongly recommended that you use one because it increases your request limit drastically. Also, any parameters that you pass on initialization will be passed with any request (but can be overridden later). It is recommended that you set the
require 'se/api' cli = SE::API::Client.new(ENV['APIKey'], site: 'stackoverflow')
Now that you've initialized the client, you can use the instance methods provided:
Note: All the routes below pass
**paramsdirectly to the API.
post(id, **params): Gets a post based on the ID passed.
posts(*ids, **params): Get posts based on either a semicolon delimited string of ids or an array of ids.
question(id, **params): Gets a question based on the ID passed.
questions(*ids, **params): Gets questions based on either a semicolon delimited string of ids or an array of ids.
answer(id, **params): Gets an answer based on the ID passed.
answers(*ids, **params): Gets answers based on either a semicolon delimited string of ids or an array of ids.
user(id, **params): Gets a user based on the ID passed.
users(*ids, **params): Gets users based on either a semicolon delimited string of ids or an array of ids.
I needed a gem for the Stack Exchange API for some chatbots I was working on, so I wrote this.
This project is released under the MIT License. Any contributions are welcome via pull requests. Feature requests can be made via issues or in chat.
Although the library is published on rubygems, the version there will frequently be outdated. To keep up to date, please install from GitHub. The master branch should never be broken, so
bundle update regularly. This is easy if you're using the bundler gem, you can just add the following line to your
gem 'se-api', git: 'https://github.com/thesecretmaster/se-api`, branch: 'master'
This library should work anywhere Ruby will run. That means definitely macOS/Linux, and possibly Windows.
If you are getting started, I know that documentation is poor, so please ping me in chat. I can be found in either of the two testing rooms for this library, Under the Bed and The Closet. Ping me whenever, and I should respond within 48 hours.
In addition, if you have any feature requests, ping me in chat. I would be more than happy to try to add functions you need or to help you better use the Ruby SE API.
- MRI Ruby 2.5.0