The knowledgebase is a categorized collection of answers to frequently asked questions (FAQ) and articles. You can read articles in this category or select a subcategory that you are interested in.
This document provides instructions for using the Pixfuture API to retrieve performance statistics. The API supports retrieving data for yesterday's stats and the previous week's stats using HTTP GET requests with basic authentication.
The Pixfuture API allows publishers to retrieve performance statistics for their account. The API uses HTTP GET requests with basic authentication and returns data in JSON format. This manual covers two endpoints: one for retrieving yesterday's stats and another for the previous week's stats.
The API uses basic HTTP authentication. You must include your username and password in each request.
publisheruser@domain.com
)12345
)-H "Accept: application/json"
to specify that the response should be in JSON format.Note: Ensure your credentials are kept secure and not shared publicly.
Retrieve performance statistics for the previous day.
https://pub-api.pixfuture.com/api/yesterday-stats
Accept: application/json
Example Request:
curl -u user123@domain.com:12345 -X GET https://pub-api.pixfuture.com/api/yesterday-stats \
-H "Accept: application/json"
Retrieve performance statistics for the previous week.
https://pub-api.pixfuture.com/api/previous-week-stats
Accept: application/json
Example Request:
curl -u user123@domain.com:12345 -X GET https://pub-api.pixfuture.com/api/previous-week-stats \
-H "Accept: application/json"
Both endpoints return data in JSON format. The response includes performance metrics for the specified period, such as account ID, site name, impressions, and revenue. Current time in UTC, with the week starting on Monday (ISO 8601 standard).
A typical response may look like:
{
"data": [
{
"accountid": 10103,
"sitename": "Your domain URL",
"impressions": 199,
"revenue": 0.024793952886284387
},
{
"accountid": 10104,
"sitename": "Your domain URL",
"impressions": 333,
"revenue": 0.53332886284387
}
]
}
10103
).https://www.publisherdomain.com
).199
).0.024793952886284387
).For yesterday-stats
, the data reflects metrics for a single day. For previous-week-stats
, the data may represent aggregated metrics for the week or a breakdown by day, depending on the API configuration. Refer to Pixfuture's API documentation for additional fields or variations.
To retrieve yesterday's stats using curl
:
curl -u user123@domain.com:12345 -X GET https://pub-api.pixfuture.com/api/yesterday-stats \
-H "Accept: application/json"
To retrieve previous week's stats using curl
:
curl -u user123@domain.com:12345 -X GET https://pub-api.pixfuture.com/api/previous-week-stats \
-H "Accept: application/json"
You can use the requests
library in Python to make API calls:
import requests
from requests.auth import HTTPBasicAuth
# Yesterday's Stats
response = requests.get(
"https://pub-api.pixfuture.com/api/yesterday-stats",
auth=HTTPBasicAuth("user123@domain.com", "12345"),
headers={"Accept": "application/json"}
)
print(response.json())
# Previous Week's Stats
response = requests.get(
"https://pub-api.pixfuture.com/api/previous-week-stats",
auth=HTTPBasicAuth("user123@domain.com", "12345"),
headers={"Accept": "application/json"}
)
print(response.json())
You can use PHP's curl
functions to make API calls:
<?php
$username = "user123@domain.com";
$password = "12345";
// Yesterday's Stats
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://pub-api.pixfuture.com/api/yesterday-stats");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
// Previous Week's Stats
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://pub-api.pixfuture.com/api/previous-week-stats");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
?>
Common errors include:
Accept: application/json
header is included.Always check the status
field in the response to confirm the request was successful.
For issues or further assistance, contact Pixfuture support at:
Article ID: 74
Category: Publishers