Popularity

This option returns a histogram of retweets (twitter) or likes (of facebook posts, not pages) for a particular term relative to time range.

Endpoint: http://api.peoplebrowsr.com/popularity

Request - Required Parameters

  • app_id (STRING) - Eight Digit ID [ex: 84d8620b]
  • app_key (STRING) - Thirty-two digit key [ex: 281014ad8b0fba5adcc88fac7d79999c]
  • Post app registration, your app id and key can be viewed by going to https://developer.peoplebrowsr.com/admin/applications and clicking "view"

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 OR last=yesterday OR last=today
  • 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 or facebook
  • term (STRING) - Parameter description (values: @Name, Keyword, Multiple Keywords, #Hashtag, Phrase, or Post) - See Appendix 1: Term Structures for all terms
  • Request - Option Parameters

    • period (STRING) - Integer of the number of seconds that a period constitutes if â€ocountâ€? is specified rather than a start/end date.
      • Default setting: period=86400 (24 hours x 60 minutes x 60 seconds) or one Day
        • Day: Count=30 (30 days)
          • Example: &first=yesterday&count=30 - Specifies chart or histogram to return 30 days (periods) of data with reference to default period setting
        • Hour: Specify period=3600 (60 minutes x 60 seconds) & Count=24 (hours)
          • Example date setting: &first=1323468000&count=24&period=3600 - Returns 1 day of data by hour
    • limit (STRING)- Limit search results to the specified number. Limit=20 will only return 20 data points and can be used in histograms or charts.
    • number (STRING) - Specifies number of items in non-histogram queries. If the parameter &number=10, the query will only return 10 data points.
    • reverse (STRING) - When set to reverse=true, this will reverse the order of the histograms, charts.

    Request - Sample URL

    http://api.peoplebrowsr.com/popularity?last=yesterday&count=30&source=twitter&term=pepsi&number=10&app_id=12345&app_key=fds9sdf8wjf23
    

    Response

    Responses return 100 data points with JSON format.

    Response - Fields

    1. date(DATE)- Reference time period. Reference "Period" above for how this can be specified.
    2. rt or likes (STRING) - [&source=twitter - rts]; [&source=facebook - likes]
    3. status (STRING) - The status of your request (values: submitted, processing, complete)

    Sample Response

    { "data": [ [ "2011-08-25", 2042 ], [ "2011-08-26", 2796 ], [ "2011-08-27", 1585 ], [ "2011-08-28", 1524 ], [ "2011-08-29", 2116 ], [ "2011-08-30", 2965 ], [ "2011-08-31", 2063 ], [ "2011-09-01", 1961 ], [ "2011-09-02", 1960 ], [ "2011-09-03", 1886 ], [ "2011-09-04", 2571 ], [ "2011-09-05", 3314 ], [ "2011-09-06", 3615 ], [ "2011-09-07", 1462 ], [ "2011-09-08", 2657 ], [ "2011-09-09", 2909 ], [ "2011-09-10", 1024 ], [ "2011-09-11", 55 ], [ "2011-09-12", 3570 ], [ "2011-09-13", 1449 ], [ "2011-09-14", 1351 ], [ "2011-09-15", 1990 ], [ "2011-09-16", 2294 ], [ "2011-09-17", 1680 ], [ "2011-09-18", 1919 ], [ "2011-09-19", 2063 ], [ "2011-09-20", 2835 ], [ "2011-09-21", 2861 ], [ "2011-09-22", 3280 ], [ "2011-09-23", 2194 ] ], "id": "1018-f6ad0277ad62d2d007c280ec0012abb3", "request": { "count": 30, "external": true, "generate": 1230336000, "last": 1316736000, "name": "popularity", "number": 10, "source": "twitter", "term": "pepsi" }, "status": "complete" }
    

    PHP Code Sample

    Python Code Sample

    Ruby Code Sample