Sites List

By December 7, 2017Sites (gauges)

Returns an array of your sites, with recent traffic included.
Note: As reflected in the API language, we originally referred to sites as “gauges”.

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 Site

Creates a site.

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
  }
}

Site Detail

Gets details for a site.

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 Site

Updates and returns a site 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 Site

Permanently deletes a site.

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
  }
}

Leave a Reply