Skip to main content

API

Columns Ai offers the simplest API you could find to build fast, reliable and scalable real time analytics applications. Forget about the real time infrastracture setup and maintain, forget about tuning for efficiency and cost, also forget about building up analytical stack to the data. Columns Ai does all these for you, the only 2 things you need to do:

  1. create an api endpoint and pump your data in.
  2. call columns api to query the live data for your app.

In addition to that, Columns Ai provides a few useful templates to build visualization and data stories directly.

API endpoint#

To use Columns Api to post real time data in, you need to sign in your account, and

  • create or recreate an API key.
  • add a topic to host your data, a topic is a collection of your real time messages.

Note: currently we support JSON message only, we may support other formats in the formats, including but not limited to csv, thrift object, protobuf object.

Once you have an API key and a topic, you can post data to this single API (/api/event/send) with payload format defined as

{  // api key for a signed in user  apiKey: string;
  // topic to log these messages to  topic: string;
  // messages to log, have at least 1 message  messages: string[];}

For example, I can post a batch of messages like this:

curl -d "@data.json" -H "Content-Type: application/json" -X POST https://columns.ai/api/event/send

The content file "data.json" looks like this

{  "apiKey": "<API KEY>",  "topic": "test2",  "messages": [    "{\"name\":\"abc\",\"value\":8}",    "{\"name\":\"def\",\"value\":9}",    "{\"name\":\"ghi\",\"value\":10}",    "{\"name\":\"jkl\",\"value\":11}",    "{\"name\":\"mno\",\"value\":12}",    "{\"name\":\"pqr\",\"value\":13}",    "{\"name\":\"stu\",\"value\":14}",    "{\"name\":\"vwx\",\"value\":15}",    "{\"name\":\"yz\",\"value\":16}"  ]}

Note that, topic is globally unique in Columns Ai, it's a string name composed by alphabet letters[a-zA-Z], digits[0-9] and underscore[_] only.

Live query#

Once your topic has live data, you can build live data source on top of it. Through data source definition, you can pick sub set fields/values from your message, and run query on top of it. An event data source defines:

  1. data schema: define columns and types
  2. data retention: maximum time (in hours) of data to serve.

Once the data source is defined, your real time data is ready to serve, you have two ways to access it:

  1. Columns Ai UI through provided visualizer, visual templates and story composer.
  2. Columns Ai API where you can compose a query object, functions in a request and expect the live query result back.

free plan vs paid plan#

We encourage everyone to build with us through this simple API, the differnece is traffic limit allowance (Mb/s or messages/s). If you have a huge use case, please talk to us at info@columns.ai for direct support, we could provision dedicated cluster for you.

Please find details in the plan page on Columns Ai Subscription Plans

Analytical API with lease#

Columns offer you to bring your own data, and use Columns API to lease its computation cluster to bring up a fast analytical API. If this is something interesting to you, please follow up on this page