This API returns sentiment data on a 1 to 10 scale (or -5 to 5 on demand) for various types of entities: quoted or unquoted stocks, indices, commodities, currency pairs, crypto currencies, topics etc … A score of 1, 2, 3 denotes low sentiment, a score of 4, 5, 6, 7 denotes neutral sentiment a score of 8, 9, 10 denotes positive sentiment.

HTTP Request URL:

GET : /idata/get_sentiment_history

Parameters:

  • nameid [ids]
    Specify relevant entity value(s) with corresponding id(s):
    • company id : c_id
    • index id : in_id
    • commodity id : cm_id. This includes commodities and crypto-currencies.
    • forex id : fx_id
    • topic id : top_id
    • source id : sc_id
    • commodity sector id : cs_id

Multiple nameids of same type can be passed in csv format.

  • (alternative) company [String]

As an alternative to nameid=[c_id], company can be specified with a given ticker. For instance to retrieve Apple data, you may specify:

https://feed.finsents.com/idata/get_sentiment_history?company=AAPL:US

Refer to static data user guide for more details.

  • (alternative) index [String]

As an alternative to nameid=[in_id], index can be specified to retrieve sentiment for a given index or a list of indexes. For instance, to retrieve SP500 data, you may specify:

https://feed.finsents.com/idata/get_sentiment_history?index=SP500

Refer to static data user guide for more details.

  • (alternative) crypto [String]

As an alternative to nameid=[cm_id], crypto can be specified to retrieve sentiment for a given crypto-currency or a list of crypto-currencies. For instance, to retrieve data for Bitcoin, you may specify:

https://feed.finsents.com/idata/get_sentiment_history?crypto=BTC

Refer to static data user guide for more details.

  • (alternative) commodity [String]

As an alternative to nameid=[cm_id], commodity can be specified to retrieve sentiment for a given commodity or a list of commodities. For instance to retrieve sentiment for Bitcoin, you may specify:

https://feed.finsents.com/idata/get_sentiment_history?commodity=GOLD

Refer to static data user guide for more details.

  • (alternative) forex [String]

As an alternative to nameid=[fx_id], a currency pair can be specified, for instance, to retrieve sentiment for EUR/USD, you may specify:

https://feed.finsents.com/idata/get_sentiment_history?forex=EUR/USD

Refer to static data user guide for more details.

  • timezone [String]
    By Default timezone is Europe/Berlin. Possible values are:
    • America/New_York,
    • Asia/Singapore,
    • Europe/Berlin.
  • start_date [String]
    The format is YYYY-MM-DD. Default value is today. It is the maximum date.
  • end_date [String]
    The format is YYYY-MM-DD. Default value is 90 days from start_date. It is the minimum date.
  • ndays [number]
    Default value is 90.  It is the number of days for which result is needed. ndays has more priority than start_date & end_date
    It is calculated from today.
  • last_udpate [number]
    • 0 means, there is no valid last updated data,
    • Non zero means current updated data is newer then last updated data.
  • (on demand) Additional timezones

Additional timezones can be added on demand, for instance start of trading hours / end of trading hours, please contact us for more details (contact@infotrie.com). E.g.:

    • America/New_York2: 08:00 to 15:59,
    • America/New_York3. 16:00 to 07:59.

Examples:

  • With nameid:

To retrieve sentiment data for Microsoft (company id = 1389) between the January 1st 2019 and April 3rd 2019 on the Singaporean timezone:

https://feed.finsents.com/idata/get_sentiment_history?nameid=c_1389&start_date=2019-04-03&end_date=2019-01-01&timezone=Asia/Singapore

  • Without nameid:

To retrieve sentiment for a company or an inde or a crypto currency or a commodity or a currency pair, please try:

https://feed.finsents.com/idata/get_sentiment_history?company=AAPL:US

https://feed.finsents.com/idata/get_sentiment_history?index=SP500

https://feed.finsents.com/idata/get_sentiment_history?crypto=BTC

https://feed.finsents.com/idata/get_sentiment_history?commodity=GOLD

https://feed.finsents.com/idata/get_sentiment_history?forex=EUR/USD

Response:

  • 200 Response will have the JSON structure as below

{ “data”: [ { “name”:<“entity 1”>, “start_date”: <YYYY/MM/DD>, “end_date”: <YYYY/MM/DD>, “sector_id”: <s_id>, “sector_name”: < >,

“sentiment”: [ {“high”: < >,”low” :< >,”buzz” :< >,”sentiment “:< >,”date” : <DD/MM/YYYY>, “volume”: < > } … , … ] },

{“name”: <“entity 2”>, ……“sentiment”:[{…}] …..} ] }

where :

    • Sentiment data is in ascending date format,
    • First element is the max date (start date),
    • Last element is the min date (end date),
    • sentiment = “0” means no data found for the date.
  • 400 {“error”:”Invalid params”}
  • 401 {“error”:”Invalid Auth key.”}
  • 500 {“error”:”Something went wrong. Please try again later.”}