Random Ad Retrieval - slickage/adness GitHub Wiki

Adness random ad retrieval

'/sb/ads/random?ip=192.168.1.1&limit=25'

Query Parameters

IP

This is the up address of the user. This is needed to ensure that ads that are not allowed in the user's country can be filtered out in the return value. If no IP is given, all ads that have been put into rotation by the auction winners are qualified and can be returned.

limit

This is number of ads to return. If the limit value is larger than the number of ads in rotation by all auction winners, then the algorithm will fill the extraneous slots until the limit value is reached. If no value is given, it will default to one.

Example Output:

[
  {
    "html": "in Rotation, allow all countries",
    "blacklistedCN": [
      "US",
      "CN"
    ],
    "created_at": 1397619445576,
    "modified_at": 1397619478699
  },
  {
    "html": "in Rotation, no China",
    "blacklistedCN": [
      "CN"
    ],
    "created_at": 1397619454113,
    "modified_at": 1397619482053
  },
  {
    "html": "in Rotation, no US",
    "blacklistedCN": [
      "US"
    ],
    "created_at": 1397619463403,
    "modified_at": 1397619485308
  }
]