You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

rawg

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rawg

RAWG.io API Wrapper

1.2.0
pipPyPI
Maintainers
1

rawg

PyPI

API wrapper for RAWG.io

This Python package is generated by the OpenAPI Generator project.

Latest update: November 2022

Installation & Usage

pip install

Install via PyPI:

pip install rawg

Getting Started

Example

import asyncio

import rawg


async def requests():
    async with rawg.ApiClient(rawg.Configuration(api_key={'key': 'YOUR_API_KEY'})) as api_client:
        # Create an instance of the API class
        api = rawg.GamesApi(api_client)

        # Making requests
        coros = [api.games_read(id=name) for name in ['grand-theft-auto-v', 'minecraft']]

        # Waiting for requests
        for coro in asyncio.as_completed(coros):
            game: rawg.GameSingle = await coro
            print('——————————————————————————————————————————————')
            print('        Name |', game.name)
            print('    Released |', game.released)
            print('      Rating |', game.rating)
            print('Achievements |', game.achievements_count)
            print('     Website |', game.website)
            print('  Metacritic |', game.metacritic)
            print('——————————————————————————————————————————————')
            print()


if __name__ == '__main__':
    asyncio.get_event_loop().run_until_complete(requests())

Output

——————————————————————————————————————————————
        Name | Grand Theft Auto V
    Released | 2013-09-17
      Rating | 4.47
Achievements | 539
     Website | http://www.rockstargames.com/V/
  Metacritic | 91
——————————————————————————————————————————————
        Name | Minecraft
    Released | 2009-05-10
      Rating | 4.42
Achievements | 744
     Website | https://classic.minecraft.net/
  Metacritic | 83
——————————————————————————————————————————————

API Docs and API Key

Link: https://rawg.io/apidocs

Another libraries

R: rabiibouhestine/Rawg

Python: laundmo/rawgpy

Node.js: orels1/rawger

Contact

Generated README below

The largest open video games database.

Why build on RAWG

  • More than 350,000 games for 50 platforms including mobiles.
  • Rich metadata: tags, genres, developers, publishers, individual creators, official websites, release dates, Metacritic ratings.
  • Where to buy: links to digital distribution services
  • Similar games based on visual similarity.
  • Player activity data: Steam average playtime and RAWG player counts and ratings.
  • Actively developing and constantly getting better by user contribution and our algorithms.

Terms of Use

  • Free for personal use as long as you attribute RAWG as the source of the data and/or images and add an active hyperlink from every page where the data of RAWG is used.
  • Free for commercial use for startups and hobby projects with not more than 100,000 monthly active users or 500,000 page views per month. If your project is larger than that, email us at api@rawg.io for commercial terms.
  • No cloning. It would not be cool if you used our API to launch a clone of RAWG. We know it is not always easy to say what is a duplicate and what isn't. Drop us a line at api@rawg.io if you are in doubt, and we will talk it through.
  • You must include an API key with every request. The key can be obtained at https://rawg.io/apidocs. If you don’t provide it, we may ban your requests.

Read more.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v1.0
  • Package version: 1.2.0
  • Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/uburuntu/rawg.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/uburuntu/rawg.git)

Then import the package:

import rawg

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import rawg

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function

import time
import rawg
from rawg.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.rawg.io/api
# See configuration.py for a list of all supported configuration parameters.
configuration = rawg.Configuration(
    host = "https://api.rawg.io/api"
)



# Enter a context with an instance of the API client
with rawg.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = rawg.CreatorRolesApi(api_client)
    page = 56 # int | A page number within the paginated result set. (optional)
page_size = 56 # int | Number of results to return per page. (optional)

    try:
        # Get a list of creator positions (jobs).
        api_response = api_instance.creator_roles_list(page=page, page_size=page_size)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CreatorRolesApi->creator_roles_list: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.rawg.io/api

ClassMethodHTTP requestDescription
CreatorRolesApicreator_roles_listGET /creator-rolesGet a list of creator positions (jobs).
CreatorsApicreators_listGET /creatorsGet a list of game creators.
CreatorsApicreators_readGET /creators/{id}Get details of the creator.
DevelopersApidevelopers_listGET /developersGet a list of game developers.
DevelopersApidevelopers_readGET /developers/{id}Get details of the developer.
GamesApigames_achievements_readGET /games/{id}/achievementsGet a list of game achievements.
GamesApigames_additions_listGET /games/{game_pk}/additionsGet a list of DLC's for the game, GOTY and other editions, companion apps, etc.
GamesApigames_development_team_listGET /games/{game_pk}/development-teamGet a list of individual creators that were part of the development team.
GamesApigames_game_series_listGET /games/{game_pk}/game-seriesGet a list of games that are part of the same series.
GamesApigames_listGET /gamesGet a list of games.
GamesApigames_movies_readGET /games/{id}/moviesGet a list of game trailers.
GamesApigames_parent_games_listGET /games/{game_pk}/parent-gamesGet a list of parent games for DLC's and editions.
GamesApigames_readGET /games/{id}Get details of the game.
GamesApigames_reddit_readGET /games/{id}/redditGet a list of most recent posts from the game's subreddit.
GamesApigames_screenshots_listGET /games/{game_pk}/screenshotsGet screenshots for the game.
GamesApigames_stores_listGET /games/{game_pk}/storesGet links to the stores that sell the game.
GamesApigames_suggested_readGET /games/{id}/suggestedGet a list of visually similar games, available only for business and enterprise API users.
GamesApigames_twitch_readGET /games/{id}/twitchGet streams on Twitch associated with the game, available only for business and enterprise API users.
GamesApigames_youtube_readGET /games/{id}/youtubeGet videos from YouTube associated with the game, available only for business and enterprise API users.
GenresApigenres_listGET /genresGet a list of video game genres.
GenresApigenres_readGET /genres/{id}Get details of the genre.
PlatformsApiplatforms_listGET /platformsGet a list of video game platforms.
PlatformsApiplatforms_lists_parents_listGET /platforms/lists/parentsGet a list of parent platforms.
PlatformsApiplatforms_readGET /platforms/{id}Get details of the platform.
PublishersApipublishers_listGET /publishersGet a list of video game publishers.
PublishersApipublishers_readGET /publishers/{id}Get details of the publisher.
StoresApistores_listGET /storesGet a list of video game storefronts.
StoresApistores_readGET /stores/{id}Get details of the store.
TagsApitags_listGET /tagsGet a list of tags.
TagsApitags_readGET /tags/{id}Get details of the tag.

Documentation For Models

Keywords

RAWG Video Games Database API

FAQs

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