/Superhero-API

An API project using both GET and POST methods for a database with superheroes

Primary LanguagePythonMIT LicenseMIT

Superhero API

By Jarret Jeter

An API project using both GET and POST methods for a database with superheroes

Technologies Used

  • Python
  • Pandas
  • Flask
  • Postman

Description

I created a small database on a local server with a few superheroes that I like which my API can connect to. Using the correct queries for the "/see_stats" endpoint, my API can read the entire superhero dataframe or just a select few superheroes via a GET method and return it as a json object. With "/add_stats" my API creates a json object to add to the database using a POST method if all required information is input

Setup/Installation Requirements

  • _Make sure you have a text editor such as Visual Studio Code installed.
  • Clone this repository (https://github.com/jarretjeter/Superhero-API.git) onto your local computer from github
  • Open your terminal, go to the directory where you cloned the repository and create a virtual environment with Python3.7 installed and "pip install -r" the requirements.txt in that environment
  • Run the main.py file
  • In postman, create a workspace and open a request tab
  • Copy your local server ("http://127.0.0.1:5050" + "/see_stats") into the postman request url with the GET method selected and click Send
  • From there you are given back the current superheroes in the database and can add more via the POST method and "/add_stats" with a correct json object input into the body section

Known Bugs

  • No known bugs at this time

License

If you have any questions, please email me at jarretjeter@gmail.com

MIT

Copyright (c) 5/27/2022 Jarret Jeter