Get Ad Spend
curl --request POST \
--url https://octanist.com/api/ad-spend \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"startDate": "2026-01-01",
"endDate": "2026-03-01",
"groupBy": "date",
"limit": 100,
"page": 1
}
'import requests
url = "https://octanist.com/api/ad-spend"
payload = {
"startDate": "2026-01-01",
"endDate": "2026-03-01",
"groupBy": "date",
"limit": 100,
"page": 1
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2026-01-01',
endDate: '2026-03-01',
groupBy: 'date',
limit: 100,
page: 1
})
};
fetch('https://octanist.com/api/ad-spend', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://octanist.com/api/ad-spend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'startDate' => '2026-01-01',
'endDate' => '2026-03-01',
'groupBy' => 'date',
'limit' => 100,
'page' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://octanist.com/api/ad-spend"
payload := strings.NewReader("{\n \"startDate\": \"2026-01-01\",\n \"endDate\": \"2026-03-01\",\n \"groupBy\": \"date\",\n \"limit\": 100,\n \"page\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://octanist.com/api/ad-spend")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2026-01-01\",\n \"endDate\": \"2026-03-01\",\n \"groupBy\": \"date\",\n \"limit\": 100,\n \"page\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octanist.com/api/ad-spend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2026-01-01\",\n \"endDate\": \"2026-03-01\",\n \"groupBy\": \"date\",\n \"limit\": 100,\n \"page\": 1\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"date": "2026-02-15",
"campaignId": "123456789",
"campaignName": "Spring Sale 2026",
"adGroupId": "987654321",
"adGroupName": "Brand Keywords",
"platform": "googleads",
"cost": 1500.5,
"clicks": 2500,
"impressions": 50000,
"conversions": 125
}
],
"meta": {
"pagination": {
"limit": 50,
"page": 1,
"totalPages": 5,
"total": 234,
"hasMore": true
},
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}Analytics
Get Ad Spend
Retrieve ad spend data grouped by various dimensions
POST
/
api
/
ad-spend
Get Ad Spend
curl --request POST \
--url https://octanist.com/api/ad-spend \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"startDate": "2026-01-01",
"endDate": "2026-03-01",
"groupBy": "date",
"limit": 100,
"page": 1
}
'import requests
url = "https://octanist.com/api/ad-spend"
payload = {
"startDate": "2026-01-01",
"endDate": "2026-03-01",
"groupBy": "date",
"limit": 100,
"page": 1
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startDate: '2026-01-01',
endDate: '2026-03-01',
groupBy: 'date',
limit: 100,
page: 1
})
};
fetch('https://octanist.com/api/ad-spend', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://octanist.com/api/ad-spend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'startDate' => '2026-01-01',
'endDate' => '2026-03-01',
'groupBy' => 'date',
'limit' => 100,
'page' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://octanist.com/api/ad-spend"
payload := strings.NewReader("{\n \"startDate\": \"2026-01-01\",\n \"endDate\": \"2026-03-01\",\n \"groupBy\": \"date\",\n \"limit\": 100,\n \"page\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://octanist.com/api/ad-spend")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"startDate\": \"2026-01-01\",\n \"endDate\": \"2026-03-01\",\n \"groupBy\": \"date\",\n \"limit\": 100,\n \"page\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octanist.com/api/ad-spend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startDate\": \"2026-01-01\",\n \"endDate\": \"2026-03-01\",\n \"groupBy\": \"date\",\n \"limit\": 100,\n \"page\": 1\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": [
{
"date": "2026-02-15",
"campaignId": "123456789",
"campaignName": "Spring Sale 2026",
"adGroupId": "987654321",
"adGroupName": "Brand Keywords",
"platform": "googleads",
"cost": 1500.5,
"clicks": 2500,
"impressions": 50000,
"conversions": 125
}
],
"meta": {
"pagination": {
"limit": 50,
"page": 1,
"totalPages": 5,
"total": 234,
"hasMore": true
},
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}Request Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
startDate | string | Yes | - | Start date (YYYY-MM-DD) |
endDate | string | Yes | - | End date (YYYY-MM-DD) |
platform | string | No | - | Filter by platform: googleads, meta, microsoftads |
groupBy | string | No | date | Group by: date, campaign, adgroup, platform |
limit | number | No | 100 | Results per page (1-500) |
page | number | No | 1 | Page number |
Example Request
curl -X POST \
-H "X-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"startDate": "2026-01-01",
"endDate": "2026-03-01",
"groupBy": "campaign",
"limit": 10
}' \
"https://octanist.com/api/ad-spend"
Example Response (grouped by campaign)
{
"success": true,
"data": [
{
"campaignId": "123456789",
"campaignName": "Spring Sale 2026",
"platform": "googleads",
"cost": 1500.5,
"clicks": 2500,
"impressions": 50000,
"conversions": 125
}
],
"meta": {
"pagination": {
"limit": 10,
"page": 1,
"totalPages": 5,
"total": 45,
"hasMore": true
},
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}
Response Fields by groupBy
groupBy: date
{
"date": "2026-02-15",
"cost": 500.25,
"clicks": 850,
"impressions": 15000,
"conversions": 42
}
groupBy: campaign
{
"campaignId": "123456789",
"campaignName": "Spring Sale 2026",
"platform": "googleads",
"cost": 1500.5,
"clicks": 2500,
"impressions": 50000,
"conversions": 125
}
groupBy: adgroup
{
"campaignId": "123456789",
"campaignName": "Spring Sale 2026",
"adGroupId": "987654321",
"adGroupName": "Brand Keywords",
"platform": "googleads",
"cost": 750.25,
"clicks": 1250,
"impressions": 25000,
"conversions": 62
}
groupBy: platform
{
"platform": "googleads",
"cost": 5000.0,
"clicks": 10000,
"impressions": 200000,
"conversions": 500
}
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid request body or startDate > endDate |
| 400 | INVALID_DATE | Invalid date format (use YYYY-MM-DD) |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 500 | INTERNAL_ERROR | Server error |
Authorizations
API key for authentication
Body
application/json
Ad spend request parameters
Start date (YYYY-MM-DD)
Example:
"2026-01-01"
End date (YYYY-MM-DD)
Example:
"2026-03-01"
Filter by platform
Available options:
googleads, meta, microsoftads Dimension to group results by
Available options:
date, campaign, adgroup, platform Results per page (1-500)
Required range:
1 <= x <= 500Page number
Required range:
x >= 1⌘I