Socket
Socket
Sign inDemoInstall

igdb_client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

igdb_client


Version published
Maintainers
1
Created
Source

igdb_client

Ruby client interface for IGDB API. Supports API v4.

Installation

$ gem install igdb_client

Usage

The structure of queries and results matches the api documentaion. You will need client id and a valid token to access the API. The above link explains how to acquire them.

Instance
require 'igdb_client'

# initialize with client id and token
client = IGDB::Client.new("client_id","token") 

# Endpoint can optionally be provided to change from defaults of 'games'
other_client = IGDB::Client.new("client_id","token", 'characters') 

# Endpoint/token/client_id can be changed on a client
other_client.endpoint = 'games'

# Use the get method to fetch given the API params
client.get {fields: "name", limit: 10}

# Use search method to search
client.search("ibb and obb", {fields: "name,release_dates,esrb.synopsis,rating"})

# Use id if you want to match by id
client.id 1942

# You can run methods on alternate endpoints by using endpoint as method
client.character.id 14390

# Access retrieved data by using methods matching fields of data
results = client.platform.id 2
results[0].name
results[0].summary

FAQs

Package last updated on 11 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc