QR Code API

FREEMIUM
Par Vhushavhelo Ratshikhopha | Mise à jour 2 месяца назад | Tools
Health Check

N/A

Retour à tous les tutoriels (1)

QR Code API

This is a Python Flask server that generates QR code images from URLs. It listens for GET requests at the /qr_code endpoint and expects a url parameter in the query string. The server then generates a QR code image from the provided URL and sends the image back to the client as a PNG file.

Installation
To use this API, you will need to have Python 3 and the Flask and qrcode libraries installed. You can install Flask and qrcode using pip:

python app.py

Usage
To start the Flask server, simply run the following command from the project directory:

pip install flask qrcode

This will start the server on port 5000 by default. You can then make GET requests to the /qr_code endpoint with a url parameter to generate QR code images.

Here’s an example of how to generate a QR code image for the Google homepage using the curl command:

curl “http://localhost:5000/qr_code?url=https://www.google.com

This will generate a PNG file with the QR code image for the Google homepage and save it to your current working directory.