Skip to content

5.6 - Samples Calls

We are listing down the most commonly used API calls below, for your quick reference and convenience.

Identifying Companies Id

To get the company id that goes with a ticker or a company name, please use the below API.
https://api.infotrie.com/api/idata/search_company?query=microsoft

Get a list of companies

Alternatively, you may use the below API to get every company of the InfoTrie directory and its company id.
https://api.infotrie.com/api/idata/get_data?type=company_list

Get Articles

Once you have the company id handy, you may use the following API with combinations of parameters of your choice to fetch sentiments and articles.

  • a. https://api.infotrie.com/api/idata/get_articles?class_nameid=c_1389&timezone=America/New_York&start_date=2019-03-01&end_date=2019-03-12 ( for a specific date range: start_date is the first day, end_date the last ).

  • b. https://api.infotrie.com/api/idata/get_articles?class_nameid=c_35&timezone=America/New_York&offset=15 ( for last 15 days data)

  • c. https://api.infotrie.com/api/idata/get_articles?class_nameid=c_1389&timezone=America/New_York&start_date=2019-03-01&end_date=2019-03-12&count=100 (whereas count = maximum number of records to be returned )

Please note that without the ‘count’ parameter every article of the window is returned. Use ‘count’ (1 to 1000) to cap the number of records.

  • d. https://api.infotrie.com/api/idata/get_sentiment_history?nameid=c_1389&start_date=2019-01-01&end_date=2019-04-03&timezone=Asia/Singapore

Get Sentiment History

Instead of using InfoTrie “c_” ids, you may use tickers and codes as below. The other parameters (start_date, end_date, timezone, ndays, etc.) remain the same; get_sentiment_history has no count parameter.

https://api.infotrie.com/api/idata/get_sentiment_history?company=AAPL:US
https://api.infotrie.com/api/idata/get_sentiment_history?index=SP500
https://api.infotrie.com/api/idata/get_sentiment_history?crypto=BTC
https://api.infotrie.com/api/idata/get_sentiment_history?commodity=Gold
https://api.infotrie.com/api/idata/get_sentiment_history?forex=EUR/USD

Note (checked against the API on 2026-11-11)

Every call takes an InfoTrie API key in the X-API-Key header; the legacy AppKey header is refused with a 401. The feed.finsents.com host is retired.

A start_date after end_date is refused with a 400: start_date is the first day of the range. Codes are matched exactly, case included: a company by its ticker, an index by its short name, a crypto currency by its symbol, a commodity by its name as written in the list of commodities, a forex pair by its code.