Skip to main content

Overview

Traditional QR codes are uniform and monotonous. AI Art QR codes can integrate brand elements into the QR code design to improve scan rates. Ace Data Cloud’s QR Art API supports multiple preset artistic styles.

Involved Services

  • QR Art: POST https://api.acedata.cloud/qrart/generate

Technical Solution

Prerequisites

  1. Register an account at Ace Data Cloud
  2. Obtain an API Token
  3. Install Python 3.7+ and the requests library

Implementation Steps

Step 1: Set QR Code Content

Choose the type (link/text/email/phone) and set the content.

Step 2: Select Artistic Style

Use the preset parameter to select a preset style, such as sunset, floral, neon-mech.

Step 3: Generate and Download

Call the /qrart/generate endpoint to generate, and query progress via /qrart/tasks.

Code Example

Below is a complete Python example using QR Art:
import requests

API_TOKEN = "YOUR_API_TOKEN"

def call_qrart():
    response = requests.post(
        "https://api.acedata.cloud/qrart/generate",
        headers={
            "Authorization": f"Bearer {API_TOKEN}",
            "Content-Type": "application/json",
        },
        json={
    "type": "link",
    "content": "https://platform.acedata.cloud",
    "prompt": "sunset ocean waves",
    "preset": "neon-mech"
},
    )
    return response.json()

result = call_qrart()
print(result)

Best Practices

  • Error Retry: Implement exponential backoff retries for 429 (rate limiting) and 5xx errors
  • Asynchronous Handling: For time-consuming tasks (image/video generation), use callback_url to receive results asynchronously
  • Cost Control: Monitor usage and expenses via the Ace Data Cloud console
  • Token Security: Store API Tokens in environment variables; avoid hardcoding them in code