Skip to content

jpechaves/steam_api

Repository files navigation

Summary

steam_api

A Ruby gem for interacting with the Steam Web API. This gem provides a structured and user-friendly way to fetch various types of data from Steam's API endpoints, such as game details, player information, and achievements.

Features

  • Fetch game details, news, and global achievements.
  • Retrieve player summaries, friends, achievements, and game stats.
  • Get owned games, recently played games, and Steam levels.
  • Supports both authenticated and unauthenticated requests.
  • Easy-to-use client configuration.

Installation

Add this line to your application's Gemfile:

$ bundle add steam_api

Or install it manually:

$ gem install steam_api

Then execute:

$ bundle install

Usage

Configuring the Client

SteamApi::Client.configure do |config|
  config.api_token = "your-API-token-value"
end

Alternatively, you can initialize the client directly:

client = SteamApi::Client.new("your-API-token-value")

Example Requests

Get Player Summaries

client = SteamApi::Client.new("your-API-token-value")
client.player_summaries.retrieve([76561198160009756])

Get App Details

client = SteamApi::Client.new
client.app_details.retrieve(appid: 1091500, filters: ["basic"])

For more examples, see the Usage section above.

Development

Requirements

  • Ruby >= 3.0
  • Docker (optional, for consistent development environments)

Initial Setup

Run the following command to set up the gem using Bundler:

$ bin/setup

Running the Interactive Console

Launch an interactive Ruby session:

$ bin/console

Running Tests

Execute all automated tests:

$ bin/rspec

Code Quality

We use standardrb for linting and code quality checks. To analyze the code, run:

$ bin/lint

Contributing

Bug reports and pull requests are welcome on GitHub at GitHub Repository. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Code of Conduct.

How to Contribute

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Write tests for your changes.
  4. Run the tests to ensure everything works.
  5. Submit a pull request.

License

This gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Steam project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Code of Conduct.

About

A public client for consuming the Steam Web API

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages