Copied!
L i n k s

API

API documentation

Create an account, open Developers, generate your single API key, then call the API with Authorization: Bearer urlz_... (preferred). Query ?key= works for scripts — never embed keys in public pages or image URLs.

Authentication

One API key per account. Prefer Authorization: Bearer urlz_.... Optional IP and Origin allowlists: when set, every request must match (Origin/Referer for browser calls; leave Origins empty for server-to-server and use IPs instead).

# Preferred
curl -H "Authorization: Bearer urlz_your_key" "https://urlz.ca/api/v1/shorten?url=https%3A%2F%2Fexample.com"

# Scripts only (avoid in public HTML / img src)
https://urlz.ca/api/v1/shorten?url=https%3A%2F%2Fexample.com&key=urlz_your_key

GET /api/v1/shorten

Create a short URL (also accepts POST JSON). Requires an API key.

GET https://urlz.ca/api/v1/shorten?url=https%3A%2F%2Fexample.com&alias=my-clean-link&key=urlz_your_key

browser

https://urlz.ca/api/v1/shorten?url=https%3A%2F%2Fexample.com&alias=my-clean-link&key=urlz_your_key

bash

curl "https://urlz.ca/api/v1/shorten?url=https%3A%2F%2Fexample.com&alias=optional&key=urlz_your_key"

javascript

const response = await fetch('https://urlz.ca/api/v1/shorten?url=' + encodeURIComponent('https://example.com'), {
  headers: { Authorization: 'Bearer urlz_your_key' }
});
const data = await response.json();

python

import requests
print(requests.get('https://urlz.ca/api/v1/shorten', params={'url': 'https://example.com'}, headers={'Authorization': 'Bearer urlz_your_key'}).json())

GET /api/v1/qr

Returns a PNG/SVG image for any website URL. API key required on every request (counts toward daily Actions). URLZ never fetches the destination.

Browser URL

Paste in the address bar. Replace urlz_your_key with your key from Developers. Bare domains work — https:// is added automatically when missing.

https://urlz.ca/api/v1/qr/hostinger.com?format=png&key=urlz_your_key
https://urlz.ca/api/v1/qr?url=hostinger.com&format=png&key=urlz_your_key
https://urlz.ca/api/v1/qr?url=https%3A%2F%2Fwww.hostinger.com&format=png&key=urlz_your_key

curl (Bearer — preferred for apps):

curl -H "Authorization: Bearer urlz_your_key" \
  "https://urlz.ca/api/v1/qr?url=hostinger.com&format=png" -o qr.png

Website QR page uses same-origin routes (no API key). Sample below is that path, not the keyed API.

Errors

{
  "success": false,
  "error": {
    "code": "INVALID_URL",
    "message": "The supplied URL is invalid."
  }
}

Common codes: INVALID_URL, RATE_LIMITED, DAILY_QUOTA_EXCEEDED, INVALID_API_KEY, API_IP_NOT_ALLOWED, API_ORIGIN_NOT_ALLOWED.