@datafire/statsocial
v6.0.0
Published
DataFire integration for StatSocial Platform
Downloads
3
Readme
@datafire/statsocial
Client library for StatSocial Platform
Installation and Usage
npm install --save @datafire/statsocial
let statsocial = require('@datafire/statsocial').create({
api_key: ""
});
.then(data => {
console.log(data);
});
Description
API Reference: The StatSocial API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which can be understood by off-the-shelf HTTP clients, and we support cross-origin resource sharing to allow you to interact securely with our API from a client-side web application (remember that you should never expose your secret API key in any public website's client-side code). JSON will be returned in all responses from the API, including errors (though if you're using API bindings, we will convert the response to the appropriate language-specific object).Contact [email protected] to obtain a test API key
Actions
applications.status.get
Remaining window and remaining count details, also returns reports that have been generated by this account.
statsocial.applications.status.get({
"key": ""
}, context)
Input
- input
object
- key required
string
: User application key
- key required
Output
- output Application_Status
reports.get
Output is ordered by Demographic and followed by Affinity information. For each data point the following metrics are provided value, count, mean, percentile, multiplicity and average. For Geographic, and Demographic data points an additional statistical_info metric will be present with information regarding statistical relevance.
statsocial.reports.get({
"report_hash": "",
"sample": 0
}, context)
Input
- input
object
- report_hash required
string
: Unique report hash - baseline
integer
: Default value will be 'world' - report_date
integer
: report_date represents a Unix timestamp of when the report was generated. Default value will be the latest report generated. You can request the /report/dates/ endpoint in order to obtain available timestamps. Date must be in the future. - sample required
integer
: Sample report indicator
- report_hash required
Output
- output Report_Success
reports.post
Output is ordered by Demographic and followed by Affinity information. For each data point the following metrics are provided value, count, mean, percentile, multiplicity and average. For Geographic, and Demographic data points an additional statistical_info metric will be present with information regarding statistical relevance.
statsocial.reports.post({
"report_hash": "",
"sample": 0
}, context)
Input
- input
object
- report_hash required
string
: Unique report hash - baseline
integer
: Default value will be 'world' - report_date
integer
: report_date represents a Unix timestamp of when the report was generated. Default value will be the latest report generated. You can request the /report/dates/ endpoint in order to obtain available timestamps. Date must be in the future. - sample required
integer
: Sample report indicator
- report_hash required
Output
- output Report_Success
reports.custom.create.get
Used to create a custom report. This report treats the list of ids or handles as the audience (not their followers as in the twitter report). To create follower or tweet reports other methods must be used.
statsocial.reports.custom.create.get({
"upload_hash": ""
}, context)
Input
- input
object
- upload_hash required
string
: Upload hash to be used for inserting handles - filter
string
: Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}
- upload_hash required
Output
- output Custom_Create
reports.custom.create.post
Used to create a custom report. This report treats the list of ids or handles as the audience (not their followers as in the twitter report). To create follower or tweet reports other methods must be used.
statsocial.reports.custom.create.post({
"upload_hash": ""
}, context)
Input
- input
object
- upload_hash required
string
: Upload hash to be used for inserting handles - filter
string
: Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}
- upload_hash required
Output
- output Custom_Create
reports.custom.generate.get
Used to create a custom report. This report treats the list of ids or handles as the audience (not their followers as in the twitter report). To create follower or tweet reports other methods must be used.
statsocial.reports.custom.generate.get({
"report_name": ""
}, context)
Input
- input
object
- report_name required
string
: Name of the report
- report_name required
Output
- output Custom_Generate
reports.custom.generate.post
Used to create a custom report. This report treats the list of ids or handles as the audience (not their followers as in the twitter report). To create follower or tweet reports other methods must be used.
statsocial.reports.custom.generate.post({
"report_name": ""
}, context)
Input
- input
object
- report_name required
string
: Name of the report
- report_name required
Output
- output Custom_Generate
reports.custom.insert.get
Inserting twitter ids or handles into a custom report. This is used for custom reports only
statsocial.reports.custom.insert.get({
"upload_hash": "",
"ids": []
}, context)
Input
- input
object
- upload_hash required
string
: Upload hash to be used for inserting handles - ids required
array
: List of twitter ids, separated by commas, to be inserted into report. Ids must be enclosed with brackets ie. [177490485] or [177490485,23423434]
- upload_hash required
Output
- output Custom_Insert
reports.custom.insert.post
Inserting twitter ids or handles into a custom report. This is used for custom reports only
statsocial.reports.custom.insert.post({
"upload_hash": "",
"ids": []
}, context)
Input
- input
object
- upload_hash required
string
: Upload hash to be used for inserting handles - ids required
array
: List of twitter ids, separated by commas, to be inserted into report. Ids must be enclosed with brackets ie. [177490485] or [177490485,23423434]
- upload_hash required
Output
- output Custom_Insert
reports.dates.get
Get report dates available for a specific report.
statsocial.reports.dates.get({
"report_hash": ""
}, context)
Input
- input
object
- report_hash required
string
: Unique report hash
- report_hash required
Output
- output Report_Dates
reports.dates.post
Get report dates available for a specific report.
statsocial.reports.dates.post({
"report_hash": ""
}, context)
Input
- input
object
- report_hash required
string
: Unique report hash
- report_hash required
Output
- output Report_Dates
reports.status.get
Returns a list of custom reports generated by user (report name to upload hash etc).
statsocial.reports.status.get({
"report_hash": ""
}, context)
Input
- input
object
- report_hash required
string
: Unique hash belonging to report
- report_hash required
Output
- output Report_Status
reports.status.post
Returns a list of custom reports generated by user (report name to upload hash etc).
statsocial.reports.status.post({
"report_hash": ""
}, context)
Input
- input
object
- report_hash required
string
: Unique hash belonging to report
- report_hash required
Output
- output Report_Status
reports.tweet.create.get
This report details the audience of the users who have tweeted content that matches what was provided in the keywords. To create custom or twitter reports other methods must be used.
statsocial.reports.tweet.create.get({
"report_name": "",
"start_date": 0,
"end_date": 0,
"terms": ""
}, context)
Input
- input
object
- report_name required
string
: Name of report - start_date required
integer
: A unix timestamp. start_date will be set to the previous midnight. - end_date required
integer
: A unix timestamp. end_date will be set to the next midnight. - terms required
string
: If you are tracking a single term, then the keyword itself is suffice otherwise, tracking multiple terms must be in JSON form, example '[{"operator":"","word":"http://google.com"},{"operator":"or","word":"#test"},{"operator":"and","word":"test2"}]' Which results in filtering tweets containing 'http://google.com' OR '#test' AND 'test2'. (NOTE) Make sure to URL encode the terms value for multiple terms. - filter
string
: Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}
- report_name required
Output
- output Create_Tweet
reports.tweet.create.post
This report details the audience of the users who have tweeted content that matches what was provided in the keywords. To create custom or twitter reports other methods must be used.
statsocial.reports.tweet.create.post({
"report_name": "",
"start_date": 0,
"end_date": 0,
"terms": ""
}, context)
Input
- input
object
- report_name required
string
: Name of report - start_date required
integer
: A unix timestamp. start_date will be set to the previous midnight. - end_date required
integer
: A unix timestamp. end_date will be set to the next midnight. - terms required
string
: If you are tracking a single term, then the keyword itself is suffice otherwise, tracking multiple terms must be in JSON form, example '[{"operator":"","word":"http://google.com"},{"operator":"or","word":"#test"},{"operator":"and","word":"test2"}]' Which results in filtering tweets containing 'http://google.com' OR '#test' AND 'test2'. (NOTE) Make sure to URL encode the terms value for multiple terms. - filter
string
: Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}
- report_name required
Output
- output Create_Tweet
reports.twitter.create.get
This report uses the twitter followers as the audience. To create custom or tweet reports other methods must be used. Any report older than two days will be automatically regenerated upon create.
statsocial.reports.twitter.create.get({}, context)
Input
- input
object
- twitter_id
integer
: (required if twitter_handle is not supplied) twitter_id must be sent with all client requests. Multiple handles are separated by commas. - twitter_handle
string
: (required if twitter_id is not supplied) twitter_handle must be sent with all client requests. Multiple ids are separated by commas. - filter
string
: Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}
- twitter_id
Output
- output Create_Twitter
reports.twitter.create.post
This report uses the twitter followers as the audience. To create custom or tweet reports other methods must be used. Any report older than two days will be automatically regenerated upon create.
statsocial.reports.twitter.create.post({}, context)
Input
- input
object
- twitter_id
integer
: (required if twitter_handle is not supplied) twitter_id must be sent with all client requests. Multiple handles are separated by commas. - twitter_handle
string
: (required if twitter_id is not supplied) twitter_handle must be sent with all client requests. Multiple ids are separated by commas. - filter
string
: Filtering options to be used when creating a filtered report. The options must be in JSON form, example: {'gender':['male'],'ages':['18-24'],'countries':['usa']}
- twitter_id
Output
- output Create_Twitter
Definitions
1824
- 1824
object
- average
integer
- multiplicity
integer
- percentile
integer
- statistical_info statistical_info_18
- stdev
integer
- value
integer
- average
2534
- 2534
object
- average
integer
- multiplicity
integer
- percentile
integer
- statistical_info statistical_info_25
- stdev
integer
- value
integer
- average
3544
- 3544
object
- average
integer
- multiplicity
integer
- percentile
integer
- statistical_info statistical_info_35
- stdev
integer
- value
integer
- average
400_Error
- 400_Error
object
- error_code_msg
string
- msg
string
- success
string
- error_code_msg
401_Error
- 401_Error
object
- error_code_msg
string
- msg
string
- success
string
- error_code_msg
403_Error
- 403_Error
object
- error_code_msg
string
- msg
string
- success
string
- error_code_msg
404_Error
- 404_Error
object
- error_code_msg
string
- msg
string
- success
string
- error_code_msg
500_Error
- 500_Error
object
- error_code_msg
string
- msg
string
- success
string
- error_code_msg
Application_Status
- Application_Status
object
- data application_response
- msg
string
- success
string
Combined_Age
Create_Tweet
- Create_Tweet
object
- data create_tweet_response
- msg
string
- success
string
Create_Twitter
- Create_Twitter
object
- data follower_create_response
- msg
string
- success
string
Custom_Create
- Custom_Create
object
- data custom_create_response
- msg
string
- success
string
Custom_Generate
- Custom_Generate
object
- data custom_generate_response
- msg
string
- success
string
Custom_Insert
- Custom_Insert
object
- data custom_insert_response
- msg
string
- success
string
Female
- Female
object
- average
integer
- multiplicity
integer
- percentile
integer
- statistical_info statistical_info_f
- stdev
integer
- value
integer
- average
Male
- Male
object
- average
integer
- multiplicity
integer
- percentile
integer
- statistical_info statistical_info_m
- stdev
integer
- value
integer
- average
Report_Dates
- Report_Dates
object
- data
array
- items
integer
- items
- msg
string
- success
string
- data
Report_Status
- Report_Status
object
- msg
string
- success
string
- msg
Report_Success
- Report_Success
object
- data report_response
- msg
string
- success
string
Sex
application_response
- application_response
object
- remaining_count
integer
- reports report_info
- total_reports_count
integer
- total_reports_done
integer
- remaining_count
create_tweet_response
- create_tweet_response
object
- aggregate_report_hash
string
- daily_report_hash
string
- monthly_report_hash
string
- weekly_report_hash
string
- aggregate_report_hash
custom_create_response
- custom_create_response
object
- report_hash
string
- report_hash
custom_generate_response
- custom_generate_response
object
- upload_hash
string
- upload_hash
custom_insert_response
- custom_insert_response
object
- distinct_relations
integer
- total_relations
integer
- distinct_relations
follower_create_response
- follower_create_response
object
- report_hash
string
- report_hash
report_info
- report_info
object
- created
string
- name
string
- report_type
string
- status
string
- created
report_response
- report_response
object
- Combined Age Combined_Age
- Sex Sex
statistical_info_18
- statistical_info_18
object
- error_range
integer
- lower_bound
integer
- upper_bound
integer
- error_range
statistical_info_25
- statistical_info_25
object
- error_range
integer
- lower_bound
integer
- upper_bound
integer
- error_range
statistical_info_35
- statistical_info_35
object
- error_range
integer
- lower_bound
integer
- upper_bound
integer
- error_range
statistical_info_f
- statistical_info_f
object
- error_range
integer
- lower_bound
integer
- upper_bound
integer
- error_range
statistical_info_m
- statistical_info_m
object
- error_range
integer
- lower_bound
integer
- upper_bound
integer
- error_range