Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Zingzy/qrcode-api

Repository files navigation

QR Code Generator API πŸš€

This API is a simple Flask application that generates QR codes. It provides two endpoints for generating QR codes with different styles: simple and radial.


Table of Contents

Getting Started πŸ› οΈ

To get started with the API, follow the instructions below:

Prerequisites πŸ“‹

Make sure you have the following dependencies installed:

  • Python 3

  • Flask

  • Flask-Caching

  • Flask-CORS

  • qrcode

  • pillow

You can install these dependencies using the following command:

pip install -r requirements.txt

Running the API πŸƒ

To run the API, execute the following command:

  1. Clone the repository:

    git clone https://github.com/Zingzy/qrcode-generator-api.git

  2. Change directory to the repository:

    cd your-repo

  3. Run the Flask API:

    python app.py

The API will be accessible at http://localhost:8080.


Endpoints 🚦

  1. Simple QR Code πŸ“Ž

Endpoint: /simple

Method: GET or POST

Parameters:

  • url (required): The URL or text to encode into the QR code.

  • fill (optional): The fill color of the QR code (default: black).

  • back (optional): The background color of the QR code (default: white).

Example:

curl -X GET "http://localhost:8080/simple?url=https://www.google.com&fill=red&back=yellow --output simple_qr.png"
  1. Radial QR Code 🎨

Endpoint: /radial

Method: GET or POST

Parameters:

  • url (required): The URL or text to encode into the QR code.

  • back (optional): The background color of the QR code (default: white).

  • gradient1 (optional): The first color of the radial gradient in RGB format only (default: (106,26,76))

  • gradient2 (optional): The second color of the radial gradient in RGB format only (default: (64,53,60))

Example:

curl -X POST "http://localhost:8080/radial?url=https://example.com&gradient1=(255,0,0)&gradient2=(0,0,255)&back=(255,255,255)" --output radial_qr.png

Additional Endpoints 🌐

  1. Health Check 🩺

Endpoint: /health

Method: GET or POST

Response:

{
 "status": "OK"
}
  1. Index πŸ“ƒ

Endpoint: /

Method: GET

Response: : The response is an HTML page wherer you can generate qr codes.


β­• Note: This README assumes that the API is running on the default host (0.0.0.0) and port (8080). Update the base URL accordingly if you choose to run the API on a different host or port.

Releases

No releases published

Packages

No packages published

Contributors 2

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /