RAWG.io API Wrapper
Project description
rawg
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.
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
Class | Method | HTTP request | Description |
---|---|---|---|
CreatorRolesApi | creator_roles_list | GET /creator-roles | Get a list of creator positions (jobs). |
CreatorsApi | creators_list | GET /creators | Get a list of game creators. |
CreatorsApi | creators_read | GET /creators/{id} | Get details of the creator. |
DevelopersApi | developers_list | GET /developers | Get a list of game developers. |
DevelopersApi | developers_read | GET /developers/{id} | Get details of the developer. |
GamesApi | games_achievements_read | GET /games/{id}/achievements | Get a list of game achievements. |
GamesApi | games_additions_list | GET /games/{game_pk}/additions | Get a list of DLC's for the game, GOTY and other editions, companion apps, etc. |
GamesApi | games_development_team_list | GET /games/{game_pk}/development-team | Get a list of individual creators that were part of the development team. |
GamesApi | games_game_series_list | GET /games/{game_pk}/game-series | Get a list of games that are part of the same series. |
GamesApi | games_list | GET /games | Get a list of games. |
GamesApi | games_movies_read | GET /games/{id}/movies | Get a list of game trailers. |
GamesApi | games_parent_games_list | GET /games/{game_pk}/parent-games | Get a list of parent games for DLC's and editions. |
GamesApi | games_read | GET /games/{id} | Get details of the game. |
GamesApi | games_reddit_read | GET /games/{id}/reddit | Get a list of most recent posts from the game's subreddit. |
GamesApi | games_screenshots_list | GET /games/{game_pk}/screenshots | Get screenshots for the game. |
GamesApi | games_stores_list | GET /games/{game_pk}/stores | Get links to the stores that sell the game. |
GamesApi | games_suggested_read | GET /games/{id}/suggested | Get a list of visually similar games, available only for business and enterprise API users. |
GamesApi | games_twitch_read | GET /games/{id}/twitch | Get streams on Twitch associated with the game, available only for business and enterprise API users. |
GamesApi | games_youtube_read | GET /games/{id}/youtube | Get videos from YouTube associated with the game, available only for business and enterprise API users. |
GenresApi | genres_list | GET /genres | Get a list of video game genres. |
GenresApi | genres_read | GET /genres/{id} | Get details of the genre. |
PlatformsApi | platforms_list | GET /platforms | Get a list of video game platforms. |
PlatformsApi | platforms_lists_parents_list | GET /platforms/lists/parents | Get a list of parent platforms. |
PlatformsApi | platforms_read | GET /platforms/{id} | Get details of the platform. |
PublishersApi | publishers_list | GET /publishers | Get a list of video game publishers. |
PublishersApi | publishers_read | GET /publishers/{id} | Get details of the publisher. |
StoresApi | stores_list | GET /stores | Get a list of video game storefronts. |
StoresApi | stores_read | GET /stores/{id} | Get details of the store. |
TagsApi | tags_list | GET /tags | Get a list of tags. |
TagsApi | tags_read | GET /tags/{id} | Get details of the tag. |
Documentation For Models
- CreatorRolesList200Response
- CreatorsList200Response
- Developer
- DeveloperSingle
- DevelopersList200Response
- Game
- GameEsrbRating
- GamePersonList
- GamePlatformMetacritic
- GamePlatformsInner
- GamePlatformsInnerPlatform
- GamePlatformsInnerRequirements
- GameSingle
- GameStoreFull
- GamesDevelopmentTeamList200Response
- GamesList200Response
- GamesScreenshotsList200Response
- GamesStoresList200Response
- Genre
- GenreSingle
- GenresList200Response
- Movie
- ParentAchievement
- Person
- PersonSingle
- Platform
- PlatformParentSingle
- PlatformSingle
- PlatformsList200Response
- PlatformsListsParentsList200Response
- Position
- Publisher
- PublisherSingle
- PublishersList200Response
- ScreenShot
- Store
- StoreSingle
- StoresList200Response
- Tag
- TagSingle
- TagsList200Response
- Twitch
- Youtube
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rawg-1.2.0.tar.gz
.
File metadata
- Download URL: rawg-1.2.0.tar.gz
- Upload date:
- Size: 68.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f63599186056caa7e0132c4de48f6a275d961f488d9df95749034016252986cf |
|
MD5 | e50ad126ce8b645224fb905ac4c6d57f |
|
BLAKE2b-256 | 0871fe765871a872de0c42b3629c4be82a5a5cd2448e325bd379562a64f26571 |
File details
Details for the file rawg-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: rawg-1.2.0-py3-none-any.whl
- Upload date:
- Size: 172.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59b77cea7cb99f613967abf9e7d239eae0934f9d9704bb776c36a84a5f6d8cad |
|
MD5 | d79c1948e4b7a4e81ae9f30e2ed780db |
|
BLAKE2b-256 | 499d7e319853ca4860a535228ccb8ecddbeaf088c83bf5a288c6189760757d4e |