Skip to content

Brave Ads Advertiser API Guide

Graham Tackley edited this page Jul 4, 2023 · 11 revisions

Advertiser API Guide

Accessing campaign stats through the ads API:

1. First acquire an API access token with your Brave Ads account credentials:

curl --request POST \
  --url https://ads-serve.brave.com/v1/auth/token \
  --header 'Content-Type: application/json' \
  --data '{
	"email": "<EMAIL>",
	"password": "<PASSWORD>"
}'

2. Retrieve list of Campaigns: Your Brave Account Manager can provide you with your Advertiser ID.

curl --request POST \
  --url https://ads-serve.brave.com/graphql \
  --header 'Authorization: Bearer <ACCESS_TOKEN>' \
  --header 'Content-Type: application/json' \
  --data '{"query":" query{   advertiser(id: \"<ADVERTISER_ID>\"){\n  campaigns{\n    name\n    id\n  }\n}}"}'

3. Download reports for a given campaign id in CSV format

v1 Endpoint

curl --request GET --url https://ads-serve.brave.com/v1/report/campaign/csv/<CAMPAIGN_ID> \
  --header 'Authorization: Bearer <ACCESS_TOKEN>' \
  --header 'Content-Type: application/json'

v1 Reporting Endpoint contains the following fields:

Day/Hour,Advertiser Name,Campaign Name,Campaign ID,Creative Set ID,Creative Set Name,Creative Instance ID,Creative Title,Creative Body,Creative URL,View Counts,Click Counts,Dismissed Counts,Landed Counts,Conversion Counts,OS,Segment

v2 Endpoint

curl --request GET --url https://ads-serve.brave.com/v2/report/campaign/csv/<CAMPAIGN_ID> \
  --header 'Authorization: Bearer <ACCESS_TOKEN>' \
  --header 'Content-Type: application/json'

v2 Reporting Endpoint contains the following fields:

Day/Hour,Advertiser Name,Campaign Name,Campaign ID,Creative Set ID,Creative Instance ID,Creative Title,Creative Body,Creative URL,View Counts,Click Counts,Dismissed Counts,Landed Counts,Conversion Counts,OS

Clone this wiki locally