From e490d658c7348b32c05380e2e6c270d77097c7a3 Mon Sep 17 00:00:00 2001 From: CacteGra_local Date: Wed, 4 Sep 2019 10:34:53 +0800 Subject: [PATCH] using final version of the API for filters and url --- .gitignore | 3 +++ README.md | 4 ++++ apicalypse.py | 8 ++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 722ebf9..f019405 100644 --- a/.gitignore +++ b/.gitignore @@ -122,4 +122,7 @@ dmypy.json ### Python Patch ### .venv/ +# macOS +.DS_Store + # End of https://www.gitignore.io/api/python diff --git a/README.md b/README.md index 9b8b24d..a49d4f2 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ # Python Apicalypse Client + +Apicalypse is a simple query language that allows you to easily GET data from API’s. The query can be attached to any GET request as a URL parameter or in the body of the request. + +This is the Python client to use the IGDB v3 API. diff --git a/apicalypse.py b/apicalypse.py index b1d1f02..682caf0 100644 --- a/apicalypse.py +++ b/apicalypse.py @@ -40,9 +40,9 @@ def search(self, search): def filter(self, filters): if filters: if isinstance(filters, list): - self.filter_array.append(f'filter {" & ".join(filters)}') + self.filter_array.append(f'where {" & ".join(filters)}') else: - self.filter_array.append(f'filter {filters.strip()}') + self.filter_array.append(f'where {filters.strip()}') return self def construct_options(self, url): @@ -71,7 +71,7 @@ def request(self, url): return response.json() def main(): - url = 'https://endpoint-alpha.igdb.com/games/' + url = 'https://api-v3.igdb.com/games/' igdb = apicalypse({ 'headers': { 'Accept': 'application/json', @@ -83,4 +83,4 @@ def main(): print(igdb.request(url)) if __name__ == "__main__": - main() \ No newline at end of file + main()