FMP

FMP

Extension

stock analysis

company analysi

chrome extentio

stock app

stock extension

earnings estima

EPS

revenue forecas

EPS forecast

stock forecast

share analysis

stock targets

stock news

stock top news

How to Create Your Own Stock Analysis Chrome Extension

- (Last modified: May 24, 2025 1:51 PM)

twitterlinkedinfacebook
blog post cover photo

Image credit: stock analysis chrome extension

Want to build a cool Chrome extension that pulls stock market data like news, financial estimates, and price targets? This guide will walk you through creating the same stock analysis extension I made, step by step. It's beginner-friendly, uses simple code, and connects to the FinancialModelingPrep API. You'll need to get your own API key to make it work, but I'll explain that too. Let's dive in!

What You'll Build

This extension pops up when you click its icon in Chrome. It lets you:
  • Enter a stock ticker (like AAPL for Apple) and your API key.
  • View stock news, financial statement estimates (annual or quarterly), and price target news.

What You'll Need

  • A computer with Google Chrome.
  • A text editor (like VS Code).
  • A FinancialModelingPrep API key (I'll show you how to get one).
  • Basic knowledge of HTML, CSS, and JavaScript (don't worry, I'll keep it simple).
  • A 128x128 pixel image for the extension icon (you can make one in Canva).

Step 1: Set Up Your Project Folder

  1. Create a folder called stock-extension on your computer (e.g., on your Desktop).
  2. Inside this folder, you'll add five files as shown in the below picture:
    • manifest.json: Tells Chrome what your extension does.
    • popup.html: The popup window users see.
    • popup.css: Styles the popup to look nice.
    • popup.js: Handles the logic, like fetching data.
    • icon.png: A 128x128 image for the extension's icon.

Step 2: Get Your FinancialModelingPrep API Key

The extension pulls data from FinancialModelingPrep, but you need an API key to access the service.

Step 3: Create the Manifest File

The manifest.json file is like the blueprint for your extension. It tells Chrome the extension's name, version, and what files it uses.
  1. Open VScode and create a file named manifest.json in the stock-extension folder.
  2. Write the below code:

  1. Save the file.
What this does:
  • "manifest_version": uses the latest Chrome extension format.
  • "permissions": "storage" lets the extension save your API key.
  • "default_popup": "popup.html" shows the popup when you click the icon.
  • "icons" points to your 128x128 icon image.

Step 4: Create the Popup HTML

The popup.html file defines what users see when they click the extension icon. It includes input fields, buttons, and links.
  1. Create a file named popup.html in the stock-extension folder.
  2. Write the below code:
What this does:
  • Creates a popup with a title, API key input, and three sections for stock data.

Step 5: Style the Popup with CSS

The popup.css file makes the popup look clean and professional.
  1. Create a file named popup.css in the stock-extension folder.
  2. Copy write the below code:
What this does:
  • Sets a 400px-wide popup with a light gray background.
  • Styles buttons as black with white text, with a darker hover effect.

Step 6: Add the JavaScript Logic

The popup.js file handles fetching stock data, saving the API key.
  1. Create a file named popup.js in the stock-extension folder.
  2. Copy and paste this code:
What this does:
  • Listens for button clicks and input changes.
  • Fetches stock data from FinancialModelingPrep using the user's API key and ticker.

Step 7: Add an Icon

You need a 128x128 pixel image for the extension's icon.
  1. Create or find an image (e.g., a stock chart or logo) using tools like Canva, Paint, or Photoshop.
  2. Give it a name "icon" and save it in "png" format in the stock-extension folder.
  3. Ensure it's exactly 128x128 pixels to avoid errors.

Step 8: Test Your Extension

Before sharing it, test it in Chrome to make sure everything works.
  1. Open Chrome and go to chrome://extensions/.
  2. Turn on Developer mode (top-right toggle).
  3. Click Load unpacked and select the stock-extension folder.
  4. The extension should appear with your icon. Click it to open the popup.
  5. Test each feature:
    • Enter your FinancialModelingPrep API key and a ticker (e.g., AAPL).
    • Click “Show Analysis” for Stock News, Financial Estimates (try both annual and quarterly), and Price Target News. Check that data appears.

Step 9: Share Your Extension

Want to share your extension with others? You can publish it on the Chrome Web Store.
  1. Go to the Chrome Web Store Developer Dashboard.
  2. Sign in, pay a one-time $5 fee, and create a developer account.
  3. Zip your stock-extension folder (right-click > Compress).
  4. In the Dashboard, click New Item, upload the ZIP, and fill out details:
    • Name: Stock Analysis Extension.
    • Description: Explain what it does and that users need their own API key.
    • Screenshots: Take 1-5 screenshots (1280x800 or 640x400) of the popup in action.
    • Category: Productivity or Business Tools.
    • Privacy: Note that the API key is stored locally and no data is collected.
  5. Submit for review. It may take a few days. Choose Unlisted to share with specific people or Public for everyone.
Tips and Tricks
  • Customize It: Change the button colors in popup.css or add more API features from FinancialModelingPrep's docs.
  • Icon Design: A clear icon (like a dollar sign or stock chart) makes your extension look pro.
  • Share Safely: Don't include your API key in the code—it's safe now because users add their own.

If you don't want to build your own extension like described above, you can download my extension from the Chrome Store, it's called the Stock News and Forecast Extension.

You've just built a Chrome extension that pulls stock market data. It's a great way to learn coding and create something useful for stock investors. By following these steps, you can make your own version, and even share it with others. If you run into issues, double-check your API key, test with Developer Tools, or ask for help in a coding community.
Happy coding, and hope you enjoy your new extension!

Other Blogs

Nov 8, 2024 5:30 AM - Sanzhi Kobzhan

Understanding Equity Valuation: When to Use DCF, DDM, and Price-Income (Multiplicators) Models

When it comes to investing in stocks, one of the key decisions an investor must make involves determining the intrinsic value of a company's shares. Equity valuation isn't just about numbers, it's an art mixed with science, aiming to predict future performance based on current and historical data. H...

blog post title

Nov 22, 2024 5:08 AM - Parth Sanghvi

Fundamental Analysis: Principles, Types, and How to Use It

Fundamental analysis is one of the most essential tools for investors and analysts alike, helping them assess the intrinsic value of a stock, company, or even an entire market. It focuses on the financial health and economic position of a company, often using key data such as earnings, expenses, ass...

blog post title

Dec 17, 2024 8:58 AM - Sanzhi Kobzhan

Examining Tesla’s Financial Health Using FinancialModelingPrep’s Ratios API

Tesla, one of the world’s most talked-about electric vehicle manufacturers, attracts a lot of attention from investors and market watchers. By examining a snapshot of Tesla’s financial ratios—such as those provided by FinancialModelingPrep’s Ratios API—we can get a clearer picture of the company’s f...

blog post title