Skip to main content

1. Get an API key

Sign in to the SQR Dashboard and navigate to API Keys in the sidebar. Click Create Key and copy the token.
export SQR_KEY="your-api-key-here"

2. Pick a template

Templates define the metadata fields for a record. List the available templates:
curl https://yys-sqr-render-bsbe.onrender.com/api/templates
[
  {
    "id": "pharma",
    "name": "Pharmaceutical",
    "fields": [
      { "key": "product_name", "label": "Product Name", "type": "text", "required": true },
      { "key": "dosage", "label": "Dosage", "type": "text", "required": false }
    ]
  }
]

3. Create a record

Upload an image and metadata. SQR automatically encodes an invisible watermark and returns the watermarked image.
curl -X POST https://yys-sqr-render-bsbe.onrender.com/api/records \
  -H "Authorization: Bearer $SQR_KEY" \
  -F template_id=pharma \
  -F 'metadata={"product_name":"Aspirin","dosage":"100mg"}' \
  -F image=@label.jpg
{
  "success": true,
  "watermark_id": "SQR-A1B2C",
  "card": { "..." },
  "watermarked_image": "base64..."
}
Save watermark_id — this is the unique identifier encoded into your image.

4. Retrieve the record

curl https://yys-sqr-render-bsbe.onrender.com/api/records/SQR-A1B2C
The record is publicly readable — anyone who scans the watermark can look it up.

Next steps