The Report API now allows grouping and filtering by product

If you are interested in grouping your reports per “product” (ie Links, Widgets, ...), you now can you use &group=product. For instance,

http://api.affinitad.com/report/v1?start=2013-02-02&end=2013-03-04&group=product&format=xml

will return:

  <?xml version="1.0"?>
    <twenga>
      <results total="2">
        <result>
          <product>3</product>
          <impressions>62906</impressions>
          <clicks>388</clicks>
          <keywords>296713</keywords>
          <revenues>36.36</revenues>
          <ctr>0.01</ctr>
          <ecpm>0.58</ecpm>
        </result>
        <result>
          <product>1</product>
          <impressions>65198</impressions>
          <clicks>1747</clicks>
          <keywords>279311</keywords>
          <revenues>87.35</revenues>
          <ctr>0.03</ctr>
          <ecpm>1.34</ecpm>
        </result>
      </results>
      <totals>
        <impressions>128104</impressions>
        <clicks>2135</clicks>
        <keywords>576024</keywords>
        <revenues>123.71</revenues>
      </totals>
      <averages>
        <impressions>1883.88</impressions>
        <clicks>31.40</clicks>
        <keywords>8470.94</keywords>
        <revenues>1.82</revenues>
        <ctr>0.00</ctr>
        <ecpm>0.01</ecpm>
      </averages>
    </twenga>

To filter by a specific product, you can use the &product=##ID## query parameter. For instance, to get detailed statistics on your Links product :

http://api.affinitad.com/report/v1?start=2013-02-02&end=2013-02-04&group=day&format=json&product=3

Will return:

{
  "results": {
    "result": [
      {
        "date": "2013-02-02",
        "impressions": "1723",
        "clicks": "10",
        "keywords": "11364",
        "revenues": "1.33",
        "ctr": "0.01",
        "ecpm": "0.77"
      },
      {
        "date": "2013-02-03",
        "impressions": "1802",
        "clicks": "18",
        "keywords": "15711",
        "revenues": "1.92",
        "ctr": "0.01",
        "ecpm": "1.07"
      },
      {
        "date": "2013-02-04",
        "impressions": "1454",
        "clicks": "16",
        "keywords": "13637",
        "revenues": "1.50",
        "ctr": "0.01",
        "ecpm": "1.03"
      }
    ],
    "@attributes": {
      "total": 3
    }
  },
  "totals": {
    "impressions": "4979",
    "clicks": "44",
    "keywords": "40712",
    "revenues": "4.75"
  },
  "averages": {
    "impressions": "1659.67",
    "clicks": "14.67",
    "keywords": "13570.67",
    "revenues": "1.58",
    "ctr": "0.00",
    "ecpm": "0.32"
  }
}