Welcome to the OrionLinks API! This RESTful API allows you to programmatically create and manage short links.
https://www.orionlinks.orionscripts.com/api
All API requests require authentication using Bearer tokens.
Obtain an API token
{
"email": "user@example.com",
"password": "your-password"
}
{
"success": true,
"message": "Login successful",
"data": {
"user": {
"id": 1,
"name": "John Doe",
"email": "user@example.com"
},
"token": "1|abc123..."
}
}
Authorization: Bearer YOUR_TOKEN_HERE
Get all your links
page - Page number (default: 1)per_page - Items per page (default: 15, max: 100){
"success": true,
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"short_code": "abc123",
"original_url": "https://example.com",
"clicks_count": 42,
"created_at": "2025-12-14T10:00:00.000000Z"
}
],
"total": 10
}
}
Create a new short link
{
"url": "https://example.com/very-long-url",
"custom_alias": "mylink", // optional
"password": "secret123", // optional
"expires_at": "2025-12-31", // optional
"click_limit": 1000 // optional
}
{
"success": true,
"message": "Link created successfully",
"data": {
"id": 1,
"short_url": "https://www.orionlinks.orionscripts.com/abc123",
"short_code": "abc123",
"original_url": "https://example.com/very-long-url",
"qr_code_url": "https://www.orionlinks.orionscripts.com/links/1/qrcode"
}
}
Get detailed statistics for a link
{
"success": true,
"data": {
"total_clicks": 150,
"by_country": [...],
"by_device": [...],
"by_browser": [...],
"recent_clicks": [...]
}
}
Create multiple links at once (max 100)
{
"links": [
{ "url": "https://example.com/page1" },
{ "url": "https://example.com/page2", "custom_alias": "page2" }
]
}
Delete a link
{
"success": true,
"message": "Link deleted successfully"
}
The API uses standard HTTP status codes:
200 - Success201 - Created400 - Bad Request401 - Unauthorized404 - Not Found422 - Validation Error500 - Server Error{
"success": false,
"message": "Error description",
"errors": {
"field": ["Validation error message"]
}
}
const response = await fetch('https://www.orionlinks.orionscripts.com/api/links', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
url: 'https://example.com'
})
});
const data = await response.json();
console.log(data.data.short_url);
$ch = curl_init('https://www.orionlinks.orionscripts.com/api/links');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer YOUR_TOKEN'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'url' => 'https://example.com'
]));
$response = curl_exec($ch);
$data = json_decode($response, true);
echo $data['data']['short_url'];
import requests
response = requests.post('https://www.orionlinks.orionscripts.com/api/links',
headers={'Authorization': 'Bearer YOUR_TOKEN'},
json={'url': 'https://example.com'}
)
data = response.json()
print(data['data']['short_url'])