Skip to content

Arun Listening API

Overview

Arun Listening is a system that collects social media data and categories messages in the database.

This API is public, it provides the data to you in "JSON" format. You can use GET, POST, and PUT action on data via this API.

Screenshot

Other the template API. We have "Listening Graph API" to help you to get the data for each graph in ARUN Listening system in JSON format to made user easier to use the data.

Screenshot


Template API

Every account in ARUN Listening needs a template to set some condition to show messages. By these API, it will help you manage your template and get the data in each template that you want.

Using a valid access_token to request the authenticated Zanroo account to access.

Template: List

GET - use to get all template ids and names which will be used them on the next path.

Request

curl -X GET "https://api.zanroo.com/v1.0/arun/listening/template" -H "accept: application/json" -H "access-token: [ACCESS_TOKEN]"

Response

{
  "error": false,
  "body": {
    "items": [
      {
        "_id": "5b0597f0d747824de5afeea8",
        "name": "Horizon Mobile"
      },
      {
        "_id": "5b20d448654e95035bbd3bb1",
        "name": "data comparing"
      },
      {
        "_id": "5b7fb49c27577f5612f5f99f",
        "name": "untitle template"
      }
    ]
  }
}

Template: Information

GET - use to get template setting information for each template that you input by template id.

Request

curl -X GET "https://api.zanroo.com/v1.0/arun/listening/template/5b0597f0d747824de5afeea8" -H "accept: application/json" -H "access-token: [USER_ACCESS_TOKEN]"

Response

{
  "error": false,
  "body": {
    "_id": "5b0597f0d747824de5afeea8",
    "name": "Horizon Mobile",
    "options": {
      "sort_engine": "",
      "sort": [
        {
          "field": "created_time",
          "after": 0,
          "order": "desc"
        },
        {
          "field": "sys_time",
          "after": 0,
          "order": "desc"
        }
      ],
      "limit": "500",
      "skip": 0
    },
    "graph": {
      "interval": "week",
      "type": null
    },
    "account_id": "239",
    "user_id": "5aa4a2405e2ca9fd1200a2db",
    "__v": 4,
    "listening": {
      "keywords": [
        "5aa4a2a1f04f490871993615",
        "5aa4a29bf04f4908719935bc",
        "5aa4a2a1f04f490871993616",
        "5aa4a2a1f04f490871993617",
        "5aa4a2a1f04f490871993618",
        "5aa4a2a1f04f490871993619",
        "5aa4a2a1f04f49087199361a",
        "5aa4a2a1f04f49087199361b",
        "5aa4a2a1f04f49087199361c",
        "5aa4a2a1f04f49087199361d",
        "5aa4a2a1f04f49087199361e",
        "5aa4a2a1f04f49087199361f",
        "5aa4a2a1f04f490871993620",
        "5aa4a2a1f04f490871993621",
        "5aa4a2a2f04f49087199362d",
        "5aa4a2a2f04f49087199362c",
        "5aa4a2a2f04f490871993632",
        "5aa4a2a2f04f49087199362e",
        "5aa4a2a3f04f490871993633",
        "5aa4a2a3f04f490871993634",
        "5aa4a2a2f04f49087199362f",
        "5aa4a2a3f04f490871993635",
        "5aa4a2a3f04f490871993636",
        "5aa4a2a3f04f490871993639",
        "5aa4a2a3f04f490871993638",
        "5aa4a2a3f04f490871993637"
      ]
    },
    "updated_time": "2018-09-05T05:17:54.419Z",
    "action": "save",
    "layout": {},
    "monitor": {
      "youtube": [],
      "instagram": [],
      "twitter": [],
      "facebook": []
    },
    "time": {
      "until": "1536166799999",
      "since": "1533574800000"
    },
    "notification": {
      "is_show": true,
      "daily": {
        "emails": ["[email protected]"],
        "sending_time": "09:00",
        "status": "disable"
      },
      "weekly": {
        "emails": ["[email protected]"],
        "sending_day": "Mon",
        "sending_time": "09:00",
        "status": "enable",
        "day": "Monday"
      }
    },
    "is_share": false
  }
}

Template: Messages

GET - use to get all messages from template id that you choose and the limitation will be at 500 messages for 1 page.

Request

curl -X GET "https://api.zanroo.com/v1.0/arun/listening/template/5b0597f0d747824de5afeea8/messages" -H "accept: application/json" -H "access-token: [USER_ACCESS_TOKEN]"

Response

{
  "error": false,
  "body": {
    "shards": 5,
    "total": 293877,
    "hits": [
      {
        "id": "239_tw_965959199321505792_1037384853317025793",
        "mid": "tw_965959199321505792_1037384853317025793",
        "channel": "twitter",
        "platform": "twitter",
        "post_type": "text",
        "data_type": "twitter_status",
        "type": 5,
        "is_topic": false,
        "topic": "Retweeted",
        "desc": "RT @KewaKewa2: นั่งดูคอนใน <em>AIS</em> <em>PLAY</em> เจอผช.คนนี้หน้าคุ้นๆเนาะ หน้าเหมือนผัวเราเลย 😋\
    #เป๊กผลิตโชค \
    #peckpalitchoke https://t.co/4zv9mDMrrA",
        "langs": [
          {
            "code": "th",
            "percent": 76
          },
          {
            "code": "en",
            "percent": 18
          },
          {
            "code": "ha",
            "percent": 4
          }
        ],
        "link": "http://twitter.com/annrin13/status/1037384853317025793",
        "alphabet_langs": [
          {
            "code": "eng",
            "percent": 37
          },
          {
            "code": "tha",
            "percent": 50
          }
        ],
        "domain": "twitter.com",
        "info": {
          "default_country": "th",
          "from": {
            "_id": "twitter_965959199321505792",
            "gender": 0
          }
        },
        "z": {
          "engage": 0
        },
        "read": false,
        "hide": false,
        "created_time": 1536166797000,
        "sys_time": 1536172066115,
        "cts": 1536171291313,
        "cursor": "5b900b8ddaf8594f188c73a3",
        "account_id": "239",
        "keywords": [
          {
            "id": "5aa4a29df04f4908719935dd",
            "name": "AIS play",
            "sentiment": 0
          },
          {
            "id": "5aa4a29df04f4908719935de",
            "name": "AIS HBO",
            "sentiment": 0
          },
          {
            "id": "5aa4a29df04f4908719935db",
            "name": "AIS",
            "sentiment": 0
          },
          {
            "id": "5aa4a29bf04f4908719935bc",
            "name": "apple",
            "sentiment": 0,
            "tags": [
              {
                "_id": "5b20deda654e95035bbd3ca2",
                "name": "storage 64 gb"
              },
              {
                "_id": "5b20dec2654e95035bbd3c9d",
                "name": "phone spec"
              },
              {
                "_id": "5b20df28654e95035bbd3cac",
                "name": "storage 128 gb"
              }
            ]
          }
        ],
        "from_dump": false,
        "insert_es_time": "0001-01-01T00:00:00Z",
        "social_id": "965959199321505792"
      }
    ],
    "next": "/v1.0/arun/listening/template/5b0597f0d747824de5afeea8/messages?created_time=1536164104000&sys_time=1536174887531"
  }
}

Listening Graph API

In Zanroo ARUN listening platform we have "Panorama Dashboard" "Analytic Dashboard" and inside these dashboards, we have many graphs inside that. Also, this graph API will provide API to make you easier to get data with ready filtering.

Graph type

In Listening Graph API we have many graph types in ARUN listening. This table will show the detail of each graph.

Type Object Available Description
channel metric Show only channel value from template_id
channel_date interval Get messages count for each channel by template setting
channel_sentiment Get sentiment of messages count by channel from template setting
domain Get messages number for each domain by template setting
gender Get gender number from messages by template setting
geo map_setting Get geolocation graph from template setting
hashtag Get messages number from hashtag by template setting
keyword metric, group_by:hour Get messages number for each keyword from template setting
keyword_channel metric Get messages number for each keyword and group by channel from template setting
keyword_date metric Get messages numbers for each keyword by date from template setting
keyword_sentiment Get messages numbers for each keyword by sentiment from template setting
keyword_tag Get messages number for each keyword by tag from template setting
message_read Get messages number only 'read' filter from template setting
sentiment Get messages number by sentiment from template setting
sentiment_date interval Get messages number by sentiment from date in template setting
sum group_by : week_hour Get total messages number by date
tag Get messages number by tag from template setting
tag_channel Get messages number by tag for each channel from template setting
tag_keyword_channel Get tag in messages number for each keyword by channel in template setting
user Show messages value by user
tagcloud Get messages value from tagcloud in template setting

Request example

channel:

curl -X GET "https://api.zanroo.com/v1.0/arun/listening/template/{template_id}/graph/channel" -H "accept: application/json" -H "access-token: [ACCESS_TOKEN]"

keyword:

curl -X GET "https://api-dev.zrinf.io/v1.0/arun/listening/template/{template_id}/graph/keyword" -H "accept: application/json" -H "access-token: [ACCESS_TOKEN]"

All Object example

{
  "listening": {
    "domain": ["pantip.com"],
    "channels": ["facebook", "twitter", "webboard", "instagram", "news"],
    "keywords": ["keyword_1"]
  },
  "engagement": {
    "facebook_tl": ["facebook_541302072738016"],
    "facebook_status": ["facebook_541302072738016"],
    "facebook_dm": ["facebook_541302072738016"],
    "facebook_photo": ["facebook_541302072738016"],
    "facebook_ads": ["facebook_541302072738016"],
    "facebook_review": ["facebook_541302072738016"],
    "twitter_tl": ["twitter_541302072738016"],
    "twitter_status": ["twitter_541302072738016"],
    "twitter_dm": ["twitter_541302072738016"]
  },
  "monitor": {
    "facebook": ["facebook_428679267190141"],
    "twitter": ["twitter_428679267190141"],
    "instagram": ["instagram_428679267190141"],
    "youtube": ["youtube_428679267190141"]
  },
  "filter": {
    "countries": ["th", "us"],
    "fav": false,
    "hide": false,
    "read": false,
    "question": false,
    "sentiments": [-1, 0, 1],
    "is_topic": false,
    "gender": false,
    "has_ticket": false,
    "has_geo": false,
    "parent_id": "message_1",
    "root_id": "message_1",
    "id": "message_1"
  },
  "options": {
    "is_raw": true,
    "limit": 100,
    "skip": 0,
    "sort": [
      {
        "field": "created_time",
        "order": "desc"
      }
    ]
  },
  "time": {
    "since": 140000000000,
    "until": 150000000000
  },
  "graph": {
    "type": "keyword_by_date",
    "interval": "1d"
  }
}

Next page example

{
  "listening": {
    "keywords": ["111", "222"]
  },
  "options": {
    "sort_engine": "next",
    "sort": [
      {
        "field": "created_time",
        "order": "desc",
        "after": 1500000000
      },
      {
        "field": "sys_time",
        "order": "desc",
        "after": 1500000000
      }
    ]
  }
}

Graph Object

This is graph object API to explain each field and meaning.

Field Require Type Description
type yes string Name of graph type to use API. (Detail in "graph type" at below)
interval no string Time range in axis (e.g. 1h, 1d, 1w)
size no integrer Number of return items.
metric no (mention) mention, engagement, likes, comments, shares, dislikes, views, favorites Out put metric from system
group_by no hour, week_hour Group messages by hour or week hour.
map_setting no object Map setting object (Example from "map setting" example)

Example

{
    ...
    "graph": {
        "type": "keyword"
    },
    ...
}

Request Example

Example "map_setting".

{
    ...
    "graph": {
        "type": "geo",
        "map_setting": {
            "top_left": "19.810965, 97.878236",
            "bottom_right": "6.764242, 104.790458",
            "zoom": 6
        }
    }
    ...
}