This documentation provides instructions for using the Pop-up Advertising System API. The API allows you to access statistics and information about your advertising campaigns, including daily statistics, country-specific data, and campaign performance.
All API requests require the apikey parameter. Your API key is available in your user dashboard.
/api/?action=daily_stats&apikey=YOUR_API_KEY
/api/?action=daily_stats
Returns daily visit statistics for all your campaigns. If no date is specified, returns data for the current day.
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | string | Required | Your API key for authentication |
| date | string | Optional | The date for which to retrieve statistics (format: YYYY-MM-DD). Defaults to current date if not specified. |
| campaign_id | integer | Optional | Filter results for a specific campaign ID |
/api/?action=daily_stats&apikey=6acd33a8997ceb782bbfc5d283f08145c8dccbd4cf7ff583407c2b89fcc22ef5
{
"status": "success",
"data": {
"date": "2025-03-23",
"total_visits": 127,
"campaigns": [
{
"id": 1,
"title": "Summer Sale",
"visits": 45
},
{
"id": 2,
"title": "New Product Launch",
"visits": 82
}
]
}
}
/api/?action=daily_stats&date=2025-03-21&campaign_id=1&apikey=6acd33a8997ceb782bbfc5d283f08145c8dccbd4cf7ff583407c2b89fcc22ef5
/api/?action=country_stats
Returns visit statistics organized by country for the specified date or date range.
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | string | Required | Your API key for authentication |
| date | string | Optional | The date for which to retrieve statistics (format: YYYY-MM-DD). Defaults to current date if not specified. |
| start_date | string | Optional | Start date for a date range (format: YYYY-MM-DD) |
| end_date | string | Optional | End date for a date range (format: YYYY-MM-DD) |
/api/?action=country_stats&date=2025-03-21&apikey=6acd33a8997ceb782bbfc5d283f08145c8dccbd4cf7ff583407c2b89fcc22ef5
{
"status": "success",
"data": {
"date": "2025-03-21",
"total_visits": 89,
"countries": [
{
"country_code": "US",
"country_name": "United States",
"visits": 35
},
{
"country_code": "GB",
"country_name": "United Kingdom",
"visits": 18
},
{
"country_code": "CA",
"country_name": "Canada",
"visits": 12
},
{
"country_code": "AU",
"country_name": "Australia",
"visits": 8
},
{
"country_code": "DE",
"country_name": "Germany",
"visits": 16
}
]
}
}
/api/?action=campaign_stats
Returns statistics for your campaigns for a specific month and year.
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | string | Required | Your API key for authentication |
| month | integer | Required | The month for which to retrieve statistics (1-12) |
| year | integer | Required | The year for which to retrieve statistics (e.g., 2025) |
| campaign_id | integer | Optional | Filter results for a specific campaign ID |
/api/?action=campaign_stats&month=3&year=2025&apikey=6acd33a8997ceb782bbfc5d283f08145c8dccbd4cf7ff583407c2b89fcc22ef5
{
"status": "success",
"data": {
"month": 3,
"year": 2025,
"total_visits": 2845,
"campaigns": [
{
"id": 1,
"title": "Summer Sale",
"visits": 1242,
"daily_breakdown": [
{
"date": "2025-03-01",
"visits": 42
},
{
"date": "2025-03-02",
"visits": 38
},
// Additional days...
]
},
{
"id": 2,
"title": "New Product Launch",
"visits": 1603,
"daily_breakdown": [
{
"date": "2025-03-01",
"visits": 53
},
{
"date": "2025-03-02",
"visits": 61
},
// Additional days...
]
}
]
}
}
/api/?action=create_account
Creates a new user account with random credentials and optional campaign settings. Requires admin API key.
| Parameter | Type | Required | Description |
|---|---|---|---|
| apikey | string | Required | Admin API key for authentication |
| max_popups | integer | Optional | Maximum number of popups (default: 2) |
| popup_interval | integer | Optional | Interval between popups in seconds (default: 30) |
| campaign1, campaign2, ... | string | Optional | Title of the campaign (paired with destination_url1, destination_url2, etc.) |
| destination_url1, destination_url2, ... | string | Optional | URL where users will be redirected (paired with campaign1, campaign2, etc.) |
/api/?action=create_account&apikey=ADMIN_API_KEY&max_popups=3&popup_interval=45
/api/?action=create_account&apikey=ADMIN_API_KEY&max_popups=3&popup_interval=45&campaign1=Mi Primera Campaña&destination_url1=https://ejemplo.com&campaign2=Mi Segunda Campaña&destination_url2=https://ejemplo2.com
{
"success": true,
"user": {
"username": "user_a1b2c3d4",
"password": "e5f6g7h8i9j0k1",
"apikey": "1234567890abcdef..."
},
"settings": {
"max_popups_per_minute": 3,
"popup_interval": 45
}
}
{
"success": true,
"user": {
"username": "user_a1b2c3d4",
"password": "e5f6g7h8i9j0k1",
"apikey": "1234567890abcdef..."
},
"settings": {
"max_popups_per_minute": 3,
"popup_interval": 45
},
"campaigns": [
{
"title": "Mi Primera Campaña",
"destination_url": "https://ejemplo.com"
},
{
"title": "Mi Segunda Campaña",
"destination_url": "https://ejemplo2.com"
}
]
}
When an error occurs, the API returns a JSON response with an error status and message.
{
"status": "error",
"message": "Error message description"
}
| Message | Description |
|---|---|
| Invalid API key | The provided API key is missing or invalid |
| Invalid action | The specified action parameter is not supported |
| Invalid date format | The date parameter is not in the required YYYY-MM-DD format |
| Invalid campaign ID | The specified campaign ID does not exist or does not belong to your account |
| Missing required parameter | A required parameter is missing from the request |