Simple predictive analytics

Spend more time working with data; and not for data.

Try it now!

See it in action!

While we build proper dynamic dashboard for your statistics, you can use Trifle API as a source of data for your own visualizations.

Build your model

All data you send is processed and used to build statistical model.

You define what dimensions are you interested in tracking, and Trifle automatically creates statistical record for it. Dimensions can be simple hash values, hash with arrays, or even hash with array of hashes (like in this example).

Trifle automatically unzips dimension definition into flat array and then updates all necessary statistical records.

curl -X "POST" "https://trifle.io/api/metrics/" \
     -H 'X-Auth-Token: TOKEN' \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "dimensions": {
    "range": [
      {
        "range": "day",
        "updated_at": "2019-04-04"
      },
      {
        "range": "month",
        "updated_at": "2019-04"
      }
    ],
    "product_id": "157283205"
  },
  "model": "product",
  "method": "inc",
  "data": {
    "price": "1449",
    "sample": "1"
  },
  "project_id": "5ce58c895c19e18fc5aaff24"
}'

Response:
{"data":{"status":"Created"}}
curl -X "POST" "https://trifle.io/api/metrics/aggregate" \
     -H 'X-Auth-Token: TOKEN' \
     -H 'Content-Type: text/plain; charset=utf-8' \
     -d $'{
  "project_id": "5ce58c895c19e18fc5aaff24",
  "model": "product",
  "aggregate": [
    {
      "$match": {
        "dimensions.range": "day",
        "dimensions.product_id": "157283205"
      }
    },
    {
      "$group": {
        "_id": "$dimensions.product_id",
        "sample": {
          "$sum": "$data.sample"
        },
        "price": {
          "$sum": "$data.price"
        }
      }
    }
  ]
}'

Response:
{
  "data": [
    {
      "id": "157283205",
      "price": 7345.0,
      "sample": 5.0
    }
  ]
}

Powerful aggregation framework

To make it simple for processing, you aggregate to transform your data, execute sum, min, max and many other functions.

Trifle follows similar aggregation pattern of MongoDB, so if you ever had to aggregate in MongoDB, you will be aggregating in Trifle in no time.

Get dirty with raw data

For times when you need to see whats really in your statistical model, you can always get raw data from Trifle.

This comes in handy when you wanna do the heavy lifting by yourself. Or let other libraries like Crossfilter to do calculations for you. Hey, we did both and it works great!

curl -X "POST" "https://trifle.io/api/metrics/raw" \
     -H 'X-Auth-Token: TOKEN' \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "project_id": "5ce58c895c19e18fc5aaff24",
  "model": "product",
  "dimensions": {
    "range": "day",
    "product_id": "157283205"
  }
}'

Response:
{
  "data": [
    {
      "data": {
        "price": 4447.0,
        "sample": 3.0
      },
      "dimensions": {
        "product_id": "157283205",
        "range": "day",
        "updated_at": "2019-04-02"
      },
      "model": "product",
      "project_id": "5ce58c895c19e18fc5aaff24"
    },
    {
      "data": {
        "price": 1449.0,
        "sample": 1.0
      },
      "dimensions": {
        "product_id": "157283205",
        "range": "day",
        "updated_at": "2019-04-03"
      },
      "model": "product",
      "project_id": "5ce58c895c19e18fc5aaff24"
    },
    {
      "data": {
        "price": 1449.0,
        "sample": 1.0
      },
      "dimensions": {
        "product_id": "157283205",
        "range": "day",
        "updated_at": "2019-04-04"
      },
      "model": "product",
      "project_id": "5ce58c895c19e18fc5aaff24"
    }
  ]
}

Wait a second. Where does Trifle come from?

Original idea for Trifle came in late 2015. I decided to build my own performance monitoring tool for Ruby on Rails. After running quick alpha and long beta, it actually worked really really well. Unfortunatelly, it didn't gain much traction so after almost a year in production I decided to move on. You can read more about it here.
Now we are a year or two later. After building similar analytical engine for the third time, I decided thats enough and used everything I've learnt to make an universal one. The one that doesn't care if you wanna track performance of your application, prices of a product or your Instagram followers.
Ⓒ Trifle, Inc