API Overview

The 140 Proof API lets your app retrieve targeted ads in your social application.

Join the developer discussion in our Google Group.


140 Proof REST API Resources

GET /ads/user.{html,xml,json,js}

Description:

Returns an ad for a specified user. Returns an HTTP 404 error if the user does not exist, if the app does not exist, or if a targetted ad could not be found for the user.

Parameters:

Usage examples:
curl "http://api2.140proof.com/ads/user.html?network=Twitter&user_name=sferik&app_name=Test&app_version=1.0.0&platform_name=Web&platform_version=5&width=320"
curl "http://api2.140proof.com/ads/user.xml?network=Twitter&user_name=sferik&app_name=Test&app_version=1.0.0&platform_name=Web&platform_version=5&width=320"
curl "http://api2.140proof.com/ads/user.json?network=Twitter&user_name=sferik&app_name=Test&app_version=1.0.0&platform_name=Web&platform_version=5&width=320"
curl "http://api2.140proof.com/ads/user.js?network=Twitter&user_name=sferik&app_name=Test&app_version=1.0.0&platform_name=Web&platform_version=5&width=320&jsonp=callback"

Example JSON Text Response

{
  "ads": [{
    "click_url": "http://140proof.com",
    "type": "text",
    "impression_url": "http://api2.140proof.com/images/blank.gif",
    "advertiser": "140 Proof",
    "tweet_url": "http://twitter.com/?status=Are+you+advertising+on+Twitter+yet%3F+Use+140+Proof+ads+to+reach+the+audience+you+want+with+ads+like+this.+Learn+more%3A+http%3A%2F%2F140proof.com",
    "text": "Are you advertising on Twitter yet? Use 140 Proof ads to reach the audience you want with ads like this. Learn more: <a href=\"http://140proof.com\">http://140proof.com</a>",
    "byline": "<a href=\"http://140proof.com/\">ads by 140 Proof</a>"
  }]
}

Example JSON Banner Response

{
  "ads": [{
    "click_url": "http://140proof.com",
    "type": "banner",
    "impression_url": "http://dev.140proof.com/images/sample_banner.jpg",
    "advertiser": "140 Proof",
    "tweet_url": "http://twitter.com/?status=Are+you+advertising+on+Twitter+yet%3F+Use+140+Proof+ads+to+reach+the+audience+you+want+with+ads+like+this.+Learn+more%3A+http%3A%2F%2F140proof.com",
    "text": "Are you advertising on Twitter yet? Use 140 Proof ads to reach the audience you want with ads like this. Learn more: <a href=\"http://140proof.com\">http://140proof.com</a>",
    "byline": "<a href=\"http://140proof.com/\">ads by 140 Proof</a>"
  }]
}

App Requirements

To receive payment for serving an ad, your app must implement the following:
  1. Your ad unit must comply with the Twitter API Terms of Service. Ads may not appear within the Twitter timeline, cannot resemble or reasonably be confused by users as a tweet, and must be clearly separate from Twitter content.
  2. The ad unit must be clearly delineated. We recommend changing the background color to cream (#ffffcc) or light green (#ccffcc). Please contact us if you have questions about how to properly identify 140 Proof ads in your application.
  3. The ad's byline must be displayed at a legible font size.
  4. The ad's text must be displayed at the same font size as other text in your app. It should be tweetable via a menu or secondary-click action (this will vary on an app-by-app basis, please contact us if you have any questions). Selecting the tweet action should populate the status field with the ad text. The user can then submit the status message to tweet the ad as with any other status update. This functionality is similar to "old-style" retweet functionality, except with out the "RT @username:" appended to the beginning of the ad text.
  5. The ad's click_url must have the same behavior as links in other text in your app. All links identified in the ad's text must be directed to the click_url.
  6. The ad's impression_url will reference an image that must be displayed at the same time as the ad. In the case of banner ads, the impression_url will be the contents of the ad (any text specified need not be displayed but should be used to populate the status field when the user attempts to tweets a banner ad). NOTE: This URL may have an HTTP Status Code 301 (Moved Permanently) or 302 (Found). All redirects must be followed.
  7. The ad's tweet_url must called when a user selects the tweet action.
  8. Once an ad unit is inserted, your app may not insert another ad unit for at least 10 minutes. Additionally, two or more ads should never be visible in the same viewport at the same time.

Sample Text Ad Unit

Sample Banner Ad Unit

Are you advertising on Twitter yet? Use 140 Proof ads to reach the audience you want with ads like this. Learn more: http://140proof.com