Git Product home page Git Product logo

rawgnet's Introduction

RawgNET

A wrapper for the API of rawg.io, to get a game or creator including all their data.

Technologies

Created using

  • .NET Core 6.0

NuGet/Dependencies used

  • Newtonsoft.Json

Projects/People (I know of) using it:

Features

Nuget

General

  • Through methods, like GetGame() and IsGameExisting(), you can check if a game exists or get the data of it.
  • Through methods, like GetCreators(), GetCreator(), and IsCreatorExisting(), you can check if a creator exists or get the data of them.

Usage

Example (see the "RawgNetDemo" project)

RawgClient client = new(new ClientOptions("YOUR KEY FROM https://rawg.io/apidocs"));
const string query = "overwatch";

if (await client.IsGameExisting(query))
{
    Console.WriteLine($"Querying the input '{query}'");

    // Fetch detailed information about the game
    Game game = await client.GetGame(query, true, true);

    Console.WriteLine($"Game Name: {game.NameOriginal}");
    Console.WriteLine($"Rating: {game.Rating}");
    Console.WriteLine($"Background Image: {game.BackgroundImage}");
    Console.WriteLine($"Metacritic Score: {game.Metacritic}");
    Console.WriteLine($"Release Date: {game.Released}");
    Console.WriteLine($"Platforms: {string.Join(", ", game.Platforms.Select(p => p.Platform.Name))}");

    if (game.AreScreenshotsAvailable)
    {
        Console.WriteLine($"First Screenshot: {game.Screenshots.First().Image}");
    }

    if (game.AreAchievementsAvailable)
    {
        Console.WriteLine($"First Achievement: {game.Achievements.First().Name}");
    }
}
else
{
    Console.WriteLine("Game does not exist!");
}

FAQ

Where do I get an API-Key?

At https://rawg.io/apidocs, just press the "Get API Key" button.

What do I have to be aware of?

Rawg.io has terms of use, please read them and be sure to comply to them - https://api.rawg.io/docs/

License

Software: RawgNET

License: GNU General Public License v3.0

Licensor: Kim Mario Liebl

GNU

Roadmap

  • Get everything from the API inside RawgNet (WIP)
  • Clean up and reduce code
  • More to come…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.