> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.hive.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.hive.co/_mcp/server.

# List ad campaigns

GET https://api.hive.co/v2/campaigns/ads/

Published Meta ad campaigns for the authorized brand, most recently created first. All performance figures are Meta-reported, served from Hive's cached stats. `stats` is only present when requested with `stats=true`; compare `stats_refreshed_at` to avoid re-fetching unchanged stats.

Reference: https://developers.hive.co/api-reference/hive-api/campaigns/ads-retrieve

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `limit` (integer, optional, default: 50)
- `offset` (integer, optional, default: 0)
- `stats` (boolean, optional, default: false)

### Headers

- `X-Partner-Id` (string, required) — Your OAuth application client ID.

## Response

### 200

- `offset` (integer, required)
- `limit` (integer, required)
- `total_items` (integer, required)
- `items` (list of AdsCampaignWithStats, required)

## Errors

### 422 Unprocessable Entity Error

The request was rejected on its query parameters. Field errors are keyed by parameter name, rejections on the parameter values (e.g. an unknown ID) use a flat `errors` list.

- `map from string to any`

## Types

### AdsCampaignWithStats

- `id` (string, required)
- `name` (string, required)
- `status` (string, required)
- `objective` (string, required)
- `start_time` (datetime, required, nullable)
- `stop_time` (datetime, required, nullable)
- `budget_cents` (integer, required, nullable)
- `budget_type` (string, required, nullable)
- `stats_refreshed_at` (datetime, required, nullable)
- `stats` (AdsCampaignStats, optional, nullable) — Versioned view over the cached Meta lifetime insights — the raw insights blob is never passed through. All figures are Meta-reported; ads have no Hive-attributed revenue sections (unlike email and SMS).

### AdsCampaignStats

Versioned view over the cached Meta lifetime insights — the raw insights blob is never passed through. All figures are Meta-reported; ads have no Hive-attributed revenue sections (unlike email and SMS).

- `spend` (double, optional, default: 0)
- `impressions` (integer, optional, default: 0)
- `reach` (integer, optional, default: 0)
- `frequency` (double, optional)
- `clicks` (integer, optional, default: 0)
- `unique_clicks` (integer, optional, default: 0)
- `cost_per_click` (double, optional)
- `cost_per_unique_click` (double, optional)
- `click_through_rate` (double, optional)
- `results` (integer, optional)
- `cost_per_result` (double, optional)
- `meta_purchase_value` (double, optional)
- `meta_purchase_roas` (double, optional)

## Examples

**Response**

```json
{
  "offset": 1,
  "limit": 1,
  "total_items": 1,
  "items": [
    {
      "id": "string",
      "name": "string",
      "status": "string",
      "objective": "string",
      "start_time": "2024-01-15T09:30:00Z",
      "stop_time": "2024-01-15T09:30:00Z",
      "budget_cents": 1,
      "budget_type": "string",
      "stats_refreshed_at": "2024-01-15T09:30:00Z",
      "stats": {
        "spend": 0,
        "impressions": 0,
        "reach": 0,
        "frequency": 1.1,
        "clicks": 0,
        "unique_clicks": 0,
        "cost_per_click": 1.1,
        "cost_per_unique_click": 1.1,
        "click_through_rate": 1.1,
        "results": 1,
        "cost_per_result": 1.1,
        "meta_purchase_value": 1.1,
        "meta_purchase_roas": 1.1
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.hive.co/v2/campaigns/ads/"

headers = {
    "X-Partner-Id": "X-Partner-Id",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.hive.co/v2/campaigns/ads/';
const options = {
  method: 'GET',
  headers: {'X-Partner-Id': 'X-Partner-Id', Authorization: 'Bearer <token>'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hive.co/v2/campaigns/ads/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Partner-Id", "X-Partner-Id")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.hive.co/v2/campaigns/ads/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Partner-Id"] = 'X-Partner-Id'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.hive.co/v2/campaigns/ads/")
  .header("X-Partner-Id", "X-Partner-Id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.hive.co/v2/campaigns/ads/', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Partner-Id' => 'X-Partner-Id',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.hive.co/v2/campaigns/ads/");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Partner-Id", "X-Partner-Id");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Partner-Id": "X-Partner-Id",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.hive.co/v2/campaigns/ads/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```