This is a Python example that can be used for reference or as a starting point for teaching how to connect and retrieve data through an API, with both REST and GraphQL.
-
Setup virtual environment:
python3 -m venv .venv source .venv/bin/activate
-
Install packages:
pip install -r requirements.txt
-
Run either of the examples:
python graphql_example.py python rest_example.py
-
Edit the files, play around, and have fun!