Overview
Base URL: https://at1.to
Content-Type: application/json
Authentication: None required
Interactive Docs: Swagger UI
Batch Create Short Links
Creates multiple short links in a single request. Maximum 100 URLs per request.
Request Body:
{
"urls": [
"https://example.com/page1",
"https://example.com/page2",
"https://example.com/page3"
]
}
Response:
{
"message": "تم معالجة 3 رابط بنجاح",
"results": [
{
"originalUrl": "https://example.com/page1",
"shortLink": "https://at1.to/abc123XY",
"isNew": true
}
],
"summary": {
"total": 3,
"existing": 1,
"new": 2
}
}
Status Codes:
200 OK - Success
400 Bad Request - Invalid input
500 Error - Server error
Try it out:
Code Examples
JavaScript (fetch)
// Create short link
const response = await fetch('https://at1.to/api/v1/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url: 'https://example.com/my-url' })
});
const data = await response.json();
console.log(data.shortLink);
// Get statistics
const stats = await fetch('https://at1.to/api/v1/stats');
const statsData = await stats.json();
console.log(statsData);
cURL
# Create short link
curl -X POST https://at1.to/api/v1/ \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/my-url"}'
# Get statistics
curl https://at1.to/api/v1/stats
# Batch create
curl -X POST https://at1.to/api/v1/batch \
-H "Content-Type: application/json" \
-d '{"urls": ["https://example.com/1", "https://example.com/2"]}'
Python (requests)
import requests
# Create short link
response = requests.post('https://at1.to/api/v1/',
json={'url': 'https://example.com/my-url'})
data = response.json()
print(data['shortLink'])
# Get statistics
stats = requests.get('https://at1.to/api/v1/stats')
print(stats.json())