QRBatch Create API Documentation

Overview

This API creates batch QR code tasks. It accepts JSON, POST form, or GET parameters. Missing fields fall back to default values.


Endpoint

https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php

Required Parameters

  • contents (required): QR data, e.g. ["123","456"]
  • token (required): Authentication / account quota. Get token

Payload Example

{   
  "contents": [ // QR content, required; supports array or string (split by newline)
    "123"
  ], 
  "file_name_type": 1, // File name type: 1 by index, 2 by content
  "labels": [],  // Labels (optional), supports array or string 
  "names": [],  // Names (optional), supports array or string 
  "color": {   
    "bg_color": "255,255,255", // Background color (default)
    "font_color": "#000000", // Font color (default)
    "front_color": "#000000" // QR color
  },
  "base": {
    "size": 200, // QR size, default 200px
    "transparent": false, // Transparent background, default false
    "dpi": 96, // DPI, default 96
    "margin": 10, // Margin, default 10px
    "img_type": 1, // Image type: 1 PNG, 2 JPEG (default PNG)
    "fault": "Medium-High" // Error correction, default Medium-High
  },
  "logo": {
    "size": 2, // Logo size, default 20%
    "file": "" // Logo file path (optional)
  },
  "label_setting": {
    "font_type": 1, // Font type: 1 system, 2 custom (default system)
    "font_size": 15, // Font size, default 15px
    "margin": 10, // Label margin, default 10px
    "location": "bottom", // Label position: bottom/top/left/right (default bottom)
    "line_type": 1, // Line type: 1 solid, 2 dashed (default solid)
    "use_content": 1, // Use content as label, default true
    "show_label": 0 // Show label, default false
  },
  "token": "YOUR_TOKEN"
}

Frontend Request (jQuery $.ajax)

$.ajax({
  type: "post",
  url: "https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php",
  data: {
    contents: ["1", "2", "3"],
    file_name_type: 1,
    token: "YOUR_TOKEN"
  },
  dataType: "json",
  success: function(result) {
    console.log(result);
  },
  error: function(xhr) {
    console.error(xhr.responseText);
  }
});

Tip: By default requests use application/x-www-form-urlencoded; arrays serialize as contents[]=.... To send JSON, set contentType: "application/json" and replace data with JSON.stringify({...}).

Language Examples

All examples use JSON (recommended). Replace YOUR_TOKEN with your auth code, or click the “Get token” button above to auto-fill.

curl

curl -X POST "https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": ["1", "2", "3"],
    "file_name_type": 1,
    "token": "YOUR_TOKEN"
  }'

JavaScript (fetch)

fetch('https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    contents: ['1', '2', '3'],
    file_name_type: 1,
    token: 'YOUR_TOKEN'
  })
}).then(res => res.json())
  .then(console.log)
  .catch(console.error);

Python (requests)

import requests

url = "https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php"
payload = {
    "contents": ["1", "2", "3"],
    "file_name_type": 1,
    "token": "YOUR_TOKEN"
}
resp = requests.post(url, json=payload, timeout=30)
print(resp.json())

PHP (cURL)

 ['1', '2', '3'],
  'file_name_type' => 1,
  'token' => 'YOUR_TOKEN'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
echo $res;

Node.js (axios)

const axios = require('axios');

const url = 'https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php';
const payload = {
  contents: ['1', '2', '3'],
  file_name_type: 1,
  token: 'YOUR_TOKEN'
};

axios.post(url, payload)
  .then(res => console.log(res.data))
  .catch(err => console.error(err.response?.data || err.message));

Go (net/http)

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    url := "https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php"
    payload := map[string]interface{}{
        "contents": []string{"1", "2", "3"},
        "file_name_type": 1,
        "token": "YOUR_TOKEN",
    }
    b, _ := json.Marshal(payload)
    resp, err := http.Post(url, "application/json", bytes.NewBuffer(b))
    if err != nil { panic(err) }
    defer resp.Body.Close()
    var out map[string]interface{}
    json.NewDecoder(resp.Body).Decode(&out)
    fmt.Println(out)
}

Request Methods

  • POST JSON (recommended): Content-Type: application/json
  • POST Form: application/x-www-form-urlencoded

Auth & Rate Limits

  • Required fields: data or contents (QR data)
  • Error codes: 301 (missing token), 302 (sign-in failed), 303 (daily quota exhausted), 304 (single request quota exceeded)

Response Examples

Success:

{ "code": 0, "msg": "success", "data": { "zip_name": "QRBatch", "zip_path": "/path/to/output.zip", "count": 2 }

Error (missing token):

{ "code": 301, "msg": "Token not filled in" }

Notes

  • If a string field contains nested JSON (e.g., color, base, logo, labels, contents), it is parsed automatically.
  • If contents is a non-JSON string, it is treated as a single-item array.
  • Missing fields use default values; see the “Defaults” above.
  • The API enforces IP blacklists, authorization, and rate limits. Ensure legitimate usage.

Contact Support

Support: [email protected]