GET
/v1/adverts/images
List image adverts with multiple aspect ratios
Overview
Returns a paginated list of image-based advertising content. Each advert can have multiple aspect ratio versions (16:9, 9:16, 4:3, 3:4, 16:10, 10:16) to support different display orientations and sizes.
Aspect Ratios: Each advert may have multiple files for different screen ratios.
Request
Endpoint
HTTP Request
GET https://api.pixelsuite.com.au/v1/adverts/images
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page |
integer | No | 1 | Page number (min: 1) |
limit |
integer | No | 50 | Results per page (min: 1, max: 100) |
search |
string | No | - | Search by title (case-insensitive) |
Example Request
cURL
curl -X GET "https://api.pixelsuite.com.au/v1/adverts/images?search=sale" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
Success Response (200 OK)
JSON
{
"success": true,
"data": {
"adverts": [
{
"ID": 123,
"title": "Summer Sale 2024",
"description": "Promotional banner for summer sale",
"dateStart": "2024-06-01",
"dateEnd": "2024-08-31",
"dateCreated": "2024-05-15 10:00:00",
"thumbnail": {
"ID": 456,
"key": "adverts/thumbnails/summer-sale.jpg",
"displayName": "Summer Sale Thumbnail",
"mimeType": "image/jpeg",
"fileSize": 102400,
"dateCreated": "2024-05-15 10:00:00"
},
"aspectRatios": {
"16x9": {
"ID": 457,
"key": "adverts/summer-sale-16x9.jpg",
"displayName": "Summer Sale 16:9",
"mimeType": "image/jpeg",
"fileSize": 512000,
"dateCreated": "2024-05-15 10:00:00"
},
"9x16": {
"ID": 458,
"key": "adverts/summer-sale-9x16.jpg",
"displayName": "Summer Sale 9:16",
"mimeType": "image/jpeg",
"fileSize": 512000,
"dateCreated": "2024-05-15 10:00:00"
}
},
"isExpired": false,
"revision": 1
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 12,
"totalPages": 1,
"hasMore": false
}
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
ID |
integer | Advert ID |
title |
string | Advert title |
aspectRatios |
object | Available aspect ratio files (16x9, 9x16, 4x3, 3x4, 16x10, 10x16) |
thumbnail |
object | Thumbnail image file info |
isExpired |
boolean | Whether advert is past end date |
Use Cases
Content Library
Build a gallery view of all available image adverts for selection.
Responsive Displays
Select appropriate aspect ratio based on screen orientation and size.
Campaign Management
Track active, upcoming, and expired advertising campaigns.
Asset Download
Download image files using S3 keys for local storage and display.
Code Examples
PHP
<?php
$apiKey = 'YOUR_API_KEY';
$url = 'https://api.pixelsuite.com.au/v1/adverts/images?page=1&limit=20';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {$apiKey}"
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
if ($data['success']) {
foreach ($data['data']['adverts'] as $advert) {
echo "Advert: {$advert['title']}\n";
echo "Available ratios: " . implode(', ', array_keys($advert['aspectRatios'])) . "\n";
echo "Expired: " . ($advert['isExpired'] ? 'Yes' : 'No') . "\n\n";
}
}
curl_close($ch);
JavaScript
const apiKey = 'YOUR_API_KEY';
const url = 'https://api.pixelsuite.com.au/v1/adverts/images?page=1&limit=20';
fetch(url, {
headers: {
'Authorization': `Bearer ${apiKey}`
}
})
.then(res => res.json())
.then(data => {
if (data.success) {
data.data.adverts.forEach(advert => {
console.log(`Advert: ${advert.title}`);
console.log(`Available ratios: ${Object.keys(advert.aspectRatios).join(', ')}`);
console.log(`Expired: ${advert.isExpired ? 'Yes' : 'No'}\n`);
});
}
})
.catch(error => console.error('Error:', error));
Python
import requests
api_key = 'YOUR_API_KEY'
url = 'https://api.pixelsuite.com.au/v1/adverts/images'
headers = {
'Authorization': f'Bearer {api_key}'
}
params = {'page': 1, 'limit': 20}
response = requests.get(url, headers=headers, params=params)
data = response.json()
if data['success']:
for advert in data['data']['adverts']:
print(f"Advert: {advert['title']}")
print(f"Available ratios: {', '.join(advert['aspectRatios'].keys())}")
print(f"Expired: {'Yes' if advert['isExpired'] else 'No'}\n")