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.
- 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.
Access the QR Code API live at qrcode.ness.su.
Ensure you have the following dependencies installed:
- aiohttp (version 3.8.6)
- cachetools (version 5.3.2)
- fastapi (version 0.104.1)
- lxml (version 4.9.3)
- pillow (version 10.1.0)
- qrcode-styled (version 0.2.2)
- starlette (version 0.27.0)
- uvicorn (version 0.24.0)
-
Clone the repository:
git clone https://github.com/nessshon/qrcode-fastapi.git
-
Change into the project directory:
cd qrcode-fastapi
-
Build the Docker image:
docker build -t qrcode-fastapi .
-
Run the Docker container:
docker run -p 8000:8000 qrcode-fastapi
-
Access the API at http://localhost:8000
- 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.
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.
This project is licensed under the MIT License - see the LICENSE file for details.
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.