API
Statistics (stats) PRO VIP ULTRA
LikeBtn provides the Statistics API allowing to retrieve statistics on likes for your website in HTML, CSV and JSON formats.
URL: https://api.likebtn.com/api/
-
action
specifies which action you'd like to perform: stat -
email
your registration e-mail address -
api_key
API key you can receive for each website on your Websites page -
site_id
Site ID you can receive for each website on your Websites page -
output (optional, default: json)
statistics output format: html, csv, json -
sort (optional, default: likes)
statistics results sort order: likes, dislikes, last_updated -
page_size (optional, default: 200, max: 200)
statistics results page size -
page (optional)
statistics results page number -
identifier_filter (optional)
filter by identifier:identifier_filter=230
- get statistics for one element whose identifier is 230
-
updated_before / updated_after (optional)
select elements liked or disliked before / after specified date and time:updated_before=1368115980
- using timestampupdated_after=2013-05-09 10:53:18
- using string date and time representation
https://api.likebtn.com/api/?action=stat&email=info@likebtn.com&api_key=26b861aa8a6f6c725e0daaedb8dc4b09&site_id=50ebeb024f358ddb48000000&output=html&sort=likes
Sample API response:
{
"request": {
"action": "stat",
"email": "info@likebtn.com",
"api_key": "26b861aa8a6f6c725e0daaedb8dc4b09",
"site_id": "50ebeb024f358ddb48000000"
},
"response": {
"total": 238,
"page": 1,
"page_size ": 200,
"items": [{
"url": "http:\/\/\/",
"identifier": "",
"likes": 3574,
"dislikes": 1
}]
},
"result": "success",
"message": ""
}
Edit (edit) ULTRA
Method allows to change number of likes/dislikes for items, which already have been liked/disliked.URL: https://api.likebtn.com/api/
-
action
action you'd like to perform: edit -
email
your registration e-mail address -
api_key
API key you can receive for each website on your Websites page -
site_id
Site ID you can receive for each website on your Websites page -
identifier_filter
item dentifieridentifier_filter=230
- edit an item whose identifier is 230
-
type
1
- edit item like value-1
- edit item dislike value
-
value
3
- set item value to 3+12
- increment item value by 12 (don't forget to URL encode "+" as "%2B")-5
- decrement item value by 5
http://api.likebtn.com/api/?action=edit&email=info@likebtn.com&api_key=26b861aa8a6f6c725e0daaedb8dc4b09&site_id=50ebeb024f358ddb48000000&identifier_filter=230&type=1&value=7
{
"request": {
"action": "edit",
"email": "info@likebtn.com",
"api_key": "26b861aa8a6f6c725e0daaedb8dc4b09",
"site_id": "50ebeb024f358ddb48000000",
"identifier_filter": "230",
"type": "1",
"value": "7",
},
"response": {
"edited": 1
},
"result": "success",
"message": ""
}