SenFluence for Developers - Documentation
To get started with SenFluence for Developers, you will need an API key. The unique API key will be provided to you once your account is established.
Making a Request
The SenFluence for Developers API uses standard web requests which can be made directly or using your preferred programing language or framework.
Here is a sample URL:
http://api.senfluence.com/call/?key={your API key}&keyword=iphone&format=json&exclude=microsoft&include=apple
Using Curl
curl http://api.senfluence.com/call/ -G \
-d key={API Key} \
-d keyword=iphone \
-d format=json \
-d exclude=microsoft \
-d include=apple
Using Javascript
var url = 'http://api.senfluence.com/call/?' +
'key={API Key}' +
'keyword=iphone' +
'format=json' +
'exclude=microsoft' +
'include=apple';
var req = new Request(url);
fetch(req)
.then(function(response) {
console.log(response.json());
})
Using Ruby
require 'open-uri'
url = 'http://api.senfluence.com/call/?'\
'key={API Key}&'\
'keyword=iphone&'\
'format=json&'\
'exclude=microsoft&'\
'include=apple'
req = open(url)
response_body = req.read
puts response_body
Matching Options
Matching options define what results are searched for using the SenFluence for Developers API.
The keyword= Option
The Keyword= option is the basis for all mention tracking. The keyword may be a single keyword, for example iphone, or a phrase such as "iphone case".
Phrases should be enclosed in quotes. Phrases should not contain commas, unless you intend to match only text that contains the comma in the phrase.
The includes= and excludes= Option
You can further control matching by adding includes= and/or excludes= opitons.
includes= and excludes= options a single word, for example leather, or a list of comma separated words such as leather metal.
When using the includes= option, your main keyword will only match if the included word or words are also found. All words (keyword= and includes=) must be found.
When using the exclude= option, your main keyword will only match of the excluded words are not found in the text. This is very helpful in excluding results that do not apply to your needs.
Language Filtering
When using the lang= option along with an ISO-639 Country Code, SenFlunce for Developers will attempt to limit results based on their texural lanaguate.
While we make our best effort to filter by language, we do our best to detect the used language, however there are cases were we are unalbe to detect the given lanaguate.
Exact Matching
If the keywrods= option includes multiple words, the default is to show partial matches in addition to an exact match, which can result in more results but less strict matching.
You can use the exact=1 option to make sure that your results contain all words of a search in all cases, in the correct order. All you need to do is enable the 'exact' parameter by setting it to true, and results that don't include an exact match on all your words in the correct order will be omitted.
Name | Description |
---|---|
key | Your API key as provided when you created your account. |
keyword | The primary keyword or phrase to search for. |
format | Format can be "xml" or "json" by adding &format=xml or &format=json |
Sources | Sources can be filtered by adding &sources= with a comma delimited string like ‘&sources=twitter,tumblr’ |
exclude | Exclusions work just like sources, a comma delimited string of words you don’t want to appear in your searches. Includes work the same way, with &exclude= replaced with &include= |
include | A single word or comma separated list of words that must also be find to trigger matching |
lang | Language filtering by ISO-639 Country Code. Example: lang=en |
exact | When set to 1, exact matching will be used. |
sentiment | Sentiment analysis can be enabled by adding &sentiment=true to the end of your request URL. Keep on mind that enabling this feature adds some processing time and may slow down large requests, adjust your calls accordingly. |
Code | Description |
---|---|
{blank} | Match using all sources. |
tumblr | Include results from Tumblr. |
Include results from Twitter. | |
Include results from Reddit. | |
google_plus | Include results from Google+ |
youtube | Include results from YouTube. |
Include results from Instagram. | |
flickr | Include results from Flickr. |
bing | Include results from Bing. |
news | Include results from news sites. |
Code | Description |
Include results from Facebook. |
Results
Each call to the API outputs a maximum of about 1,000 results from all sources at once, in around 1-3 seconds. Every time it’s called, the results are fresh and different. It is a real time feed of all incoming data from all sources. This raw data is intended for users to be able to build their own databases with no delays, and its expected that the end user does their own data analysis and grading on their end, not ours. There is NO archival data when you call this API -- you must have your own SQL database that you store these results in!
When sentiment analysis is enabled, the queuery will take longer.
Example Results from Tumblr
{
"title": "New York City Maps Nyc Subway And Travel Guides",
"content": "<img src=\"http://68.media.tumblr.com/6aea550008e45ccc9d11ef99ec0f8b2d/tumblr_ovxlyjENxH1w69htoo1_500.jpg\" height=\"200\"><br/>New York City Maps - NYC Subway and Travel Guides Navigation Travel | iPhone App |301379165| **** $3.49 -> FREE #Navigation #Travel 4+ #iPhone #App #iOS <a href=\"http://dlvr.it/PlW7Gy\" target=\"_blank\">http://dlvr.it/PlW7Gy</a><br/>Tags: iphone, Navigation, Travel",
"link": "https://tmblr.co/ZHhXZe2PmRBfQ",
"source": "tumblr",
"date": "1504824427",
"language": "NA"
}
Example Results from Twitter
Twitter results incorporate Retweets and Favorites
{
"id": "2808100664",
"title": "check this beautiful designs! http://www.rakuten.co.jp/surfdesign/ #PR #senden #mobile #iphone",
"retweets": "0",
"favorites": "0",
"influence": "88",
"content": "check this beautiful designs! http://www.rakuten.co.jp/surfdesign/ #PR #senden #mobile #iphone",
"link": "https://twitter.com/SurfdesignCo/statuses/1029322776971079686",
"source": "twitter",
"date": "1534244648",
"language": "EN"
}
Example Results from Facebook
Facebook results incorporate Likes and Shares
{
"title": "Apple’s iPhone 8 Could Be Harder to Find Than a Nintendo Switch: Difficulties in screen production may seriously curb availability",
"shares": "2",
"likes": "19",
"content": "Apple’s iPhone 8 Could Be Harder to Find Than a Nintendo Switch: Difficulties in screen production may seriously curb availability",
"link": "http://www.facebook.com/10155582801660539",
"source": "facebook",
"date": "1504824986",
"language": "NA"
}
Updates History
Feb 3, 2019 - Added quotes for phrase matching and language filtering with the lang= option.