{"id":26217273,"url":"https://github.com/janlukasschroeder/tipranks-api-v2","last_synced_at":"2025-04-15T22:07:20.542Z","repository":{"id":32830480,"uuid":"143843475","full_name":"janlukasschroeder/tipranks-api-v2","owner":"janlukasschroeder","description":"tipranks.com API to access price targets, news sentiments and trending stocks.","archived":false,"fork":false,"pushed_at":"2022-07-06T23:03:58.000Z","size":12,"stargazers_count":81,"open_issues_count":4,"forks_count":27,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-15T22:07:10.559Z","etag":null,"topics":["analyst-estimates","api","finance-api","news-sentiment","news-sentiment-analyser","price-targets","rating-system","sentiment-analysis","stock-market","stock-prediction","stock-prices","tipranks","trending"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janlukasschroeder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-07T08:30:17.000Z","updated_at":"2025-03-20T20:00:27.000Z","dependencies_parsed_at":"2022-08-07T18:15:22.377Z","dependency_job_id":null,"html_url":"https://github.com/janlukasschroeder/tipranks-api-v2","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlukasschroeder%2Ftipranks-api-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlukasschroeder%2Ftipranks-api-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlukasschroeder%2Ftipranks-api-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janlukasschroeder%2Ftipranks-api-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janlukasschroeder","download_url":"https://codeload.github.com/janlukasschroeder/tipranks-api-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249161344,"owners_count":21222474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analyst-estimates","api","finance-api","news-sentiment","news-sentiment-analyser","price-targets","rating-system","sentiment-analysis","stock-market","stock-prediction","stock-prices","tipranks","trending"],"created_at":"2025-03-12T12:26:20.194Z","updated_at":"2025-04-15T22:07:20.359Z","avatar_url":"https://github.com/janlukasschroeder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tipranks.com API\n\nFor any company (e.g. Tesla) the API returns\n\n- price targets calculated from analyst estimates: mean, median, highest, lowest, number of estimates\n- news sentiment data (bullish vs bearish) based on published articles in the last week\n\nIt also returns trending stocks.\n\n# Examples\n\n## Tesla Price Targets\n\n```json\n{\n  \"symbol\": \"TSLA\",\n  \"priceTargets\": {\n    \"mean\": 297.3333333333333,\n    \"median\": 300,\n    \"highest\": 500,\n    \"lowest\": 54,\n    \"numberOfEstimates\": 21\n  }\n}\n```\n\n## Tesla News Sentiment\n\n```json\n{\n  \"symbol\": \"TSLA\",\n  \"sentiment\": {\n    \"bullishPercent\": 0.4062,\n    \"bearishPercent\": 0.5938\n  },\n  \"buzz\": {\n    \"articlesInLastWeek\": 143,\n    \"weeklyAverage\": 147.25,\n    \"buzz\": 0.9711\n  },\n  \"sectorAverageBullishPercent\": 0.6204,\n  \"sectorAverageNewsScore\": 0.52,\n  \"companyNewsScore\": 0.3969\n}\n```\n\n## Trending Stocks\n\n```json\n[\n  {\n    \"ticker\": \"HAL\",\n    \"popularity\": 10,\n    \"sentiment\": 10,\n    \"consensusScore\": 1,\n    \"operations\": null,\n    \"sector\": \"BASIC MATERIALS\",\n    \"sectorID\": 17343,\n    \"marketCap\": 18394572000,\n    \"buy\": 10,\n    \"sell\": 0,\n    \"hold\": 0,\n    \"priceTarget\": 32.42,\n    \"rating\": 5,\n    \"companyName\": \"Halliburton\",\n    \"quarterlyTrend\": 5,\n    \"lastRatingDate\": \"2019-07-24T00:00:00\"\n  },\n  {\n    \"ticker\": \"XLNX\",\n    \"popularity\": 9,\n    \"sentiment\": 6,\n    \"consensusScore\": 1.6666666666666667,\n    \"operations\": null,\n    \"sector\": \"CONSUMER GOODS\",\n    \"sectorID\": 18731,\n    \"marketCap\": 27832018900,\n    \"buy\": 6,\n    \"sell\": 0,\n    \"hold\": 3,\n    \"priceTarget\": 131.6,\n    \"rating\": 4,\n    \"companyName\": \"Xilinx Inc\",\n    \"quarterlyTrend\": 4,\n    \"lastRatingDate\": \"2019-07-26T00:00:00\"\n  }\n]\n```\n\n# Setup\n\n- Install Node.js (which includes `npm`) if you haven't already. On Mac in the command line type `brew install node`. More information here: [nodejs.org](https://nodejs.org/en)\n- Set up a new Node.js project. In the command line type\n  - `mkdir my-new-project \u0026\u0026 cd my-new-project` to create a new folder\n  - `npm init` to scaffold the Node.js project\n  - `touch index.js` to create the file `index.js`\n  - `npm install tipranks-api-v2` to install the library to access the API\n  - Copy/paste the example code below inside the `index.js` file\n\n```js\nconst tipranksApi = require('tipranks-api-v2');\ntipranksApi.getPriceTargets('MU').then(result =\u003e console.log(result));\ntipranksApi.getNewsSentimentData('MU').then(result =\u003e console.log(result));\ntipranksApi.getTrendingStocks().then(trending =\u003e console.log(trending));\n```\n\n- `node index.js` to run the code inside the `index.js` file\n- Done! Now you should see the price targets and the news sentiment for the ticker `MU`\n\n# Documentation\n\nThe API supports the following commands:\n\n- `.getPriceTargets(ticker)`\n  - `ticker` is a string representing the company ticker, e.g. `TSLA`.\n  - This method returns the mean price target, median target,\n    highest target, lowest target, and the number of analyst estimates. See\n    below for an example.\n\n_Note:_ The price calculator (e.g. mean price) only considers analyst price\nestimates given in the last 3 months.\nThe API intentionally excludes estimates given more than three months ago\nas analysts seem to review/update their estimates in a quarterly interval.\nThe result: under \"Analyst ratings\" on the website the \"average price\" for MU was 46.5\nand the script displayed 46.77 for \"mean\" price.\n\n- `.getNewsSentimentData(ticker)`\n\n  - `ticker` is a string representing the company ticker, e.g. `TSLA`.\n  - This method returns the bullish and bearish sentiment in percent,\n    the number of articles published last week, sector average bullish\n    percent, sector average news score, and the company's news score. See\n    example below.\n\n- `.getTrendingStocks()`\n  - Returns an array of trending stocks listed on [tipranks.com/trending-stocks](https://www.tipranks.com/trending-stocks)\n\n# Examples\n\n## Get Price Targets: `getPriceTargets`\n\n### index.js File\n\n- Copy the code below into the `index.js` file\n- `node index.js` to run the code\n\n```javascript\nconst tipranksApi = require('tipranks-api-v2');\n\ntipranksApi.getPriceTargets('TSLA').then(result =\u003e console.log(result));\n```\n\n### Output\n\n```json\n{\n  \"symbol\": \"TSLA\",\n  \"priceTargets\": {\n    \"mean\": 297.3333333333333,\n    \"median\": 300,\n    \"highest\": 500,\n    \"lowest\": 54,\n    \"numberOfEstimates\": 21\n  }\n}\n```\n\n## Get News Sentiment: `getNewsSentimentData`\n\n### index.js File\n\n- Copy the code below into the `index.js` file\n- `node index.js` to run the code\n\n```javascript\nconst tipranksApi = require('tipranks-api-v2');\n\ntipranksApi.getNewsSentimentData('TSLA').then(result =\u003e console.log(result));\n```\n\n### Output\n\n```json\n{\n  \"symbol\": \"TSLA\",\n  \"sentiment\": {\n    \"bullishPercent\": 0.4062,\n    \"bearishPercent\": 0.5938\n  },\n  \"buzz\": {\n    \"articlesInLastWeek\": 143,\n    \"weeklyAverage\": 147.25,\n    \"buzz\": 0.9711\n  },\n  \"sectorAverageBullishPercent\": 0.6204,\n  \"sectorAverageNewsScore\": 0.52,\n  \"companyNewsScore\": 0.3969\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanlukasschroeder%2Ftipranks-api-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanlukasschroeder%2Ftipranks-api-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanlukasschroeder%2Ftipranks-api-v2/lists"}