When ran the server listens for GET requests at /qr endpoint with a url parameter from the query string and uses the qrcode library to create a QR code image. It then saves the image to a buffer and creates a response object with the contents of the buffer. Finally, it returns the response object with the QR code image. It also automatically downloads it.
Install the following
- flask
- qrcode
Windows 🪟
pip install flask qrcodeMacOS🍎 & Linux🐧
pip3 install flask qrcode- Run a server
Windows 🪟
python main.pyMacOS🍎 & Linux🐧
python3 main.py- Make a get request to
/qrendpoint with aurlparameter, like below 👇. Paste in your browser search bar.
Example:
https://qrcode-api-six.vercel.app/qr?url=https://www.example.com