Skip to main content
GET
/
projects
/
{project_id}
/
ads
/
{id}
/
analytics
Ad analytics
curl --request GET \
  --url https://api.beyondwords.io/v1/projects/{project_id}/ads/{id}/analytics \
  --header 'X-Api-Key: <api-key>'
import requests

url = "https://api.beyondwords.io/v1/projects/{project_id}/ads/{id}/analytics"

headers = {"X-Api-Key": "<api-key>"}

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

print(response.text)
const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};

fetch('https://api.beyondwords.io/v1/projects/{project_id}/ads/{id}/analytics', 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://api.beyondwords.io/v1/projects/{project_id}/ads/{id}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)

func main() {

url := "https://api.beyondwords.io/v1/projects/{project_id}/ads/{id}/analytics"

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

req.Header.Add("X-Api-Key", "<api-key>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.beyondwords.io/v1/projects/{project_id}/ads/{id}/analytics")
.header("X-Api-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.beyondwords.io/v1/projects/{project_id}/ads/{id}/analytics")

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

request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "id": 100,
  "title": "Ad title,",
  "player_impressions": {
    "total": 5000,
    "desktop": 2000,
    "tablet": 1000,
    "mobile_web": 0,
    "ios": 1000,
    "andriod": 1000
  }
}

Authorizations

X-Api-Key
string
header
required

Path Parameters

project_id
string
required

The numeric ID of your project

id
string
required

The ID of the ads campaign

Query Parameters

aggregation
enum<string>
The way to aggregate the analytics. Possible values are all (aggregate all data together),
year (aggregate data on a yearly basis), month (aggregate data on a yearly basis),
week (aggregate data on a yearly basis), day (aggregate data on a yearly basis), or hour
(aggregate data on an hourly basis, limited to a time_range 7 days or less).
Available options:
all,
hour,
day,
week,
month,
year
time_range[start]
string

The start date of the aggregation period. The value of this property should be a string in the format yyyy-mm-dd according to ISO 8601.

time_range[end]
string

The end date of the aggregation period. The value of this property should be a string in the format yyyy-mm-dd according to ISO 8601. If this is set to today, the current day is still in progress and therefore only partial analytics data is returned until the day ends.

metrics[]
string[]

The metrics that you want to fetch data for

media_variants[]
enum<string>[]

The media variants to fetch data for

Available options:
article,
summary
media_formats[]
enum<string>[]

The media formats to fetch data for

Available options:
audio,
video
access_tiers[]
string[]

The access tiers to fetch data for

Response

200 - application/json

OK

id
integer

Ad identifier

title
integer

Ad title (internal identifier)

player_impressions
object
listens
object
completions
object
completion_rate
object
clicks
object
click_rate
object