REST API v1
Developer API Documentation
Integrate ultra-fast URL shortening, Google sharing links, and QR codes directly into your websites, bots, and backends. 100% Free forever.
1. Authentication
Every API request requires a Bearer token in the Authorization HTTP header. You can obtain your private API key from your Dashboard.
Authorization: Bearer vinit_live_xxxxxxxxxxxxxxxxxxxxxxxx
POST
/api/v1/links
Create a new short URL. The response returns both the direct short link and the Google sharing wrapper.
Request Body (JSON)
{
"destination_url": "https://example.com/target-page", // Required
"custom_slug": "special-promo", // Optional
"title": "My Campaign Link" // Optional
}
"destination_url": "https://example.com/target-page", // Required
"custom_slug": "special-promo", // Optional
"title": "My Campaign Link" // Optional
}
Response (201 Created)
{
"id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"slug": "special-promo",
"destination_url": "https://example.com/target-page",
"short_url": "https://your-domain.pages.dev/special-promo",
"google_sharing_url": "https://www.google.com/url?q=https%3A%2F%2F...",
"qr_code_url": "https://your-domain.pages.dev/api/qr?url=..."
}
"id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"slug": "special-promo",
"destination_url": "https://example.com/target-page",
"short_url": "https://your-domain.pages.dev/special-promo",
"google_sharing_url": "https://www.google.com/url?q=https%3A%2F%2F...",
"qr_code_url": "https://your-domain.pages.dev/api/qr?url=..."
}
Code Example (cURL)
curl -X POST https://your-domain.pages.dev/api/v1/links \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"destination_url":"https://example.com/target-page","custom_slug":"promo"}'
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"destination_url":"https://example.com/target-page","custom_slug":"promo"}'
GET
/api/v1/links
List the most recent 100 links created under your account with click counts and statuses.
Code Example (Python)
import requests
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get("https://your-domain.pages.dev/api/v1/links", headers=headers)
print(response.json())
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get("https://your-domain.pages.dev/api/v1/links", headers=headers)
print(response.json())