Activity Stream
The Activity Stream provides an activity statement of a user's activity on Twitter according to a provided date range how their influence / outreach changes relative to the action metrics.
Endpoint: http://api.kred.com/activity-stream
Request - Required Parameters
- app_id (STRING) - Eight Digit Kredentials ID [ex: 84d8620b]
- app_key (STRING) - Thirty-two digit app kredentials key [ex: 281014ad8b0fba5adcc88fac7d79999c]
Time Period - Only two of three of these need to be used in a string. First & Last, First & Count, or Last & Count. Last & Count will return results the easiest.
- first (STRING) - Defines the start of the time period. If January 1 2012 to February 21, 2012 was the specification required, start with specifying the the first time point with first=2011-01-01. Alternatively, say the specification was between yesterday and today.
- Example(s): first=2011-01-01 first=1323466328 or first=yesterday
- last (STRING) - Defines the end of a time period. To continue the example above, if the date range specified is January 1, 2012 to February 21, 2011, specify last=2011-02-21. Alternatively say the time period you always wanted to measure was today. One could specify last=today, and then use count to specify 14, 30, up to 1000 days back relative to the time range enabled for the account on the API.
- Example: last=2012-02-21 or last=1318195928 OR Yesterday OR Today OR Now
- count (STRING) - Count is used as a period proxy to specified time periods. The standard time period is a day, so using count, you would specify the last 30, 60, 90, 100, to 1000 days by specifying last=today & count=30 (or another period length).
- Example: count=1 OR 10 OR 100 OR 1000 to specify the time period backward or forward
- source (STRING) - source=twitter
- term (STRING) - username on Twitter. Term=kred (remove @ symbol)
Post app registration, your kredentials app id and key can be viewed by going to https://developer.peoplebrowsr.com/admin/applications and clicking "view
Request - Sample URL
http://api.kred.com/activity-stream?&source=twitter&last=today&count=2&term=pepsi&app_id=****d1e2&app_key=***9ae781a424868750ffb06a3542ff4
Response
Returns last 50 transactions in JSON.
Response - Fields
- transaction (STRING)
- action (STRING) - mention, reply, rt
- influence_points (STRING) - points added to user
- outreach_points (STRING) - points added to user (if they respond)
- source (STRING) - twitter
- timestamp (STRING) - unixtime timestamp when interaction occurred
- user_id (STRING) - twitter screen name of doing the action
- username (STRING) - username within specified term that action is happening to
- status (STRING) - submitted, processing, waiting (rarely), complete
Sample Response
{
"data": [
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330470193,
"user_id": "ktdh1234"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330467529,
"user_id": "AmyHunty"
},
"username": "pepsi"
},
{
"transaction": {
"action": "reply",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471540,
"user_id": "Tmeyer2008"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469171,
"user_id": "dulcyj"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469607,
"user_id": "ShanM0n"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330473241,
"user_id": "TheDanceFamily"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330468359,
"user_id": "dcos75"
},
"username": "pepsi"
},
{
"transaction": {
"action": "rt",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471611,
"user_id": "MrUNC07"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471665,
"user_id": "MarcWyns"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471616,
"user_id": "ktdh1234"
},
"username": "pepsi"
},
{
"transaction": {
"action": "reply",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330473444,
"user_id": "HeyItsBrenno"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330472834,
"user_id": "ktdh1234"
},
"username": "pepsi"
},
{
"transaction": {
"action": "rt",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471481,
"user_id": "SB_brewer"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330472592,
"user_id": "ZondraHughes"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330472531,
"user_id": "dreams_in_CA"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469375,
"user_id": "OfficiallyMadai"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469130,
"user_id": "PitbullLyrics"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330467447,
"user_id": "jakebendle50"
},
"username": "pepsi"
},
{
"transaction": {
"action": "rt",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471330,
"user_id": "Jotaeta_1"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330467877,
"user_id": "John_Yates"
},
"username": "pepsi"
},
{
"transaction": {
"action": "reply",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330467406,
"user_id": "Cobradactyl"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469105,
"user_id": "creadictos"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330470211,
"user_id": "PaulDazeley"
},
"username": "pepsi"
},
{
"transaction": {
"action": "rt",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471452,
"user_id": "SyahLanaLan"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330468777,
"user_id": "AmyHunty"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469369,
"user_id": "cabbott86"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471618,
"user_id": "Tmeyer2008"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469137,
"user_id": "whitegrlwaasted"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330468107,
"user_id": "PoppaFerg"
},
"username": "pepsi"
},
{
"transaction": {
"action": "rt",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330472006,
"user_id": "skapaahkv44"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330468169,
"user_id": "iamlono"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330472227,
"user_id": "ktdh1234"
},
"username": "pepsi"
},
{
"transaction": {
"action": "rt",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471269,
"user_id": "Jazzfm88"
},
"username": "pepsi"
},
{
"transaction": {
"action": "reply",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471372,
"user_id": "ShiqaDeBieber"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330470101,
"user_id": "MachineGnKellen"
},
"username": "pepsi"
},
{
"transaction": {
"action": "rt",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471401,
"user_id": "kaybn13"
},
"username": "pepsi"
},
{
"transaction": {
"action": "rt",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471672,
"user_id": "LuisAbcfernando"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330472288,
"user_id": "ryanflan"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469685,
"user_id": "AngelaraujoGA"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469551,
"user_id": "JGsigDuBBed"
},
"username": "pepsi"
},
{
"transaction": {
"action": "reply",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471863,
"user_id": "meganholewa"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469734,
"user_id": "amyarnette"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330470480,
"user_id": "ktdh1234"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330468183,
"user_id": "msnickerson"
},
"username": "pepsi"
},
{
"transaction": {
"action": "rt",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471546,
"user_id": "Tmeyer2008"
},
"username": "pepsi"
},
{
"transaction": {
"action": "rt",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471391,
"user_id": "Robotrek_Enix"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330471674,
"user_id": "Rachel_Mktg"
},
"username": "pepsi"
},
{
"transaction": {
"action": "reply",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330468202,
"user_id": "AmyHunty"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330469306,
"user_id": "Fatty_Addie"
},
"username": "pepsi"
},
{
"transaction": {
"action": "mention",
"influence_points": 10,
"outreach_points": 0,
"source": "twitter",
"timestamp": 1330467142,
"user_id": "leeannn_white"
},
"username": "pepsi"
}
],
"id": "999-b41e48d6de2adcec370e48b341fe8653",
"request": {
"app_id": "****d1e2",
"app_key": "****ae781a424868750ffb06a3542ff4",
"count": 2,
"external": true,
"last": 1330473600,
"name": "activity-stream",
"source": "twitter",
"term": "pepsi"
},
"status": "complete"
PHP Code Sample