IGDB Python API V3
A Python wrapper for IGDB.com's Video Game Database API.
IMPORTANT
This wrapper is ONLY compatible with the newest release (V3).
About IGDB
One of the principles behind IGDB.com is accessibility of data. We wish to share the data with anyone who wants to build cool video game oriented websites, apps and services. This means that the information you contribute to IGDB.com can be used by other projects as well.
Thus, you are not only contributing to the value of this site but to thousands of other projects as well. We are looking forward to see what exciting game related projects you come up with. Happy coding!
More info here:
Information about the Querying language APICalypse:
About the Wrapper
The Wrapper can handle both the IGDB generated classes and JSON (Strings), I have chosen to make the API's Generated classes (Protocol Buffers) the standard way because it will make it easier to use as you don't have to create your own classes to hold the information.
The package contains two modules: the wrapper which holds the tools for querying the API, and igdbapi_pb2 which contains all of the generated classes for the Protocol Buffers.
Installation and Setup
pip install igdb-api-v3
Usage
Using your API key
Create a new IGDBWrapper object and give it your API key:
from igdb.wrapper import IGDBWrapper
wrapper = IGDBWrapper("YOUR_API_KEY")
How to use the wrapper
Right now, the wrapper is very barebone and only has one wrapping function api_request, which queries the API when given an endpoint and an APICalypse-like query and returns a byte array with the results.
More utilities will be added in the future, such as endpoint helper functions, JSON conversion, and Protobuf message parsing.
api_requestThis method handles IGDB generated proto classes which returns anByteArrayto be used to fill the appropriate class.
'''With a wrapper instance already created'''
# JSON API request
byte_array = wrapper.api_request(
'games',
'fields id, name; offset 0; where platforms=48;'
)
# parse into JSON however you like...
# Protobuf API request
from igdb.igdbapi_pb2 import GameResult
byte_array = wrapper.api_request(
'games.pb', # Note the '.pb' suffix at the endpoint
'fields id, name; offset 0; where platforms=48;'
)
games_message = GameResult()
games_message.ParseFromString(byte_array) # Fills the protobuf message object with the response
Exceptions
The wrapper throws a requests.HTTPError when an exception occurs from the API.
Code Examples
TBD
Metadata
Release files for igdb-api-v3 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| igdb-api-v3-0.0.2.tar.gz | 33.5 kB | Without provenance | Details for igdb-api-v3-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| igdb_api_v3-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for igdb_api_v3-0.0.2-py3-none-any.whl |
Total release size: 68.6 kB
Release files / igdb-api-v3-0.0.2.tar.gz
| Download URL | igdb-api-v3-0.0.2.tar.gz |
|---|---|
| Size | 33.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ab70d7a8881ecec211ddccea0ef5d8ddef393e648b80df2e3152a829836757d
|
|
BLAKE2b-256 checksum How to use checksums |
b93d560fed30ef9845c83d33f0e4365cb009e019e825fac69fe37e1cc288d885
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7
|
Release files / igdb_api_v3-0.0.2-py3-none-any.whl
| Download URL | igdb_api_v3-0.0.2-py3-none-any.whl |
|---|---|
| Size | 35.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3613201b3aea77da52f94e6fc1908697911d86e2d2d82fe757edaecb8dee42cf
|
|
BLAKE2b-256 checksum How to use checksums |
c9fe6b1fdd91484eddeeb3d11eed1ba573565271b7f49a83ec8578ad1ecd8c1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7
|
Security for igdb-api-v3 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.