5.2 - get_sentiment_history¶
The get_sentiment_history API returns the daily sentiment history of companies, indexes, forex pairs, commodities and crypto currencies, over a date range of up to 3650 days.
Request¶
| Method | URL |
|---|---|
| GET | idata/get_sentiment_history |
Parameters¶
| Params | Values | |
|---|---|---|
| nameid | String | “nameid” is a prefix and an id, eg: c_1389, where the prefix is: • c : company • in : index • fx : forex pair • cm : commodity, eg: cm_51 • cr : crypto currency Several ids of the same kind follow one prefix, separated by commas (c_1389,35), and each gets its own series. Places (pl_) and topics (top_) have no sentiment history. |
| start_date | Date | The first day of the series, in format YYYY-MM-DD (YYYY/MM/DD is also read). By default, ndays days before end_date. |
| end_date | Date | The last day of the series, included, in format YYYY-MM-DD (YYYY/MM/DD is also read). By default, today in the requested time zone, or ndays days after start_date when only start_date is given. A start_date after end_date, or more than 3650 days before it, is refused with a 400. |
| ndays | Number | The number of days of the window when start_date or end_date is missing, 1 to 3650. Default 90. |
| last_update | Number | 0, the default, returns the whole series. Above 0, a Unix time in seconds: only the days computed after it are returned, and a day with no computed value is left out. The value is echoed back as last_update. |
| timezone | String | By default timezone is Europe/Berlin. The possible values are: • America/New_York • Asia/Singapore • Europe/Berlin |
| company | String | As an alternative to the InfoTrie internal code (and the nameid parameter), the company ticker can be specified (e.g. AAPL:US). We follow Bloomberg’s naming convention. |
| index | String | As an alternative to the InfoTrie internal code (and the nameid parameter), the index code can be specified (e.g. SP500). See the list of supported indexes for more information here. |
| crypto | String | As an alternative to the InfoTrie internal code (and the nameid parameter), the crypto currency's symbol can be specified (e.g. BTC). See the list of supported crypto currencies for more information here. |
| commodity | String | As an alternative to the InfoTrie internal code (and the nameid parameter), the commodity's name can be specified, as written in the list, case included (e.g. Gold). See the list of supported commodities for more information here. |
| forex | String | As an alternative to the InfoTrie internal code (and the nameid parameter), the currency pair's code can be specified (e.g. EUR/USD). See the list of supported forex pairs for more information here. |
Response¶
Status 200
{
"last_update" : <integer timestamp> //value ‘0’ will return current data
"data" : [
{
"name" : <company name>
"ticker" : <company ticker>
"start_date" : <YYYY/MM/DD>
"end_date" : <YYYY/MM/DD>
"sentiment": [
{
"high" : <score in range 0 – 10>
"low" : <score in range 0 – 10>
"sentiment" : <score in range 0 – 10>
"buzz" : <score in range 0 – 10>
"date": <DD/MM/YYYY>
},
{...}
]
},
{
"name" : <company name>
"ticker : <company ticker>
…
}
]
}
// where sentiment data is in ascending date format. The first element is the max date (start date). The last element is the min date (end date) sentiment = “0” means no data was found for the date .
Note (#291, checked against the API on 2026-11-11)¶
In the response, sentiment is the mean of the day's article scores (1 to 10, 0 when there is no article), and high and low are the highest and lowest values that mean reached as the day's articles came in. See the Data Dictionnary.
The sample above is the legacy shape. Today the envelope's Result is {opSuccess, timezone, cutoff, last_update, last_data_date, stale, provenance, data, pagination}. data holds one series per entity. A company's carries name, sector_id, sector_name, start_date and end_date (yyyy-mm-dd), its points in sentiment, then last_data_date and stale; it carries no ticker. An index's carries name and ticker (the index's short name) and its points in sentiment_data; a forex pair's, name (the pair's code); a commodity's or crypto currency's, name, type, sub_type and class.
Points come newest first, one per day of the window: date (dd-mm-yyyy, the day in the requested time zone), timestamp (Unix time in seconds) and timestamp_utc, sentiment, high and low (to three decimals), buzz, volume (the day's number of articles) and, when the value is stamped, formula_version. A day with no computed value carries its date, 0 for sentiment, high, low and buzz, and a null timestamp and volume.
last_data_date is a series' newest day with data, and stale is true when that day is more than one business day old or the series has no data: read it before relying on a series. Points are paged, 500 per series by default: limit (1 to 2000) sets the page size, and pagination.next_cursor, sent back as cursor, gives the next page. cutoff sets where each day closes: eod (the default, the end of the day in the requested time zone), or 14:30 or 16:00 for forex pairs, commodities and crypto currencies in America/New_York. Any other parameter, count included, is refused with a 400.
Every call takes an InfoTrie API key in the X-API-Key header; the legacy AppKey header is refused with a 401. Each operation is served at https://api.infotrie.com/api/idata/ followed by its name.