Gauges

Gauges List

Returns an array of your gauges, with recent traffic included.

Parameters

page optional Page number

URL

GET https://secure.gaug.es/gauges

Request

curl -H "X-Gauges-Token: <token>" https://secure.gaug.es/gauges

Response

{
  "gauges": [
    {
      "id":"4ea97a8be5947ccda1000001",
      "title":"acme.com",
      "created_at":"2011-01-21T03:31:44-04:00",
      "tz":"Eastern Time (US & Canada)",
      "now_in_zone":"2011-08-24T09:11:50-04:00",
      "enabled":true,
      "creator_id":"4e206261e5947c1d38000001",
      "urls": {
        "self":"https://secure.gaug.es/gauges/4ea97a8be5947ccda1000001",
        "referrers":"https://secure.gaug.es/gauges/4ea97a8be5947ccda1000001/referrers",
        "technology":"https://secure.gaug.es/gauges/4ea97a8be5947ccda1000001/technology",
        // ... etc
      },
      "all_time":{
        "views":264646,
        "people":125049
      },
      "today":{
        "date":"2011-08-24",
        "views":515,
        "people":338
      },
      "yesterday":{
        "date":"2011-08-23",
        "views":1493,
        "people":1011
      },
      "recent_hours":[
        {
          "hour":"09",
          "views":16,
          "people":14
        },
        // ... etc
      ],
      "recent_months":[
        {
          "date":"2011-08-01",
          "views":30146,
          "people":15363
        },
        // ... etc
      ],
      "recent_days":[
        {
          "date":"2011-08-24",
          "views":515,
          "people":338
        },
        // ... etc
      ]
    }
  ]
}

Create a New Gauge

Creates a gauge.

URL

POST https://secure.gaug.es/gauges

Parameters

title required The title of the gauge
tz required The time zone that should be used for all date/time operations (reference)
allowed_hosts optional Comma or space separated list of domains to accept tracking data from

Request

curl -H "X-Gauges-Token: <token>" \
     -d "title=Example" \
     -d "tz=Eastern Time (US %26 Canada)" \
     https://secure.gaug.es/gauges

Response

{
  "gauge": {
    "id":"4ea98258e5947ccda1000002",
    "title":"example.com",
    "created_at":"2011-01-21T03:31:44-04:00",
    "tz":"Eastern Time (US & Canada)",
    "now_in_zone":"2011-08-24T09:11:50-04:00",
    "enabled":true,
    "creator_id":"4e206261e5947c1d38000001",
    "urls": {
      "referrers":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002/referrers",
      "self":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002",
      "technology":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002/technology",
      // ... etc
    },
    // ... etc
  }
}

Gauge Detail

Gets details for a gauge.

URL

GET https://secure.gaug.es/gauges/:id

Request

curl -H "X-Gauges-Token: <token>" https://secure.gaug.es/gauges/:id

Response

{
  "gauge": {
    "id":"4ea98258e5947ccda1000002",
    "title":"example.com",
    "created_at":"2011-01-21T03:31:44-04:00",
    "tz":"Eastern Time (US & Canada)",
    "now_in_zone":"2011-08-24T09:11:50-04:00",
    "enabled":true,
    "creator_id":"4e206261e5947c1d38000001",
    "urls": {
      "referrers":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002/referrers",
      "self":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002",
      "technology":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002/technology",
      // ... etc
    },
    "all_time":{
      "views":264646,
      "people":125049
    },
    "today":{
      "date":"2011-08-24",
      "views":515,
      "people":338
    },
    "yesterday":{
      "date":"2011-08-23",
      "views":1493,
      "people":1011
    },
    "recent_hours":[
      {
        "hour":"09",
        "views":16,
        "people":14
      },
      // ... etc
    ],
    "recent_months":[
      {
        "date":"2011-08-01",
        "views":30146,
        "people":15363
      },
      // ... etc
    ],
    "recent_days":[
      {
        "date":"2011-08-24",
        "views":515,
        "people":338
      },
      // ... etc
    ]
  }
}

Update a Gauge

Updates and returns a gauge with the updates applied.

URL

PUT https://secure.gaug.es/gauges/:id

Parameters

title required The title of the gauge
tz required The time zone that should be used for all date/time operations
allowed_hosts optional Comma or space separated list of domains to accept tracking data from

Request

curl -H "X-Gauges-Token: <token>" \
     -X PUT \
     -d "title=New Title" \
     https://secure.gaug.es/gauges/:id

Response

{
  "gauge": {
    "id":"4ea98258e5947ccda1000002",
    "title":"New Title",
    "created_at":"2011-01-21T03:31:44-04:00",
    "tz":"Eastern Time (US & Canada)",
    "now_in_zone":"2011-08-24T09:11:50-04:00",
    "enabled":true,
    "creator_id":"4e206261e5947c1d38000001",
    "urls": {
      "referrers":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002/referrers",
      "self":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002",
      "technology":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002/technology",
      // ... etc
    },
    // ... etc
  }
}

Delete a Gauge

Permanently deletes a gauge.

URL

DELETE https://secure.gaug.es/gauges/:id

Request

curl -H "X-Gauges-Token: <token>" \
     -X DELETE \
     https://secure.gaug.es/gauges/:id

Response

{
  "gauge": {
    "id":"4ea98258e5947ccda1000002",
    "title":"example.com",
    "created_at":"2011-01-21T03:31:44-04:00",
    "tz":"Eastern Time (US & Canada)",
    "now_in_zone":"2011-08-24T09:11:50-04:00",
    "enabled":true,
    "creator_id":"4e206261e5947c1d38000001",
    "urls": {
      "referrers":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002/referrers",
      "self":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002",
      "technology":"https://secure.gaug.es/gauges/4ea98258e5947ccda1000002/technology",
      // ... etc
    },
    // ... etc
  }
}