Skip to content

QR code API based on FastAPI. Supports Base64 encoded data and logo images.

License

Notifications You must be signed in to change notification settings

nessshon/qrcode-fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR Code Generator API

Overview

FastAPI-based API for generating QR codes with optional image inclusion. It supports both base64-encoded data and plain text. The API is designed to be fast, efficient, and easy to use, making it suitable for a variety of applications.

Features

  • Generate QR codes with optional image inclusion.
  • Support for both base64-encoded data and plain text.
  • Dockerized for easy deployment.
  • Asynchronous HTTP requests with aiohttp.
  • Utilizes caching for improved performance.

Live API Site

Access the QR Code API live at qrcode.ness.su.

Requirements

Ensure you have the following dependencies installed:

Installation

  1. Clone the repository:

    git clone https://github.com/nessshon/qrcode-fastapi.git
  2. Change into the project directory:

    cd qrcode-fastapi
  3. Build the Docker image:

    docker build -t qrcode-fastapi .
  4. Run the Docker container:

    docker run -p 8000:8000 qrcode-fastapi
  5. Access the API at http://localhost:8000

Usage

Endpoint: /create

  • Method: GET
  • Parameters:
    • data: Data or base64 encoded data to be encoded in QR code.
    • image_url: URL or base64 encoded URL of the image to be included in the QR code (optional).
    • border: QR code border size (0 to 50).
    • box_size: QR code box size (20 to 100).
  • Response: Generated QR code image in PNG format.

Example Generated QR Code Images

Here are some example QR code images generated using the Ness API. Feel free to scan these codes or use the provided URLs to see the results.

Text Only and Base64-Encoded Text

Image URL and Base64-Encoded Image URL

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

This project utilizes the following dependencies:

  • aiohttp - Asynchronous HTTP client/server framework.
  • cachetools - Extensible memoizing collections and decorators.
  • fastapi - Modern, fast (high-performance), web framework for building APIs with Python 3.7+.
  • lxml - XML and HTML processing library.
  • pillow - The Python Imaging Library adds image processing capabilities to your Python interpreter.
  • qrcode-styled - A QR Code generator with styles.
  • starlette - ASGI framework/toolkit for building high-performance asyncio services.
  • uvicorn - ASGI server implementation, using uvloop and httptools.

Releases

No releases published

Packages

No packages published