Help Center Manage Your Account AdSpeed API
Ad
Documentation for API methods to manage one or multiple ads.API Version
1.4.6 (build 20240530). This page was updated on Wed, 13 Nov 24 12:08:15 -0500. Since the API method and response format can change from one version to another, you should check this page for updates.API Methods - Ad
- AS.Ads.getCounts
- AS.Ads.getList
- AS.Ads.createBanner
- AS.Ads.createVideo
- AS.Ads.createVASTWrapper
- AS.Ads.createHTML
- AS.Ads.createText
- AS.Ad.linkToZone
- AS.Ad.unlinkFromZone
- AS.Ad.linkToGroup
- AS.Ad.unlinkFromGroup
- AS.Ad.linkToAdvertiser
- AS.Ad.placeOrder
- AS.Ad.edit
- AS.Ad.getRestrictions
- AS.Ad.addRestriction
- AS.Ad.getAdTag
- AS.Ad.getLinkedZones
- AS.Ad.getAdTagForLinkedZones
- AS.Ad.getStats
- AS.Ad.getVisitorStats
AS.Ads.getCounts
Return the number of active, pending, deleted and total ads for this publisher or ad networkAdditional Parameters
- None
Sample Request
Sample Response
<Ads total="7" active="3" pending="4" archived="0" deleted="0"/>
AS.Ads.getList
Return the list of ads for this publisher or ad networkAdditional Parameters
Parameter | Required | Description |
---|---|---|
status | Optional Default value is empty | Filter ads with this status. Possible value: 'active','pending','archived' |
perpage | Optional Default value is "10" | The number of items per page. Maximum value is 100. |
page | Optional Default value is "1" | The page number |
Sample Request
Sample Response
<Ads total="7" page="1" numpage="2" perpage="4"> <Ad id="35093" name="Sample Text Ad" status="active" weight="10"/> <Ad id="36943" name="Sample Image Ad" status="active" weight="10" width="468" height="60"/> <Ad id="40631" name="Sample Rich HTML Ad" status="pending" weight="10" width="300" height="250"/> <Ad id="54412" name="Sample Text Link Ad" status="pending" weight="10"/> </Ads>
AS.Ads.createBanner
Create a new banner ad. Submit via POST. Limit 50 calls/day.Additional Parameters
Parameter | Required | Description |
---|---|---|
name | Required | Name of this ad |
clickurl | Required | Destination URL to redirect when the ad is clicked on. Must be URL-encoded properly. |
imageurl | Required | URL of an image file (JPG, GIF, PNG, BMP, SWF). Must be URL-encoded properly. |
weight | Optional Default value is "1" | Ad weight |
Sample Request
Sample Response
<Ad id="123" name="SampleGIFAd" status="active" weight="0"></Ad>
AS.Ads.createVideo
Create a new VAST video ad. Submit via POST. Limit 50 calls/day.Additional Parameters
Parameter | Required | Description |
---|---|---|
name | Required | Name of this ad |
videourl | Required | URL of an video file (MP4, MOV, MPG, FLV). Must be URL-encoded properly. |
clickurl | Optional Default value is empty | Destination URL to redirect when the ad is clicked on. Must be URL-encoded properly. |
weight | Optional Default value is "1" | Ad weight |
skippable | Optional Default value is empty | Skippable after a number of seconds |
Sample Request
Sample Response
<Ad id="123" name="SampleVASTVideoAd" status="active" weight="0"></Ad>
AS.Ads.createVASTWrapper
Create a new VAST wrapper video ad. Submit via POST. Limit 50 calls/day.Additional Parameters
Parameter | Required | Description |
---|---|---|
name | Required | Name of this ad |
wrapperurl | Required | URL of the VAST wrapper. Must be URL-encoded properly. |
weight | Optional Default value is "1" | Ad weight |
skippable | Optional Default value is empty | Skippable after a number of seconds |
Sample Request
Sample Response
<Ad id="123" name="SampleVASTWrapperVideoAd" status="active" weight="0"></Ad>
AS.Ads.createHTML
Create a new Rich-Media/HTML ad. Submit via POST. Limit 50 calls/day.Additional Parameters
Parameter | Required | Description |
---|---|---|
name | Required | Name of this ad |
htmlbase64 | Required | The base64-encoded HTML ad code. Must be encoded using base64_encode. |
width | Required | Ad width in pixels |
height | Required | Ad height in pixels |
weight | Optional Default value is "1" | Ad weight |
Sample Request
Sample Response
<Ad id="123" name="SampleHTMLAd" status="active" weight="0"></Ad>
AS.Ads.createText
Create a new text-link ad. Submit via POST. Limit 50 calls/day.Additional Parameters
Parameter | Required | Description |
---|---|---|
name | Required | Name of this ad |
first | Required | First text line |
next | Required | Next text line(s) |
clickurl | Required | Destination URL to redirect when the ad is clicked on. Must be URL-encoded properly. |
weight | Optional Default value is "1" | Ad weight |
Sample Request
Sample Response
<Ad id="123" name="SampleTextLinkAd" status="active" weight="0"></Ad>
AS.Ad.linkToZone
Link this ad to the specified zoneAdditional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
zone | Required | The zone ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name][Zone ID][Zone Name] |
Sample Request
Sample Response
<Confirmation ad="36943" zone="7607">LINKED</Confirmation>
AS.Ad.unlinkFromZone
Unlink this ad from the specified zoneAdditional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
zone | Required | The zone ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name][Zone ID][Zone Name] |
Sample Request
Sample Response
<Confirmation ad="36943" zone="7607">UNLINKED</Confirmation>
AS.Ad.linkToGroup
Link this ad to the specified groupAdditional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
group | Required | The group ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name][Group ID][Group Name] |
Sample Request
Sample Response
<Confirmation ad="36943" group="2600">LINKED</Confirmation>
AS.Ad.unlinkFromGroup
Unlink this ad from the specified groupAdditional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
group | Required | The group ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name][Group ID][Group Name] |
Sample Request
Sample Response
<Confirmation ad="36943" group="2600">UNLINKED</Confirmation>
AS.Ad.linkToAdvertiser
Link this ad to the specified advertiserAdditional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
advertiser | Required | The advertiser ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name][Advertiser ID][Advertiser Username] |
Sample Request
Sample Response
<Confirmation ad="36943" advertiser="1772">LINKED</Confirmation>
AS.Ad.placeOrder
(BETA) Place an ad order. Requirements: ad is already linked to the advertiser. Ad dimension matches the chosen rate. Order amount is within the rate range.Additional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
advertiser | Required | The advertiser ID |
rate | Required | The media kit rate ID |
amount | Required | The order amount |
notes | Optional Default value is empty | Notes or description |
coupon | Optional Default value is empty | Coupon code |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name][Advertiser ID][Advertiser Name] |
Sample Request
Sample Response
<Result>Your advertising order has been placed. Once your payment is received, your order will be processed.</Result>
AS.Ad.edit
Edit this ad settings. Submit via POST.Additional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name] |
name | Optional Default value is empty | Change to a new ad name |
clickurl | Optional Default value is empty | The landing URL to redirect when someone clicks on this ad (must be URL-encoded properly) |
imageurl | Optional Default value is empty | The URL of an external JPG/GIF/BMP/SWF file (must be URL-encoded properly) |
htmlbase64 | Optional Default value is empty | The base64-encoded HTML code for a Rich-Media/HTML ad. Must be encoded using base64_encode |
vastxmlbase64 | Optional Default value is empty | The base64-encoded XML code for the MediaFiles section of a VAST video ad. Must be encoded using base64_encode |
width | Optional Default value is empty | The ad width in pixel |
height | Optional Default value is empty | The ad height in pixel |
weight | Optional Default value is empty | The ad weight |
optimizer | Optional Default value is empty | The ad optimization method. Possible value: "none", "rev", "clk", "ctr", "conv" |
skippable | Optional Default value is empty | For VAST video ads: Skippable after a number of seconds |
status | Optional Default value is empty | The ad status. Possible value: "active", "pending", "deleted" |
Sample Request
Sample Response
<Ad id="36943" name="Sample Image Ad" status="active" weight="10" width="468" height="60"/>
AS.Ad.getRestrictions
View restrictions of this adAdditional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name] |
Sample Request
Sample Response
<Restrictions entity="[Ad] Sample Image Ad"># Conditions --------------------------------------------------------- 1. Show if visitor is from United States, Canada, AND 2. Show during the hours of 08:xx, 09:xx, 10:xx, 11:xx </Restrictions>
AS.Ad.addRestriction
Add a restriction to this adAdditional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name] |
logic | Optional Default value is "and" | The logical operator for this restriction. Possible value: "and", "or" |
bracket | Optional Default value is empty | The logical grouping (only needed for a complex setup) |
type | Required | The type of restriction. Possible value: "continent", "country", "region", "metro", "city", "startend", "keyword", "totalimp", "monthimp" |
compare | Optional Default value is "show" | The comparison operator for this restriction. Possible value: "show", "hide" |
value | Required | The value of this restriction. Please contact us for syntax/format. |
Sample Request
Sample Response
<Restrictions entity="[Ad] Sample Image Ad"># Conditions --------------------------------------------------------- 1. Show if visitor is from United States, Canada, AND 2. Show during the hours of 08:xx, 09:xx, 10:xx, 11:xx </Restrictions>
AS.Ad.getAdTag
Return the ad serving tag for this adAdditional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name] |
width | Required | The ad width in pixels |
height | Required | The ad height in pixels |
Sample Request
Sample Response
<Ad id="36943" name="Sample Image Ad" status="active" weight="10" width="468" height="60"> <ServingCode type="regular" format="comprehensive"> <!-- AdSpeed.com Tag 8.1 for [Ad] Sample Image Ad 468x60 --> <script type="text/javascript"><![CDATA[ var asdate=new Date();var q='&tz='+asdate.getTimezoneOffset()/60 +'&ck='+(navigator.cookieEnabled?'Y':'N') +'&jv='+(navigator.javaEnabled()?'Y':'N') +'&scr='+screen.width+'x'+screen.height+'x'+screen.colorDepth +'&z='+Math.random() +'&ref='+escape(document.referrer.substr(0,255)) +'&uri='+escape(document.URL.substr(0,255));document.write('<ifr'+'ame width="468" height="60" src="http://g.adspeed.net/ad.php?do=html&aid=36943&oid=111&wd=468&ht=60&target=_blank'+q+'" frameborder="0" scrolling="no" allowtransparency="true" hspace="0" vspace="0"></ifr'+'ame>'); ]]></script> <noscript> <iframe width="468" height="60" src="http://g.adspeed.net/ad.php?do=html&aid=36943&oid=111&wd=468&ht=60&target=_blank" frameborder="0" scrolling="no" allowtransparency="true" hspace="0" vspace="0"> <a href="http://g.adspeed.net/ad.php?do=clk&aid=36943&oid=111&wd=468&ht=60&pair=as" target="_blank"> <img style="border:0;max-width:100%;height:auto;" src="http://g.adspeed.net/ad.php?do=img&aid=36943&oid=111&wd=468&ht=60&pair=as" alt="i" width="468" height="60"/> </a> </iframe> </noscript> <!-- AdSpeed.com End --> </ServingCode> </Ad>
AS.Ad.getLinkedZones
Return the list of zones linked to this adAdditional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name] |
perpage | Optional Default value is "10" | The number of items per page. Maximum value is 100. |
page | Optional Default value is "1" | The page number |
Sample Request
Sample Response
<Ad id="36943" name="Sample Image Ad" status="active" weight="10" width="468" height="60"> <Zones total="3" page="1" numpage="1" perpage="4"> <Zone id="20852" name="Newsletter 468x60 Ad" status="active" secondary="7607"/> <Zone id="7549" name="Section Travel" status="active" secondary="7607"/> <Zone id="7681" name="Section Music" status="active" secondary="7607"/> </Zones> </Ad>
AS.Ad.getAdTagForLinkedZones
Return the list of zones linked to this ad and their ad tagsAdditional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name] |
perpage | Optional Default value is "10" | The number of items per page. Maximum value is 100. |
page | Optional Default value is "1" | The page number |
Sample Request
Sample Response
<Ad id="36943" name="Sample Image Ad" status="active" weight="10" width="468" height="60"> <Zones total="3" page="1" numpage="2" perpage="2"> <Zone id="20852" name="Newsletter 468x60 Ad" status="active" secondary="7607"> <ServingCode type="regular" format="comprehensive"> <!-- AdSpeed.com Tag 8.1 for [Zone] Newsletter 468x60 Ad 468x60 --> <script type="text/javascript"><![CDATA[ var asdate=new Date();var q='&tz='+asdate.getTimezoneOffset()/60 +'&ck='+(navigator.cookieEnabled?'Y':'N') +'&jv='+(navigator.javaEnabled()?'Y':'N') +'&scr='+screen.width+'x'+screen.height+'x'+screen.colorDepth +'&z='+Math.random() +'&ref='+escape(document.referrer.substr(0,255)) +'&uri='+escape(document.URL.substr(0,255));document.write('<ifr'+'ame width="468" height="60" src="http://g.adspeed.net/ad.php?do=html&zid=20852&oid=111&wd=468&ht=60&target=_blank'+q+'" frameborder="0" scrolling="no" allowtransparency="true" hspace="0" vspace="0"></ifr'+'ame>'); ]]></script> <noscript> <iframe width="468" height="60" src="http://g.adspeed.net/ad.php?do=html&zid=20852&oid=111&wd=468&ht=60&target=_blank" frameborder="0" scrolling="no" allowtransparency="true" hspace="0" vspace="0"> <a href="http://g.adspeed.net/ad.php?do=clk&zid=20852&oid=111&wd=468&ht=60&pair=asemail" target="_blank"> <img style="border:0;max-width:100%;height:auto;" src="http://g.adspeed.net/ad.php?do=img&zid=20852&oid=111&wd=468&ht=60&pair=asemail" alt="i" width="468" height="60"/> </a> </iframe> </noscript> <!-- AdSpeed.com End --> </ServingCode> </Zone> <Zone id="7549" name="Section Travel" status="active" secondary="7607"> <ServingCode type="regular" format="comprehensive"> <!-- AdSpeed.com Tag 8.1 for [Zone] Section Travel 468x60 --> <script type="text/javascript"><![CDATA[ var asdate=new Date();var q='&tz='+asdate.getTimezoneOffset()/60 +'&ck='+(navigator.cookieEnabled?'Y':'N') +'&jv='+(navigator.javaEnabled()?'Y':'N') +'&scr='+screen.width+'x'+screen.height+'x'+screen.colorDepth +'&z='+Math.random() +'&ref='+escape(document.referrer.substr(0,255)) +'&uri='+escape(document.URL.substr(0,255));document.write('<ifr'+'ame width="468" height="60" src="http://g.adspeed.net/ad.php?do=html&zid=7549&oid=111&wd=468&ht=60&target=_blank'+q+'" frameborder="0" scrolling="no" allowtransparency="true" hspace="0" vspace="0"></ifr'+'ame>'); ]]></script> <noscript> <iframe width="468" height="60" src="http://g.adspeed.net/ad.php?do=html&zid=7549&oid=111&wd=468&ht=60&target=_blank" frameborder="0" scrolling="no" allowtransparency="true" hspace="0" vspace="0"> <a href="http://g.adspeed.net/ad.php?do=clk&zid=7549&oid=111&wd=468&ht=60&pair=as" target="_blank"> <img style="border:0;max-width:100%;height:auto;" src="http://g.adspeed.net/ad.php?do=img&zid=7549&oid=111&wd=468&ht=60&pair=as" alt="i" width="468" height="60"/> </a> </iframe> </noscript> <!-- AdSpeed.com End --> </ServingCode> </Zone> </Zones> </Ad>
AS.Ad.getStats
Return the stats for this ad. Limit 50 calls/day.Additional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name] |
metric | Required | The type of metric can be "impressions", "clicks", "revenue", "expense", "events" |
period | Required | The time period can be "hourly", "daily", "weekly", "monthly" |
range | Optional Default value is empty | The time range can be specified as Start|End using syntax YYYY.MM.DD|YYYY.MM.DD |
Sample Request
Sample Response
<StatRows generated="[Time Stamp]" title="[Entity Name]"> <StatRow> <Monthly>January 2024</Monthly> <Unique_Impression>3,156</Unique_Impression> <Gross_Impression>6,565</Gross_Impression> <Unique_over_Gross_Impression>48.07%</Unique_over_Gross_Impression> </StatRow> <StatRow>More Rows...</StatRow> <StatRow> <Monthly>Total</Monthly> <Unique_Impression>57,417</Unique_Impression> <Gross_Impression>114,979</Gross_Impression> <Unique_over_Gross_Impression>49.94%</Unique_over_Gross_Impression> </StatRow> <StatRow> <Monthly>Average</Monthly> <Unique_Impression>4,785</Unique_Impression> <Gross_Impression>9,582</Gross_Impression> <Unique_over_Gross_Impression>49.94%</Unique_over_Gross_Impression> </StatRow> </StatRows>
AS.Ad.getVisitorStats
Return the visitor report for this ad. Limit 50 calls/day.Additional Parameters
Parameter | Required | Description |
---|---|---|
ad | Required | The ad ID |
token | Required | The authentication MD5 hash generated from concatenating [Ad ID][Ad Name] |
metric | Required | The type of metric can be "countries", "continents", "areas", "timezones", "regions", "languages", "browsermajor", "browserminor", "platform", "ua", "screen", "cookie" |
range | Required | The time range can be "last7days", "last31days", "thismo", "lastmo", "alltime" |
Sample Request
Sample Response
<StatRows generated="[Time Stamp]" title="[Entity Name]" range="Alltime" metric="countries"> <StatRow> <Rank>1</Rank> <Country>United States</Country> <Flag/> <Percentage>95%</Percentage> </StatRow> <StatRow> <Rank>2</Rank> <Country>Canada</Country> <Flag/> <Percentage>5%</Percentage> </StatRow> </StatRows>
Other Articles in AdSpeed API
Documentation to use AdSpeed API to integrate AdSpeed AdServer into your own platform.
Cannot find an answer for your question? Ask our Customer Care team
Related
- Campaign
"Documentation for API methods to manage your campaigns in our ad server. API Version1.4.6 (build 20240530). This page was updated ..."
- Website
"Documentation for API methods to manage one or multiple websites. API Version1.4.6 (build 20240530). This page was updated on Mon, ..."
- Group
"Documentation for API methods to manage one or multiple groups. API Version1.4.6 (build 20240530). This page was updated on Mon, ..."
- Channels
"Documentation for API methods to manage one or multiple channels. API Version1.4.6 (build 20240530). This page was updated on Tue, ..."
- Zone
"Documentation for API methods to manage one or multiple zones. API Version1.4.6 (build 20240530). This page was updated on Sun, ..."