npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@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

Output

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

Output

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

Output

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']}

Output

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']}

Output

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

Output

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

Output

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]

Output

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]

Output

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

Output

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

Output

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

Output

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

Output

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']}

Output

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']}

Output

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']}

Output

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']}

Output

Definitions

1824

  • 1824 object
    • average integer
    • multiplicity integer
    • percentile integer
    • statistical_info statistical_info_18
    • stdev integer
    • value integer

2534

  • 2534 object
    • average integer
    • multiplicity integer
    • percentile integer
    • statistical_info statistical_info_25
    • stdev integer
    • value integer

3544

  • 3544 object
    • average integer
    • multiplicity integer
    • percentile integer
    • statistical_info statistical_info_35
    • stdev integer
    • value integer

400_Error

  • 400_Error object
    • error_code_msg string
    • msg string
    • success string

401_Error

  • 401_Error object
    • error_code_msg string
    • msg string
    • success string

403_Error

  • 403_Error object
    • error_code_msg string
    • msg string
    • success string

404_Error

  • 404_Error object
    • error_code_msg string
    • msg string
    • success string

500_Error

  • 500_Error object
    • error_code_msg string
    • msg string
    • success string

Application_Status

Combined_Age

Create_Tweet

Create_Twitter

Custom_Create

Custom_Generate

Custom_Insert

Female

  • Female object
    • average integer
    • multiplicity integer
    • percentile integer
    • statistical_info statistical_info_f
    • stdev integer
    • value integer

Male

  • Male object
    • average integer
    • multiplicity integer
    • percentile integer
    • statistical_info statistical_info_m
    • stdev integer
    • value integer

Report_Dates

  • Report_Dates object
    • data array
      • items integer
    • msg string
    • success string

Report_Status

  • Report_Status object
    • msg string
    • success string

Report_Success

Sex

application_response

  • application_response object
    • remaining_count integer
    • reports report_info
    • total_reports_count integer
    • total_reports_done integer

create_tweet_response

  • create_tweet_response object
    • aggregate_report_hash string
    • daily_report_hash string
    • monthly_report_hash string
    • weekly_report_hash string

custom_create_response

  • custom_create_response object
    • report_hash string

custom_generate_response

  • custom_generate_response object
    • upload_hash string

custom_insert_response

  • custom_insert_response object
    • distinct_relations integer
    • total_relations integer

follower_create_response

  • follower_create_response object
    • report_hash string

report_info

  • report_info object
    • created string
    • name string
    • report_type string
    • status string

report_response

statistical_info_18

  • statistical_info_18 object
    • error_range integer
    • lower_bound integer
    • upper_bound integer

statistical_info_25

  • statistical_info_25 object
    • error_range integer
    • lower_bound integer
    • upper_bound integer

statistical_info_35

  • statistical_info_35 object
    • error_range integer
    • lower_bound integer
    • upper_bound integer

statistical_info_f

  • statistical_info_f object
    • error_range integer
    • lower_bound integer
    • upper_bound integer

statistical_info_m

  • statistical_info_m object
    • error_range integer
    • lower_bound integer
    • upper_bound integer