The Finance News Crawler is a powerful tool that allows you to crawl finance news articles, perform sentiment analysis using OpenAI GPT, and generate a sentiment report for crypto, stocks, and forex markets.
50 % made ChatGPT
- Crawls finance news articles from the web
- Performs sentiment analysis using OpenAI GPT API
- Generates a sentiment report for crypto, stocks, and forex markets
Follow the steps below to set up the Finance News Crawler project from scratch.
- Node.js 16.17.0
- News API key (sign up at newsapi.org to obtain an API key)
- OpenAI API key (sign up at openai.com to obtain an API key)
-
Clone the repository:
git clone https://github.com/simwai/finance-news-crawler.git
-
Install the dependencies:
cd finance-news-crawler npm install
-
Set up your API keys:
- Rename
config.json.example
toconfig.json
- Enter the NEWS_API_KEY
- Enter the OPENAI_API_KEY
- Choose 'openai' or 'vader' as SENTIMENT_ANALYSIS_ALGORITHM
VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule-based sentiment analysis tool that is specifically attuned to sentiments expressed in social media.
- Rename
-
Run the project:
npm run-script run
-
Wait for the Finance News Crawler to crawl the news articles and perform sentiment analysis.
-
Once the process is complete, the sentiment report will be displayed in the console.
You can customize the Finance News Crawler according to your needs:
- Modify the crawling parameters in the
crawlFinanceNews
function to fetch news articles from different sources or with different criteria. - Adjust the sentiment analysis settings in the OpenAI GPT API request to fine-tune the sentiment analysis process.
- Update the sentiment report format in the
crawlFinanceNews
function to match your desired output structure.
Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.