       opts =
         days: 0
       query msg, opts, (json) ->
-        msg.send formatResponse(json[0])
+        msg.send formatResponse(json[0], json[0].date)
 
     robot.respond /(sendgrid)( me)? total/i, (msg) ->
       opts =
         aggregate: 1
       query msg, opts, (json) ->
-        msg.send formatResponse(json)
+        msg.send formatResponse(json, "All Time")
 
-    robot.respond /(sendgrid)( me)? c(ategory)? (.*)/i, (msg) ->
-      category = msg.match[4]
+    robot.respond /(sendgrid)( me)? last (\d+)( days)?/i, (msg) ->
+      opts =
+        days: msg.match[3]
+        aggregate: 1
+      query msg, opts, (json) ->
+        msg.send formatResponse(json, "Last #{opts.days} days")
+
+    robot.respond /(sendgrid)( me)? c(ategory)?( total)? (.*)/i, (msg) ->
+      category = msg.match[5].trim()
+      match = /last (\d+)( days)?/i
+      #this response matches the next respond, so we need to short circuit it
+      #anyone got a better way?
+      if match.test(category) 
+        return
+      isAllTime = msg.match[4] is " total"
       msg.send "Category: #{category}"
       opts =
-        days: 0
         category: [category]
+
+      if(isAllTime)
+        opts.aggregate = 1
+      else
+        opts.days = 0
       query msg, opts, (json) ->
-        msg.send formatResponse(json[0])
+        if(isAllTime)
+          #surprisingly when you set a cateogry, the aggregate is sent in an array
+          msg.send formatResponse(json[0], "All Time")
+        else
+          msg.send formatResponse(json[0], json[0].date)
+
+    robot.respond /(sendgrid)( me)? c(ategory)? last (\d+)( days)? (.*)/i, (msg) ->
+      category = msg.match[6].trim()
+      msg.send "Category: #{category}"
+      opts =
+        category: [category]
+        aggregate: 1
+        days: msg.match[4]
+      query msg, opts, (json) ->
+        #surprisingly when you set a cateogry, the aggregate is sent in an array
+        msg.send formatResponse(json[0], "Last #{opts.days} days")
+          
+
+    robot.respond /(sendgrid)( me)? categories/i, (msg) ->
+      opts =
+        list: "true"
+      query msg, opts, (json) ->
+        msg.send json[0].category
+        categories = for cat in json
+          "  #{cat.category}"
+        msg.send categories.join('\n')
   
 query = (msg, opts, callback) ->
   opts.api_user = env.HUBOT_SENDGRID_USER

  msg.http("https://sendgrid.com/api/stats.get.json")
    .query(opts)
    .get() (err, res, body) ->
      callback JSON.parse(body)

stats =
  requests: 'Requests'

  spamreports: 'Spam Reports'
  repeat_spamreports: 'Repeat Spam Reports'

formatResponse = (json, header) =>
  details = for stat, description of stats
    "  #{description}: #{json[stat]}"
  details.unshift "Stats for #{header}:"
  details.join("\n")
