Skip to content

Brave Ads Advertiser API Guide

Brian Fung edited this page Apr 15, 2021 · 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

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'

4. Reporting currently 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,Segments

Clone this wiki locally