curl -X GET "https://snip.sa/api/urls?page=1&limit=20&search=campaign&sortBy=clickCount&sortOrder=desc" \
-H "X-API-Key: your_api_key_here"
const response = await axios.get('https://snip.sa/api/urls', {
params: {
page: 1,
limit: 20,
search: 'campaign',
sortBy: 'clickCount',
sortOrder: 'desc'
},
headers: {
'X-API-Key': 'your_api_key_here'
}
});
response = requests.get(
'https://snip.sa/api/urls',
params={
'page': 1,
'limit': 20,
'search': 'campaign',
'sortBy': 'clickCount',
'sortOrder': 'desc'
},
headers={'X-API-Key': 'your_api_key_here'}
)
{
"success": true,
"data": {
"urls": [
{
"_id": "507f1f77bcf86cd799439011",
"originalUrl": "https://example.com/page",
"shortCode": "abc123",
"title": "Campaign Link",
"clickCount": 150,
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"pages": 3
}
}
}
URLs
List URLs
Retrieve a paginated list of your shortened URLs
GET
/
api
/
urls
curl -X GET "https://snip.sa/api/urls?page=1&limit=20&search=campaign&sortBy=clickCount&sortOrder=desc" \
-H "X-API-Key: your_api_key_here"
const response = await axios.get('https://snip.sa/api/urls', {
params: {
page: 1,
limit: 20,
search: 'campaign',
sortBy: 'clickCount',
sortOrder: 'desc'
},
headers: {
'X-API-Key': 'your_api_key_here'
}
});
response = requests.get(
'https://snip.sa/api/urls',
params={
'page': 1,
'limit': 20,
'search': 'campaign',
'sortBy': 'clickCount',
'sortOrder': 'desc'
},
headers={'X-API-Key': 'your_api_key_here'}
)
{
"success": true,
"data": {
"urls": [
{
"_id": "507f1f77bcf86cd799439011",
"originalUrl": "https://example.com/page",
"shortCode": "abc123",
"title": "Campaign Link",
"clickCount": 150,
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"pages": 3
}
}
}
Query Parameters
Page number (minimum: 1)
Results per page (minimum: 1, maximum: 100)
Search in title, URL, or short code
Filter by tags (comma-separated)
Sort field:
createdAt, clickCount, or titleSort order:
asc or descFilter by active status
curl -X GET "https://snip.sa/api/urls?page=1&limit=20&search=campaign&sortBy=clickCount&sortOrder=desc" \
-H "X-API-Key: your_api_key_here"
const response = await axios.get('https://snip.sa/api/urls', {
params: {
page: 1,
limit: 20,
search: 'campaign',
sortBy: 'clickCount',
sortOrder: 'desc'
},
headers: {
'X-API-Key': 'your_api_key_here'
}
});
response = requests.get(
'https://snip.sa/api/urls',
params={
'page': 1,
'limit': 20,
'search': 'campaign',
'sortBy': 'clickCount',
'sortOrder': 'desc'
},
headers={'X-API-Key': 'your_api_key_here'}
)
{
"success": true,
"data": {
"urls": [
{
"_id": "507f1f77bcf86cd799439011",
"originalUrl": "https://example.com/page",
"shortCode": "abc123",
"title": "Campaign Link",
"clickCount": 150,
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"pages": 3
}
}
}
⌘I
