Skip to content

Create Your First Link

This guide walks through creating a short link, checking its analytics, and generating a QR code — all via the API.

  1. Create the link

    Terminal window
    curl -X POST https://xqr.co/api/v1/links \
    -H "Authorization: Bearer $XQR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"url": "https://example.com/landing", "custom_slug": "launch"}'
  2. Share the link

    Your link is live at https://xqr.co/launch. Share it in emails, social media, or print materials.

  3. Generate a QR code

    Terminal window
    curl "https://xqr.co/api/v1/links/${LINK_ID}/qr?format=png&size=20" \
    -H "Authorization: Bearer $XQR_API_KEY" \
    -o qr-code.png
  4. Check analytics

    Terminal window
    curl "https://xqr.co/api/v1/analytics/links/${LINK_ID}/stats" \
    -H "Authorization: Bearer $XQR_API_KEY"

    Response shows total scans, country breakdown, device types, and daily scan counts.

Was this page helpful?