All URIs are relative to https://api.rawg.io/api
Method | HTTP request | Description |
---|---|---|
genres_list | GET /genres | Get a list of video game genres. |
genres_read | GET /genres/{id} | Get details of the genre. |
GenresList200Response genres_list(ordering=ordering, page=page, page_size=page_size)
Get a list of video game genres.
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() as api_client:
# Create an instance of the API class
api_instance = rawg.GenresApi(api_client)
ordering = 'ordering_example' # str | Which field to use when ordering the results. (optional)
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 video game genres.
api_response = api_instance.genres_list(ordering=ordering, page=page, page_size=page_size)
pprint(api_response)
except ApiException as e:
print("Exception when calling GenresApi->genres_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
ordering | str | Which field to use when ordering the results. | [optional] |
page | int | A page number within the paginated result set. | [optional] |
page_size | int | Number of results to return per page. | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GenreSingle genres_read(id)
Get details of the genre.
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() as api_client:
# Create an instance of the API class
api_instance = rawg.GenresApi(api_client)
id = 56 # int | A unique integer value identifying this Genre.
try:
# Get details of the genre.
api_response = api_instance.genres_read(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling GenresApi->genres_read: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | int | A unique integer value identifying this Genre. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]