curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/ads/facebook/spend?accountId=1234567890
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/facebook/spend?accountId=1234567890", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/ads/facebook/spend', headers=headers)
print(r.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/ads/facebook/spend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error: " . $err;
} else {
echo $response;
}
?>
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer API_KEY");
var response = await client.GetAsync("https://api.ayrshare.com/api/ads/facebook/spend");
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.ayrshare.com/api/ads/facebook/spend", nil)
req.Header.Add("Authorization", "Bearer API_KEY")
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class GetAdSpend {
public static void main(String[] args) {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.ayrshare.com/api/ads/facebook/spend"))
.header("Authorization", "Bearer API_KEY")
.GET()
.build();
try {
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI.parse('https://api.ayrshare.com/api/ads/facebook/spend')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
puts response.body
{
"status": "success",
"history": [
{
"adId": "6683876017501",
"adName": "API Post 1 - DE6gpw8kxlonHy6eb7L1 - 2025-03-30T17:11:26",
"budgetDaily": 4,
"budgetType": "daily",
"deliveryStatus": "ACTIVE",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 3,
"impressions": 1035,
"reach": 1026,
"frequency": 0,
"ctr": 0,
"cpm": 1.53,
"cpp": 1.54,
"cpc": 0
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7L1",
"spend": 1.58,
"spendDate": "2025-04-02T00:00:00.000Z",
"status": "ACTIVE"
},
{
"adId": "120218167147110411",
"adName": "API Post 2 - DE6gpw8kxlonHy6eb7L1 - 2025-03-30T16:41:15",
"budgetDaily": 4,
"budgetType": "daily",
"deliveryStatus": "ACTIVE",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 4,
"impressions": 1036,
"reach": 1011,
"frequency": 0,
"ctr": 0,
"cpm": 1.61,
"cpp": 1.65,
"cpc": 0
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7L1",
"spend": 1.67,
"spendDate": "2025-04-02T00:00:00.000Z",
"status": "ACTIVE"
}
],
"dateRange": {
"start": "2025-02-24T20:02:34.613Z",
"end": "2025-03-26T20:02:34.613Z",
"postId": "eSNkaAiFZVin6wm6f"
},
"metrics": {
"totalSpend": 3.25,
"totalClicks": 7,
"totalImpressions": 2071,
"totalReach": 2052,
"averageCTR": 0.1,
"averageFrequency": 0,
"cpm": 0.79,
"cpp": 0.85,
"cpc": 0.2,
"costPerResult": 1.2,
"byGoalType": {
"engagement": {
"spend": 7.62,
"impressions": 9332,
"clicks": 0,
"reach": 8502,
"count": 8,
"ctr": 0,
"cpm": 0.8165452207458208,
"cpp": 0.8962597035991532,
"cpc": 0
}
},
"byGoalTitle": {
"Get More Engagement": {
"spend": 3.25,
"impressions": 2071,
"clicks": 7,
"reach": 2052,
"count": 1,
"type": "engagement",
"ctr": 0.1,
"cpm": 0.79,
"cpp": 0.85,
"cpc": 0.2
}
},
"goalPerformance": {
"bestPerformingGoalType": {
"type": "engagement",
"clicks": 7,
"spend": 3.25,
"ctr": 0.1
},
"mostEfficientGoalType": {
"type": "engagement",
"cpc": 0.2,
"spend": 3.25
}
},
"count": 2,
"firstDay": "2025-03-17T00:00:00.000Z",
"lastDay": "2025-03-23T00:00:00.000Z"
}
}
{
"status": "success",
"history": [
{
"accountId": "274948332",
"adId": "6683876017505",
"adName": "API Post 13 - DE6gpw8kxlonHy6eb7Lo - 2025-03-30T17:11:26",
"budgetDaily": 4,
"budgetType": "",
"deliveryStatus": "ACTIVE",
"fbPostId": "106638148652329_672633202087926",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 2,
"cpc": 0,
"cpp": 1.6,
"cpm": 1.55,
"ctr": 0,
"frequency": 0,
"impressions": 452,
"reach": 438
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7Lo",
"spend": 0.7,
"spendDate": "2025-04-03T00:00:00.000Z",
"status": "ACTIVE"
},
{
"accountId": "274948332",
"adId": "6683876017505",
"adName": "API Post 13 - DE6gpw8kxlonHy6eb7Lo - 2025-03-30T17:11:26",
"budgetDaily": 4,
"budgetType": "daily",
"deliveryStatus": "ACTIVE",
"fbPostId": "106638148652329_672633202087926",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 1,
"cpc": 0,
"cpp": 1.5,
"cpm": 1.5,
"ctr": 0,
"frequency": 0,
"impressions": 2793,
"reach": 2793
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7Lo",
"spend": 4.19,
"spendDate": "2025-04-02T00:00:00.000Z",
"status": "ACTIVE"
}
],
"dateRange": {
"start": "2025-03-04T18:49:18.159Z",
"end": "2025-04-03T18:49:18.159Z",
"adId": "6683876017505"
},
"metrics": {
"totalSpend": 4.89,
"totalClicks": 3,
"totalImpressions": 10553,
"totalReach": 10339,
"averageCTR": 0.03,
"averageFrequency": 0,
"cpm": 1.460248270633943,
"cpp": 1.49047296643776,
"cpc": 5.136666666666667,
"costPerResult": 5.14,
"byGoalType": {
"engagement": {
"spend": 4.89,
"impressions": 10553,
"clicks": 3,
"reach": 10339,
"count": 2,
"ctr": 0.03,
"cpm": 1.46,
"cpp": 1.49,
"cpc": 5.14
}
},
"byGoalTitle": {
"Get More Engagement": {
"spend": 4.89,
"impressions": 10553,
"clicks": 3,
"reach": 10339,
"count": 2,
"type": "engagement",
"ctr": 0.03,
"cpm": 1.5,
"cpp": 1.49,
"cpc": 5.14
}
},
"goalPerformance": {
"bestPerformingGoalType": {
"type": "engagement",
"clicks": 3,
"spend": 4.89,
"ctr": 0.03
},
"mostEfficientGoalType": {
"type": "engagement",
"cpc": 5.14,
"spend": 4.89
}
},
"count": 2,
"firstDay": "2025-03-30T00:00:00.000Z",
"lastDay": "2025-04-03T00:00:00.000Z"
}
}
{
"action": "get ad spend",
"status": "error",
"code": 367,
"message": "Error getting ad spend. Please verify you have an active ad account."
}
Facebook Ads
历史记录
获取每日 Facebook 广告支出与分析历史数据
GET
/
ads
/
facebook
/
history
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/ads/facebook/spend?accountId=1234567890
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/facebook/spend?accountId=1234567890", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/ads/facebook/spend', headers=headers)
print(r.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/ads/facebook/spend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error: " . $err;
} else {
echo $response;
}
?>
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer API_KEY");
var response = await client.GetAsync("https://api.ayrshare.com/api/ads/facebook/spend");
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.ayrshare.com/api/ads/facebook/spend", nil)
req.Header.Add("Authorization", "Bearer API_KEY")
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class GetAdSpend {
public static void main(String[] args) {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.ayrshare.com/api/ads/facebook/spend"))
.header("Authorization", "Bearer API_KEY")
.GET()
.build();
try {
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI.parse('https://api.ayrshare.com/api/ads/facebook/spend')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
puts response.body
{
"status": "success",
"history": [
{
"adId": "6683876017501",
"adName": "API Post 1 - DE6gpw8kxlonHy6eb7L1 - 2025-03-30T17:11:26",
"budgetDaily": 4,
"budgetType": "daily",
"deliveryStatus": "ACTIVE",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 3,
"impressions": 1035,
"reach": 1026,
"frequency": 0,
"ctr": 0,
"cpm": 1.53,
"cpp": 1.54,
"cpc": 0
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7L1",
"spend": 1.58,
"spendDate": "2025-04-02T00:00:00.000Z",
"status": "ACTIVE"
},
{
"adId": "120218167147110411",
"adName": "API Post 2 - DE6gpw8kxlonHy6eb7L1 - 2025-03-30T16:41:15",
"budgetDaily": 4,
"budgetType": "daily",
"deliveryStatus": "ACTIVE",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 4,
"impressions": 1036,
"reach": 1011,
"frequency": 0,
"ctr": 0,
"cpm": 1.61,
"cpp": 1.65,
"cpc": 0
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7L1",
"spend": 1.67,
"spendDate": "2025-04-02T00:00:00.000Z",
"status": "ACTIVE"
}
],
"dateRange": {
"start": "2025-02-24T20:02:34.613Z",
"end": "2025-03-26T20:02:34.613Z",
"postId": "eSNkaAiFZVin6wm6f"
},
"metrics": {
"totalSpend": 3.25,
"totalClicks": 7,
"totalImpressions": 2071,
"totalReach": 2052,
"averageCTR": 0.1,
"averageFrequency": 0,
"cpm": 0.79,
"cpp": 0.85,
"cpc": 0.2,
"costPerResult": 1.2,
"byGoalType": {
"engagement": {
"spend": 7.62,
"impressions": 9332,
"clicks": 0,
"reach": 8502,
"count": 8,
"ctr": 0,
"cpm": 0.8165452207458208,
"cpp": 0.8962597035991532,
"cpc": 0
}
},
"byGoalTitle": {
"Get More Engagement": {
"spend": 3.25,
"impressions": 2071,
"clicks": 7,
"reach": 2052,
"count": 1,
"type": "engagement",
"ctr": 0.1,
"cpm": 0.79,
"cpp": 0.85,
"cpc": 0.2
}
},
"goalPerformance": {
"bestPerformingGoalType": {
"type": "engagement",
"clicks": 7,
"spend": 3.25,
"ctr": 0.1
},
"mostEfficientGoalType": {
"type": "engagement",
"cpc": 0.2,
"spend": 3.25
}
},
"count": 2,
"firstDay": "2025-03-17T00:00:00.000Z",
"lastDay": "2025-03-23T00:00:00.000Z"
}
}
{
"status": "success",
"history": [
{
"accountId": "274948332",
"adId": "6683876017505",
"adName": "API Post 13 - DE6gpw8kxlonHy6eb7Lo - 2025-03-30T17:11:26",
"budgetDaily": 4,
"budgetType": "",
"deliveryStatus": "ACTIVE",
"fbPostId": "106638148652329_672633202087926",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 2,
"cpc": 0,
"cpp": 1.6,
"cpm": 1.55,
"ctr": 0,
"frequency": 0,
"impressions": 452,
"reach": 438
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7Lo",
"spend": 0.7,
"spendDate": "2025-04-03T00:00:00.000Z",
"status": "ACTIVE"
},
{
"accountId": "274948332",
"adId": "6683876017505",
"adName": "API Post 13 - DE6gpw8kxlonHy6eb7Lo - 2025-03-30T17:11:26",
"budgetDaily": 4,
"budgetType": "daily",
"deliveryStatus": "ACTIVE",
"fbPostId": "106638148652329_672633202087926",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 1,
"cpc": 0,
"cpp": 1.5,
"cpm": 1.5,
"ctr": 0,
"frequency": 0,
"impressions": 2793,
"reach": 2793
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7Lo",
"spend": 4.19,
"spendDate": "2025-04-02T00:00:00.000Z",
"status": "ACTIVE"
}
],
"dateRange": {
"start": "2025-03-04T18:49:18.159Z",
"end": "2025-04-03T18:49:18.159Z",
"adId": "6683876017505"
},
"metrics": {
"totalSpend": 4.89,
"totalClicks": 3,
"totalImpressions": 10553,
"totalReach": 10339,
"averageCTR": 0.03,
"averageFrequency": 0,
"cpm": 1.460248270633943,
"cpp": 1.49047296643776,
"cpc": 5.136666666666667,
"costPerResult": 5.14,
"byGoalType": {
"engagement": {
"spend": 4.89,
"impressions": 10553,
"clicks": 3,
"reach": 10339,
"count": 2,
"ctr": 0.03,
"cpm": 1.46,
"cpp": 1.49,
"cpc": 5.14
}
},
"byGoalTitle": {
"Get More Engagement": {
"spend": 4.89,
"impressions": 10553,
"clicks": 3,
"reach": 10339,
"count": 2,
"type": "engagement",
"ctr": 0.03,
"cpm": 1.5,
"cpp": 1.49,
"cpc": 5.14
}
},
"goalPerformance": {
"bestPerformingGoalType": {
"type": "engagement",
"clicks": 3,
"spend": 4.89,
"ctr": 0.03
},
"mostEfficientGoalType": {
"type": "engagement",
"cpc": 5.14,
"spend": 4.89
}
},
"count": 2,
"firstDay": "2025-03-30T00:00:00.000Z",
"lastDay": "2025-04-03T00:00:00.000Z"
}
}
{
"action": "get ad spend",
"status": "error",
"code": 367,
"message": "Error getting ad spend. Please verify you have an active ad account."
}
获取 Facebook 广告的每日广告支出和表现指标详情。
此端点提供全面的广告分析数据,包括按日细分、按目标划分的表现以及聚合指标。
dailySpend 数组包含每条广告的每日历史支出与表现指标。数据截止于美东时间上午 8 点。
如果需要实时支出数据,或尚未产生支出,请使用 ads 端点。如果没有可用的支出数据或尚未产生支出,则不会返回该广告。- 指标是通过 Facebook 的报表 API 计算得出,可能存在轻微延迟(最长 24 小时)。
byGoalType和byGoalTitle部分按目标(objective)对表现指标进行分组。- 使用
adId或postId过滤器可将结果限定到特定的活动。 - 所有货币金额均以广告账户的货币显示(通常为 USD)。
goalPerformance部分会突出显示表现最佳的广告目标。
此端点仅返回通过 Boost Post 端点创建的 Facebook 广告。
通过 Facebook 广告管理器或其他第三方工具创建的广告不会被返回。
请求头参数
查询参数
将结果过滤到特定账户 ID。
将结果过滤到特定广告 ID。
将结果过滤到与特定 Ayrshare 帖子 ID 相关联的广告。
将结果过滤到与特定 Facebook 社交帖子 ID 相关联的广告。
最多获取
limit 条广告。最大值为 500。报告期的开始日期,采用 ISO 8601 格式(默认:30 天前)
报告期的结束日期,采用 ISO 8601 格式(默认:今天)
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/ads/facebook/spend?accountId=1234567890
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/facebook/spend?accountId=1234567890", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/ads/facebook/spend', headers=headers)
print(r.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/ads/facebook/spend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer API_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error: " . $err;
} else {
echo $response;
}
?>
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer API_KEY");
var response = await client.GetAsync("https://api.ayrshare.com/api/ads/facebook/spend");
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.ayrshare.com/api/ads/facebook/spend", nil)
req.Header.Add("Authorization", "Bearer API_KEY")
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class GetAdSpend {
public static void main(String[] args) {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.ayrshare.com/api/ads/facebook/spend"))
.header("Authorization", "Bearer API_KEY")
.GET()
.build();
try {
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI.parse('https://api.ayrshare.com/api/ads/facebook/spend')
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(request)
end
puts response.body
{
"status": "success",
"history": [
{
"adId": "6683876017501",
"adName": "API Post 1 - DE6gpw8kxlonHy6eb7L1 - 2025-03-30T17:11:26",
"budgetDaily": 4,
"budgetType": "daily",
"deliveryStatus": "ACTIVE",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 3,
"impressions": 1035,
"reach": 1026,
"frequency": 0,
"ctr": 0,
"cpm": 1.53,
"cpp": 1.54,
"cpc": 0
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7L1",
"spend": 1.58,
"spendDate": "2025-04-02T00:00:00.000Z",
"status": "ACTIVE"
},
{
"adId": "120218167147110411",
"adName": "API Post 2 - DE6gpw8kxlonHy6eb7L1 - 2025-03-30T16:41:15",
"budgetDaily": 4,
"budgetType": "daily",
"deliveryStatus": "ACTIVE",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 4,
"impressions": 1036,
"reach": 1011,
"frequency": 0,
"ctr": 0,
"cpm": 1.61,
"cpp": 1.65,
"cpc": 0
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7L1",
"spend": 1.67,
"spendDate": "2025-04-02T00:00:00.000Z",
"status": "ACTIVE"
}
],
"dateRange": {
"start": "2025-02-24T20:02:34.613Z",
"end": "2025-03-26T20:02:34.613Z",
"postId": "eSNkaAiFZVin6wm6f"
},
"metrics": {
"totalSpend": 3.25,
"totalClicks": 7,
"totalImpressions": 2071,
"totalReach": 2052,
"averageCTR": 0.1,
"averageFrequency": 0,
"cpm": 0.79,
"cpp": 0.85,
"cpc": 0.2,
"costPerResult": 1.2,
"byGoalType": {
"engagement": {
"spend": 7.62,
"impressions": 9332,
"clicks": 0,
"reach": 8502,
"count": 8,
"ctr": 0,
"cpm": 0.8165452207458208,
"cpp": 0.8962597035991532,
"cpc": 0
}
},
"byGoalTitle": {
"Get More Engagement": {
"spend": 3.25,
"impressions": 2071,
"clicks": 7,
"reach": 2052,
"count": 1,
"type": "engagement",
"ctr": 0.1,
"cpm": 0.79,
"cpp": 0.85,
"cpc": 0.2
}
},
"goalPerformance": {
"bestPerformingGoalType": {
"type": "engagement",
"clicks": 7,
"spend": 3.25,
"ctr": 0.1
},
"mostEfficientGoalType": {
"type": "engagement",
"cpc": 0.2,
"spend": 3.25
}
},
"count": 2,
"firstDay": "2025-03-17T00:00:00.000Z",
"lastDay": "2025-03-23T00:00:00.000Z"
}
}
{
"status": "success",
"history": [
{
"accountId": "274948332",
"adId": "6683876017505",
"adName": "API Post 13 - DE6gpw8kxlonHy6eb7Lo - 2025-03-30T17:11:26",
"budgetDaily": 4,
"budgetType": "",
"deliveryStatus": "ACTIVE",
"fbPostId": "106638148652329_672633202087926",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 2,
"cpc": 0,
"cpp": 1.6,
"cpm": 1.55,
"ctr": 0,
"frequency": 0,
"impressions": 452,
"reach": 438
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7Lo",
"spend": 0.7,
"spendDate": "2025-04-03T00:00:00.000Z",
"status": "ACTIVE"
},
{
"accountId": "274948332",
"adId": "6683876017505",
"adName": "API Post 13 - DE6gpw8kxlonHy6eb7Lo - 2025-03-30T17:11:26",
"budgetDaily": 4,
"budgetType": "daily",
"deliveryStatus": "ACTIVE",
"fbPostId": "106638148652329_672633202087926",
"goal": {
"description": "This goal seeks to increase engagement while ensuring that the ad reaches the maximum number of unique users. It balances visibility with engagement, showing the ad to as many different people as possible who may interact with it.",
"title": "Get More Engagement",
"type": "engagement"
},
"isActive": true,
"isComplete": false,
"metrics": {
"clicks": 1,
"cpc": 0,
"cpp": 1.5,
"cpm": 1.5,
"ctr": 0,
"frequency": 0,
"impressions": 2793,
"reach": 2793
},
"network": "facebook",
"postId": "DE6gpw8kxlonHy6eb7Lo",
"spend": 4.19,
"spendDate": "2025-04-02T00:00:00.000Z",
"status": "ACTIVE"
}
],
"dateRange": {
"start": "2025-03-04T18:49:18.159Z",
"end": "2025-04-03T18:49:18.159Z",
"adId": "6683876017505"
},
"metrics": {
"totalSpend": 4.89,
"totalClicks": 3,
"totalImpressions": 10553,
"totalReach": 10339,
"averageCTR": 0.03,
"averageFrequency": 0,
"cpm": 1.460248270633943,
"cpp": 1.49047296643776,
"cpc": 5.136666666666667,
"costPerResult": 5.14,
"byGoalType": {
"engagement": {
"spend": 4.89,
"impressions": 10553,
"clicks": 3,
"reach": 10339,
"count": 2,
"ctr": 0.03,
"cpm": 1.46,
"cpp": 1.49,
"cpc": 5.14
}
},
"byGoalTitle": {
"Get More Engagement": {
"spend": 4.89,
"impressions": 10553,
"clicks": 3,
"reach": 10339,
"count": 2,
"type": "engagement",
"ctr": 0.03,
"cpm": 1.5,
"cpp": 1.49,
"cpc": 5.14
}
},
"goalPerformance": {
"bestPerformingGoalType": {
"type": "engagement",
"clicks": 3,
"spend": 4.89,
"ctr": 0.03
},
"mostEfficientGoalType": {
"type": "engagement",
"cpc": 5.14,
"spend": 4.89
}
},
"count": 2,
"firstDay": "2025-03-30T00:00:00.000Z",
"lastDay": "2025-04-03T00:00:00.000Z"
}
}
{
"action": "get ad spend",
"status": "error",
"code": 367,
"message": "Error getting ad spend. Please verify you have an active ad account."
}
⌘I
