Last revised: 26 April, 2025
This documentation outlines how to interact with the pack.page API for creating and managing shortened links for users with custom domain deployments.
Fill out the form below to generate sample code to integrate into your project.
# Click "Generate Code" to create a cURL command
# Click "Generate Code" to create Python code
# Click "Generate Code" to create JavaScript code
Authentication is required for private domain endpoints. Include your API key in the request header:
X-API-Key: your_api_key_here
Note: Your API key is specific to your custom domain and is provided during domain setup. Keep your API key secure and never expose it in client-side code.
POST https://your-domain.com/ify
Content-Type: application/json X-API-Key: your_api_key_here
{ "url": "https://example.com/very/long/path/to/shorten", "mode": 1, // Optional: 0=1hr, 1=2days, 2=2weeks, 3=6months "keyboard": "qwerty", // Optional: keyboard layout for link generation "passphrase": "secret", // Optional: for bookmarking links "friendly_name": "Example Link" // Optional: requires passphrase }
"https://your-domain.com/a1b2c3"
Status Code | Description |
---|---|
400 | Invalid URL or parameters |
403 | Invalid API key |
404 | Domain not found |
import requests import json url = "https://your-domain.com/ify" api_key = "your_api_key_here" headers = { "Content-Type": "application/json", "X-API-Key": api_key } payload = { "url": "https://example.com/very/long/path/to/shorten", "mode": 2, "keyboard": "qwerty" } response = requests.post(url, headers=headers, data=json.dumps(payload)) if response.status_code == 200: shortened_url = response.json() print(f"Shortened URL: {shortened_url}") else: print(f"Error: {response.status_code} - {response.text}")
fetch('https://your-domain.com/ify', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'your_api_key_here' }, body: JSON.stringify({ url: 'https://example.com/very/long/path/to/shorten', mode: 2, keyboard: 'qwerty' }) }) .then(response => { if (response.ok) { return response.json(); } throw new Error(`HTTP error ${response.status}`); }) .then(shortenedUrl => { console.log('Shortened URL:', shortenedUrl); }) .catch(error => { console.error('Error:', error); });
curl -X POST https://pack.page/ify \ -H "Content-Type: application/json" \ -H "X-API-Key: your_api_key_here" \ -d '{ "url": "https://example.com/very/long/path/to/shorten", "mode": 2, "keyboard": "qwerty" }'
To ensure fair usage and service stability as outlined in our terms of service, the following rate limits apply:
Note: Enterprise customers with custom domains may request adjusted rate limits by contacting support.
For information about custom domain deployment, please contact us at [email protected] and a member of our brainpolo team will be in touch shortly.