{
  "openapi": "3.1.0",
  "info": {
    "title": "EventPics QR code image API",
    "version": "1.0.0",
    "summary": "Turn any text or URL into a QR code picture with one GET request.",
    "description": "A free, keyless image API: ask for a URL, get a QR code back as PNG or SVG.\n\n    https://event.pics/qr.png?data=https://example.com\n    https://event.pics/qr.svg?data=https://example.com&design=heart\n\nOnly `data` is required and every other parameter has a sensible default, so the shortest form already returns a usable 1024 pixel PNG (or a 512 pixel SVG) in black on white.\n\nThe heart design is the reason this API exists: the real, unmodified QR matrix is rotated by 45 degrees so that it forms the middle and the tip of a heart, and two decorative lobes on the same module grid close the silhouette. It is a scannable QR code, not a picture of one.\n\nPromises: the URL pattern is permanent and will not be versioned away; the API never answers a rendering request with 400; query strings are not logged, so what you encode is not recorded; pictures are immutable and cached for a year.\n\nThere is deliberately no logo parameter, because that would mean fetching a foreign image on the server. Logos are a browser feature of the interactive generator.\n\nThe separate upload API for EventPics albums is described in https://event.pics/openapi.yaml",
    "contact": {
      "name": "Aigner Software e. U.",
      "url": "https://event.pics/en/legal-notice.html"
    },
    "license": {
      "name": "Free to use, no attribution required",
      "url": "https://event.pics/en/terms.html"
    }
  },
  "servers": [
    {
      "url": "https://event.pics",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Interactive generator with the same renderer, plus the parameter table",
    "url": "https://event.pics/en/qr-code-generator.html#qr-image-api"
  },
  "tags": [
    {
      "name": "QR",
      "description": "QR code pictures"
    }
  ],
  "paths": {
    "/qr.png": {
      "get": {
        "operationId": "getQrPNG",
        "summary": "QR code as PNG",
        "description": "Renders the QR code and returns it as image/png. No authentication. Invalid parameter values never cause an error response: they are clamped or replaced by the default, and x-ep-qr-notes says what happened. Unknown parameters are ignored and named in x-ep-qr-notes. URL-encode data when the link has its own & or #; an unencoded link is repaired where possible. Query strings are not logged.",
        "parameters": [
          {
            "name": "data",
            "in": "query",
            "required": false,
            "description": "Text or URL to encode. Up to 1200 characters; longer input is truncated. The only parameter that really matters.",
            "schema": {
              "type": "string",
              "maxLength": 1200,
              "default": "https://event.pics"
            },
            "example": "https://event.pics"
          },
          {
            "name": "design",
            "in": "query",
            "required": false,
            "description": "Square QR code, or a real heart shape built from the rotated module matrix. The heart always uses error correction H and never carries a logo.",
            "schema": {
              "type": "string",
              "enum": [
                "standard",
                "heart"
              ],
              "default": "standard"
            }
          },
          {
            "name": "dots",
            "in": "query",
            "required": false,
            "description": "Shape of the data modules.",
            "schema": {
              "type": "string",
              "enum": [
                "square",
                "dots",
                "rounded",
                "extra-rounded",
                "classy",
                "classy-rounded"
              ],
              "default": "rounded"
            }
          },
          {
            "name": "eyes",
            "in": "query",
            "required": false,
            "description": "Shape of the three outer finder patterns.",
            "schema": {
              "type": "string",
              "enum": [
                "square",
                "dot",
                "rounded",
                "extra-rounded",
                "dots"
              ],
              "default": "extra-rounded"
            }
          },
          {
            "name": "eyesInner",
            "in": "query",
            "required": false,
            "description": "Shape of the inner finder patterns.",
            "schema": {
              "type": "string",
              "enum": [
                "square",
                "dot",
                "rounded",
                "extra-rounded",
                "dots"
              ],
              "default": "extra-rounded"
            }
          },
          {
            "name": "fg",
            "in": "query",
            "required": false,
            "description": "Foreground colour as #rrggbb, rrggbb, #rgb, or a basic CSS colour name. Default 000000, or c1272d for the heart design.",
            "schema": {
              "type": "string",
              "default": "000000"
            },
            "example": "c1272d"
          },
          {
            "name": "bg",
            "in": "query",
            "required": false,
            "description": "Background colour, same spellings, or transparent.",
            "schema": {
              "type": "string",
              "default": "ffffff"
            }
          },
          {
            "name": "ecl",
            "in": "query",
            "required": false,
            "description": "Error correction level. Ignored for the heart design, which always uses H.",
            "schema": {
              "type": "string",
              "enum": [
                "L",
                "M",
                "Q",
                "H"
              ],
              "default": "Q"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "Edge length of the picture in pixels. Values outside the range are clamped.",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 3000,
              "default": 1024
            }
          },
          {
            "name": "margin",
            "in": "query",
            "required": false,
            "description": "Width of the empty border (quiet zone) around the code, counted in modules. 4 is what the QR specification asks for; 0 draws the code edge to edge. The heart design never goes below 2. Values outside the range are clamped.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 20,
              "default": 4
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "Set to 1 to receive a Content-Disposition attachment header.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The QR code picture.",
            "headers": {
              "Cache-Control": {
                "description": "public, max-age=31536000, immutable",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Strong validator; send it back as If-None-Match to get a 304.",
                "schema": {
                  "type": "string"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always *",
                "schema": {
                  "type": "string"
                }
              },
              "x-ep-qr-notes": {
                "description": "Present only when a parameter was clamped, replaced or ignored. Semicolon separated, human readable.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ep-qr-cache": {
                "description": "hit or miss, for debugging only.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "Unchanged, because If-None-Match matched the ETag."
          },
          "429": {
            "description": "Too many uncached requests from one address. Retry-After says when to come back."
          }
        },
        "tags": [
          "QR"
        ]
      }
    },
    "/qr.svg": {
      "get": {
        "operationId": "getQrSVG",
        "summary": "QR code as SVG",
        "description": "Renders the QR code and returns it as image/svg+xml. No authentication. Invalid parameter values never cause an error response: they are clamped or replaced by the default, and x-ep-qr-notes says what happened. Unknown parameters are ignored and named in x-ep-qr-notes. URL-encode data when the link has its own & or #; an unencoded link is repaired where possible. Query strings are not logged.",
        "parameters": [
          {
            "name": "data",
            "in": "query",
            "required": false,
            "description": "Text or URL to encode. Up to 1200 characters; longer input is truncated. The only parameter that really matters.",
            "schema": {
              "type": "string",
              "maxLength": 1200,
              "default": "https://event.pics"
            },
            "example": "https://event.pics"
          },
          {
            "name": "design",
            "in": "query",
            "required": false,
            "description": "Square QR code, or a real heart shape built from the rotated module matrix. The heart always uses error correction H and never carries a logo.",
            "schema": {
              "type": "string",
              "enum": [
                "standard",
                "heart"
              ],
              "default": "standard"
            }
          },
          {
            "name": "dots",
            "in": "query",
            "required": false,
            "description": "Shape of the data modules.",
            "schema": {
              "type": "string",
              "enum": [
                "square",
                "dots",
                "rounded",
                "extra-rounded",
                "classy",
                "classy-rounded"
              ],
              "default": "rounded"
            }
          },
          {
            "name": "eyes",
            "in": "query",
            "required": false,
            "description": "Shape of the three outer finder patterns.",
            "schema": {
              "type": "string",
              "enum": [
                "square",
                "dot",
                "rounded",
                "extra-rounded",
                "dots"
              ],
              "default": "extra-rounded"
            }
          },
          {
            "name": "eyesInner",
            "in": "query",
            "required": false,
            "description": "Shape of the inner finder patterns.",
            "schema": {
              "type": "string",
              "enum": [
                "square",
                "dot",
                "rounded",
                "extra-rounded",
                "dots"
              ],
              "default": "extra-rounded"
            }
          },
          {
            "name": "fg",
            "in": "query",
            "required": false,
            "description": "Foreground colour as #rrggbb, rrggbb, #rgb, or a basic CSS colour name. Default 000000, or c1272d for the heart design.",
            "schema": {
              "type": "string",
              "default": "000000"
            },
            "example": "c1272d"
          },
          {
            "name": "bg",
            "in": "query",
            "required": false,
            "description": "Background colour, same spellings, or transparent.",
            "schema": {
              "type": "string",
              "default": "ffffff"
            }
          },
          {
            "name": "ecl",
            "in": "query",
            "required": false,
            "description": "Error correction level. Ignored for the heart design, which always uses H.",
            "schema": {
              "type": "string",
              "enum": [
                "L",
                "M",
                "Q",
                "H"
              ],
              "default": "Q"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "Display size of the SVG in pixels (its width and height attributes); the drawing itself is vector and stays sharp at any size. Values outside the range are clamped.",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 3000,
              "default": 512
            }
          },
          {
            "name": "margin",
            "in": "query",
            "required": false,
            "description": "Width of the empty border (quiet zone) around the code, counted in modules. 4 is what the QR specification asks for; 0 draws the code edge to edge. The heart design never goes below 2. Values outside the range are clamped.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 20,
              "default": 4
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "Set to 1 to receive a Content-Disposition attachment header.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The QR code picture.",
            "headers": {
              "Cache-Control": {
                "description": "public, max-age=31536000, immutable",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Strong validator; send it back as If-None-Match to get a 304.",
                "schema": {
                  "type": "string"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always *",
                "schema": {
                  "type": "string"
                }
              },
              "x-ep-qr-notes": {
                "description": "Present only when a parameter was clamped, replaced or ignored. Semicolon separated, human readable.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ep-qr-cache": {
                "description": "hit or miss, for debugging only.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/svg+xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "Unchanged, because If-None-Match matched the ETag."
          },
          "429": {
            "description": "Too many uncached requests from one address. Retry-After says when to come back."
          }
        },
        "tags": [
          "QR"
        ]
      }
    },
    "/qr": {
      "get": {
        "operationId": "getQrHelp",
        "tags": [
          "QR"
        ],
        "summary": "Documentation (HTML in a browser, plain text otherwise), or a PNG when parameters are given",
        "description": "Called without parameters this returns the documentation with status 200: an HTML page for browsers and crawlers (Accept: text/html), a short plain text description for everything else. Called with parameters it renders a PNG, exactly like /qr.png, so a guessed URL still works.",
        "parameters": [
          {
            "name": "data",
            "in": "query",
            "required": false,
            "description": "Text or URL to encode. Up to 1200 characters; longer input is truncated. The only parameter that really matters.",
            "schema": {
              "type": "string",
              "maxLength": 1200,
              "default": "https://event.pics"
            },
            "example": "https://event.pics"
          },
          {
            "name": "design",
            "in": "query",
            "required": false,
            "description": "Square QR code, or a real heart shape built from the rotated module matrix. The heart always uses error correction H and never carries a logo.",
            "schema": {
              "type": "string",
              "enum": [
                "standard",
                "heart"
              ],
              "default": "standard"
            }
          },
          {
            "name": "dots",
            "in": "query",
            "required": false,
            "description": "Shape of the data modules.",
            "schema": {
              "type": "string",
              "enum": [
                "square",
                "dots",
                "rounded",
                "extra-rounded",
                "classy",
                "classy-rounded"
              ],
              "default": "rounded"
            }
          },
          {
            "name": "eyes",
            "in": "query",
            "required": false,
            "description": "Shape of the three outer finder patterns.",
            "schema": {
              "type": "string",
              "enum": [
                "square",
                "dot",
                "rounded",
                "extra-rounded",
                "dots"
              ],
              "default": "extra-rounded"
            }
          },
          {
            "name": "eyesInner",
            "in": "query",
            "required": false,
            "description": "Shape of the inner finder patterns.",
            "schema": {
              "type": "string",
              "enum": [
                "square",
                "dot",
                "rounded",
                "extra-rounded",
                "dots"
              ],
              "default": "extra-rounded"
            }
          },
          {
            "name": "fg",
            "in": "query",
            "required": false,
            "description": "Foreground colour as #rrggbb, rrggbb, #rgb, or a basic CSS colour name. Default 000000, or c1272d for the heart design.",
            "schema": {
              "type": "string",
              "default": "000000"
            },
            "example": "c1272d"
          },
          {
            "name": "bg",
            "in": "query",
            "required": false,
            "description": "Background colour, same spellings, or transparent.",
            "schema": {
              "type": "string",
              "default": "ffffff"
            }
          },
          {
            "name": "ecl",
            "in": "query",
            "required": false,
            "description": "Error correction level. Ignored for the heart design, which always uses H.",
            "schema": {
              "type": "string",
              "enum": [
                "L",
                "M",
                "Q",
                "H"
              ],
              "default": "Q"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "Edge length of the picture in pixels. Values outside the range are clamped.",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 3000,
              "default": 1024
            }
          },
          {
            "name": "margin",
            "in": "query",
            "required": false,
            "description": "Width of the empty border (quiet zone) around the code, counted in modules. 4 is what the QR specification asks for; 0 draws the code edge to edge. The heart design never goes below 2. Values outside the range are clamped.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 20,
              "default": 4
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "Set to 1 to receive a Content-Disposition attachment header.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Instructions, or the QR code picture.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    }
  }
}
