Ads API Guides
Object Hierarchy
Your Ads Manager account comprises sets of related objects organized in a hierarchy. The Ads API gives you direct, programmatic access to these objects. From top to bottom, the objects that build the structure of your account include:
- Ad Accounts
- Campaigns
- Ad Sets
- Ads
- Assets
Ad Accounts
You must have an ad account before you can create advertisers, campaigns, ad sets, or ads. For more information about creating an ad account, see Getting Started.
Use the Get Ad Accounts endpoint to view information about your account after it has been set up.
Campaigns
A campaign is an object that contains and organizes one or more ad sets. Also, you need a campaign before you can create an ad set. Use the Create Campaign endpoint to create a campaign under your ad account.
Ad Sets
An ad set is the core component of your Ads Manager campaign. It is a child of a campaign object and contains all the essential information Ads Manager needs to execute your campaign. For example, an ad set contains:
- Information about how, when, and where your campaign runs (e.g., start and end dates, bids, budgets, targeting, etc).
- One or more ads.
See the Create Ad Set endpoint for more information or to add an ad set to a campaign.
Ads
An ad is an object that contains an image asset along with either an audio or video asset. Each ad be linked to an ad set but a given ad cannot be linked to multiple ad sets. See the eponymous Create Ad endpoint to get started.
Assets
The Ads Manager platform supports audio, video, and image assets. These assets are required to create an ad. The asset endpoints help you upload and manage these items. Use the following endpoints to first create and then upload an asset:
Campaign Management
Overview
The Campaign Management API allows you to create and manage campaigns, ad sets, and ads at scale. It also includes endpoints to estimate audience size and bid amount based on your targeting specifications (set at the ad set level).
Eligibility Criteria
As of August 2023, the Campaign Management API is generally available ("GA") and no longer requires a manual allowlisting process to gain access. As soon as you have set up your application, your client ID will be able to access these endpoints automatically.
Please note that the Campaign Management API is only available for advertisers with a Spotify Ads Manager account.
Differences from the UI
Most features available in the Ads Manager UI are also available via the Ads API, with a few exceptions:
Feature | Supported in Spotify Ads Manager UI | Supported in Spotify Ads API |
---|---|---|
Create new ad account | yes | no |
Manage users | yes | no |
Manage billing/payment | yes | no |
Voiceover generation | yes | no |
Real-time context targeting | yes | yes - Referred to as playlist targeting |
Fan targeting | yes | yes - Referred to as artist targeting |
MOAT viewability tracking set up | yes | no - Only IAS is available |
Build a campaign
Follow these steps to build your first end-to-end campaign with the Ads API. NOTE: The below sample curl requests do not reflect every request parameter available.
Step 1: Retrieve your ad account ID
If you're unsure of your ad account ID, you can call the Get Ad Accounts endpoint to return a list of all ad accounts available to the current authenticated user.
_10curl --request GET \_10 --url https://api-partner.spotify.com/ads/v2/ad_accounts \_10 --header 'Authorization: Bearer <ACCESS_TOKEN>'
Step 2: Create a campaign
_10curl --request POST \_10 --url https://api-partner.spotify.com/ads/v2/ad_accounts/<AD_ACCOUNT_ID>/campaigns \_10 --header 'Authorization: Bearer <ACCESS_TOKEN>' \_10 --header 'Content-Type: application/json' \_10 --data '{_10 "name": "My Test Campaign",_10 "objective": "EVEN_IMPRESSION_DELIVERY"_10}'
Upon success, the API will return an ID for the newly created campaign. Store this ID for use in Step 5 (Create an ad set).
Step 3: Define targeting specifications
Use the /targets endpoints to understand/retrieve the available targeting options -- supported categories include:
- artist
- genre
- playlist
- interest
- language
- geographic location (country, region, DMA, city, and postal code)
Step 4: [Optional] Estimate audience size and recommended bid amount
In order to help plan your campaign, we recommend using the /estimates endpoints to help forecast estimated audience size and recommended bid amount based on your targeting specifications (NOTE: Estimates are NOT a guarantee of performance).
Retrieve a recommended bid range:
_45curl --request POST \_45 --url https://api-partner.spotify.com/ads/v2/estimates/bid \_45 --header 'Authorization: Bearer <ACCESS_TOKEN>' \_45 --header 'Content-Type: application/json' \_45 --data '{_45 "start_date": "2024-09-23T04:00:00Z",_45 "end_date": "2024-10-23T04:00:00Z",_45 "bid_strategy": "MAX_BID",_45 "asset_format": "AUDIO",_45 "currency": "USD",_45 "targets": {_45 "age_ranges": [_45 {_45 "min": 18,_45 "max": 65_45 }_45 ],_45 "playlist_ids": [_45 "holidays",_45 "cooking"_45 ],_45 "genders": [_45 "MALE"_45 ],_45 "geo_targets": {_45 "dma_ids": [_45 "501"_45 ],_45 "region_ids": [_45 "5279468"_45 ],_45 "city_ids": [_45 "4174700"_45 ]_45 },_45 "genre_ids": [_45 "rock",_45 "blues"_45 ],_45 "platforms": [_45 "IOS"_45 ]_45 },_45 "objective": "EVEN_IMPRESSION_DELIVERY"_45}'
Retrieve an audience estimate:
_52curl --request POST \_52 --url https://api-partner.spotify.com/ads/v2/estimates/audience \_52 --header 'Authorization: Bearer <ACCESS_TOKEN>' \_52 --header 'Content-Type: application/json' \_52 --data '{_52 "ad_account_id": "<AD_ACCOUNT_ID>",_52 "start_date": "2024-09-23T04:00:00Z",_52 "end_date": "2024-10-23T04:00:00Z",_52 "bid_strategy": "MAX_BID",_52 "asset_format": "AUDIO",_52 "targets": {_52 "age_ranges": [_52 {_52 "min": 18,_52 "max": 65_52 }_52 ],_52 "playlist_ids": [_52 "holidays",_52 "cooking"_52 ],_52 "platforms": [_52 "IOS"_52 ],_52 "genders": [_52 "MALE"_52 ],_52 "language": "en",_52 "geo_targets": {_52 "country_code": "US",_52 "dma_ids": [_52 "501"_52 ],_52 "region_ids": [_52 "5279468"_52 ],_52 "city_ids": [_52 "4174700"_52 ]_52 },_52 "genre_ids": [_52 "rock",_52 "blues"_52 ]_52 },_52 "objective": "EVEN_IMPRESSION_DELIVERY",_52 "budget": {_52 "micro_amount": 25000000,_52 "type": "DAILY",_52 "currency": "USD"_52 }_52}'
Step 5: Create an ad set
_68curl --request POST \_68 --url https://api-partner.spotify.com/ads/v2/ad_accounts/<AD_ACCOUNT_ID>/ad_sets \_68 --header 'Authorization: Bearer <ACCESS_TOKEN>' \_68 --header 'Content-Type: application/json' \_68 --data '{_68 "name": "My Test Ad Set",_68 "start_time": "2024-10-23T00:00:00Z",_68 "end_time": "2024-10-30T00:00:00Z",_68 "frequency_caps": [_68 {_68 "frequency_unit": "DAY",_68 "max_impressions": 3,_68 "frequency_period": 1_68 },_68 {_68 "frequency_unit": "WEEK",_68 "max_impressions": 5,_68 "frequency_period": 1_68 },_68 {_68 "frequency_unit": "MONTH",_68 "max_impressions": 15,_68 "frequency_period": 1_68 }_68 ],_68 "bid_micro_amount": 5000000,_68 "category": "ADV_1_1",_68 "budget": {_68 "micro_amount": 15000000,_68 "type": "DAILY"_68 },_68 "targets": {_68 "age_ranges": [_68 {_68 "min": 18,_68 "max": 65_68 }_68 ],_68 "playlist_ids": [_68 "holidays",_68 "cooking"_68 ],_68 "genders": [_68 "MALE"_68 ],_68 "geo_targets": {_68 "dma_ids": [_68 "501"_68 ],_68 "region_ids": [_68 "5279468"_68 ],_68 "city_ids": [_68 "4174700"_68 ]_68 },_68 "genre_ids": [_68 "rock",_68 "blues"_68 ],_68 "platforms": [_68 "IOS"_68 ]_68 },_68 "bid_strategy": "MAX_BID",_68 "campaign_id": "<CAMPAIGN_ID>",_68 "asset_format": "AUDIO"_68}'
Upon success, the API will return an ID for the newly created ad set. Store this ID for use in Step 7 (Create an ad).
TIP: If you want to ensure your ad set is not trafficked while you are still finalizing details, you can set the "delivery" to "OFF" until you are ready to have it go live.
Step 6: Create & Upload assets
First, create an asset (the below example is for creating a companion image asset):
_10curl --request POST \_10 --url https://api-partner.spotify.com/ads/v2/ad_accounts/<AD_ACCOUNT_ID>/assets \_10 --header 'Authorization: Bearer <ACCESS_TOKEN>' \_10 --header 'Content-Type: application/json' \_10 --data '{_10 "asset_subtype": "COMPANION",_10 "asset_type": "IMAGE",_10 "name": "myLogoImage.png"_10}'
Upon success, the API will return an ID for the newly created image asset.
Next, send upload your file to the newly created asset:
_10curl -X 'POST' \_10 'https://api-partner.spotify.com/ads/v2/ad_accounts/<AD_ACCOUNT_ID>/assets/<ASSET_ID>/upload' \_10 -H 'accept: application/json' \_10 -H 'Authorization: Bearer <ACCESS_TOKEN>' \_10 -H 'Content-Type: multipart/form-data' \_10 -F 'media=@"<FILE_PATH>";type=image/"<FILE_TYPE>"' \_10 -F 'asset_type="IMAGE"'
TIP: You can confirm the asset has been processed successfully by calling the Get Asset endpoint and referring to 'status' in the response:
_10curl --request GET \_10 --url https://api-partner.spotify.com/ads/v2/ad_accounts/<AD_ACCOUNT_ID>/assets/<ASSET_ID> \_10 --header 'Authorization: Bearer <ACCESS_TOKEN>'
Repeat the above upload process for either an audio or a video asset and then proceed to Step 7.
Step 7: Create an ad
All ads must include either an audio asset or a video asset, in addition to a companion image asset.
_17curl --request POST \_17 --url https://api-partner.spotify.com/ads/v2/ad_accounts/<AD_ACCOUNT_ID>/ads \_17 --header 'Authorization: Bearer <ACCESS_TOKEN>' \_17 --header 'Content-Type: application/json' \_17 --data '{_17 "advertiser_name": "My Advertiser",_17 "assets": {_17 "asset_id": "<AUDIO_OR_VIDEO_ASSET_ID>",_17 "companion_asset_id": "<IMAGE_ASSET_ID>"_17 },_17 "call_to_action": {_17 "clickthrough_url": "https://www.spotify.com"_17 },_17 "name": "My Test Ad",_17 "tagline": "Music for everyone",_17 "ad_set_id": "<AD_SET_ID>"_17}'
Upon success, the API will return an ID for the newly created ad.
TIP: If you want to ensure your ad is not trafficked while you are still finalizing details, you can set the "delivery" to "OFF" until you are ready to have it go live.
Congratulations on creating your first full campaign! Once your campaign has been approved through the review process and goes live, you can track its performance using the Get Aggregate Report by Ad Account Id endpoint.
Reporting
Overview
The Reporting API allows advertisers to access real-time performance data for campaigns created via Ads Manager UI or via third party platforms integrated with Spotify Campaign Management API based on custom queries. You can find definitions of the available metrics (aka “fields”) in the Metrics Glossary section.
Eligibility Criteria
As of November 2022, the Reporting API is generally available ("GA") and no longer requires a manual allowlisting process to gain access. As soon as you have set up your application, your client ID will be able to access these endpoints automatically.
Please note that the Reporting API is only available for advertisers with a Spotify Ads Manager account.
Differences from the UI (Reporting)
Metric | Spotify Ads Manager UI | Spotify Ads API |
---|---|---|
Budgets and Spend | “Budget Spent” metric (available at the ad set level only) will never exceed the budget amount set by the advertiser – overdelivery is only reflected in the ‘Pacing’ column | SPEND field is not capped based on budget set by advertiser - in the event of overdelivery, SPEND may exceed the budget amount set by the advertiser but advertisers will only be billed up to their budget amount |
Metrics Glossary
This section includes definitions for all of the campaign metrics (referred to as fields
) that are available via the Reports endpoints.
Campaign Performance Metrics
These metrics provide the information you need to manage and optimize your campaigns efficiently and in real-time.
Metric/Field | Definition |
---|---|
Clicks ("CLICKS" ) | The number of impressions in which your ad was clicked (#) |
Completes (“COMPLETES” ) | The number of ads served that was played to the end (#) |
Completion Rate (“COMPLETION_RATE” ) | The percentage of ads played to completion(%) |
Click Through Rate (“CTR” ) | The percentage of ads that were clicked (%) |
Effective Cost per Mille (“E_CPM” ) | The average cost per 1,000 impressions |
Effective Cost per Completed Listen (“E_CPCL” ) | The average cost per 1,000 completed listens - NOTE: Applies to active audio/CPCL campaigns only |
First Quartiles (“FIRST_QUARTILES” ) | The number of users who listened or viewed 25% of the ad's total length (#) |
Frequency of Ads Served(“FREQUENCY” ) | The average number of times each person heard or viewed your ad (#) |
Impressions("IMPRESSIONS" ) | The number of times an ad has been served (#) |
Midpoints (“MIDPOINTS” ) | The number of users for which the ad played to the midpoint of the ads total length (#) |
Off Spotify Impressions ("OFF_SPOTIFY_IMPRESSIONS" ) | The number of ads served off of Spotify (#) |
Paid Listens (“PAID_LISTENS” ) | The number of listens for a CPCL campaign where a user did NOT skip the ad -- NOTE: Applies to active audio/CPCL campaigns only |
Frequency of Paid Listens (“PAID_LISTENS_FREQUENCY” ) | The average frequency for listens on a CPCL campaign -- NOTE: Applies to CPCL campaigns only |
Reach of Paid Listens (“PAID_LISTENS_REACH” ) | The number of unique users who had a paid listen for this CPCL campaign -- NOTE: Applies to active audio/CPCL campaigns only |
Reach of Ads Served (“REACH” ) | The number of unique users who received your ad (#) |
Amount Spent ("SPEND" ) | The total amount spent in this campaign (#) |
Starts (“STARTS” ) | The number of times a user starts hearing/viewing your ad (#) |
Skips("SKIPS" ) | The number of times a user skips an ad -- NOTE: Skippable ads are currently supported in AU only (#) |
Third Quartiles (“THIRD_QUARTILES” ) | The number of users who listened or viewed 75% of the ad's total length (#) |
Unmutes ("UNMUTES" ) | The number of times a user unmutes an ad (#) |
Video Expands ("VIDEO_EXPANDS" ) | The number of times someone tapped your ad to expand it -- NOTE: Only available for campaigns with the video views objective (#) |
Video Expand Rate ("VIDEO_EXPAND_RATE" ) | The number ad expands divided by the number of impressions -- NOTE: Only available for campaigns with the video views objective (%) |
Video Views ("VIDEO_VIEWS" ) | The number of times your video played for at least 3 seconds -- NOTE: Only available for campaigns with the video views objective (#) |
Streaming Conversion Metrics
Available only for artist and podcast promotion campaigns. These metrics show you how listeners are responding to your ad so that you can understand how advertising impacts the listener journey on Spotify.
Metric/Field | Definition |
---|---|
Conversion Rate (“CONVERSION_RATE” ) | The percentage of users who listened to the artist after seeing or hearing an ad served by the campaign (%) |
Intent Rate (“INTENT_RATE” ) | The rate at which listeners indicated an intent to stream the artist again in the future (%) |
New Listeners (“NEW_LISTENERS” ) | The total number of users who listened to the artist for the first time in at least a month after seeing or hearing the ad (#) |
New Listener Streams ("NEW_LISTENER_STREAMS" ) | The total number of streams from new listeners who saw/heard the ad (#) |
New Listeners Conversion Rate (“NEW_LISTENER_CONVERSION_RATE” ) | The percentage of users who listened to the artist for the first time in at least a month after seeing or hearing the ad (%) |
Streams ("STREAMS" ) | The total number of streams from listeners who saw/heard the ad (#) |
Streams per Listener (“STREAMS_PER_USER” ) | The average number of times each listener streamed the artist after seeing/hearing the ad (#) |
Streams per New Listener (“STREAMS_PER_NEW_LISTENER” ) | The average number of times each new listener streamed the artist after seeing/hearing the ad (#) |
Unique Listeners(“LISTENERS” ) | The number of users who listened to the artist after hearing/seeing an ad (#) |
Pixel Metrics
These metrics help you understand how your advertising drives measurable conversions, providing insights into post-ad behaviors and the overall effectiveness of your campaign.
Metric/Field | Definition |
---|---|
Modeled Add to Cart (“MODELED_ADD_TO_CART” ) | The number of attributed add-to-cart events by modeled (not IP-matched) households (#) |
Modeled Leads (“MODELED_LEAD” ) | The number of attributed add-to-cart events by modeled (not IP-matched) households (#) |
Modeled Page Views (“MODELED_PAGE_VIEW” ) | The number of attributed website page views by modeled (not IP-matched) households (#) |
Modeled Purchases (“MODELED_PURCHASE” ) | The number of attributed purchase events by modeled (not IP-matched) households (#) |
Unmodeled Add to Cart (“UNMODELED_ADD_TO_CART” ) | The number of attributed add-to-cart events by IP-matched households (#) |
Unmodeled Leads (“UNMODELED_LEAD” ) | The number of attributed add-to-cart events by IP-matched households (#) |
Unmodeled Page Views (“UNMODELED_PAGE_VIEW” ) | The number of attributed website page views by IP-matched households (#) |
Unmodeled Purchases (“UNMODELED_PURCHASE” ) | The number of attributed purchase events by IP-matched households (#) |
App Conversion Metrics
These metrics track the actions users take with your app after interacting with your ad, helping you to understand how your advertising influences behavior associated with your app.
Metric/Field | Definition |
---|---|
App Installs (AppsFlyer) (“APPSFLYER_APP_INSTALLS” ) | The number of installs and redownloads that AppsFlyer attributed to your Spotify campaign (#) |
App Installs (Kochava) (“KOCHAVA_APP_INSTALLS” ) | The number of installs and redownloads that Kochava attributed to your Spotify campaign (#) |
SKAdNetwork App Installs (“SKAD_APP_INSTALLS” ) | The number of installs and redownloads that SKAdNetwork (SKAN) attributed to your Spotify campaign (#) |