yfe404 / what-people-think-of

The goal of this project is to build an app that performs real-time sentiment analysis on a particular hashtag to get the current trend of what people think about a subject, a company or an event.
2 stars 0 forks source link

API draft proposal #1

Open maxmouchet opened 8 years ago

maxmouchet commented 8 years ago

Glossary

Word Description Example
Topic A Twitter hashtag (including #) #Pikachu

Summary

Method Route
GET /topics/search
GET /topics/trending
GET /stats/:topic/:resolution

Actions

Search for a topic

Method Route Example
GET /topics/search /topics/search?query=TeamNa
Parameter Description Type Values
query The query string String .+
{
  "topics": [ "#TeamNabila", "#TeamNana", "#TeamNap" ]
}

Fetch trending topics

Method Route Example
GET /topics/trending /topics/trending
{
  "topics": [ "#Pokemon", "#Chirac2017", "#COP21" ]
}

Fetch data points for a given topic

Method Route Example
GET /stats/:topic/:resolution /stats/#TeamNabila/1w
Parameter Description Type Values
topic Topic to be analysed String .+
resolution Temporal resolution of the data String \d[s|m|d|w]
{
  "topic": "#TeamNabila",
  "resolution": "1w",
  "data": [
    {
      "date": "2015-07-01",
      "positive": 12137,
      "negative": 98100,
      "neutral": 1754
    },
    {
      "date": "2015-07-07",
      "positive": 15783,
      "negative": 99714,
      "neutral": 3464
    }
  ]
}
yfe404 commented 8 years ago

Nice!