npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

fmpocket

v1.2.2

Published

A lightweight universal typed client for the Financial Modeling Prep (FMP) API. Gets your financial data perfectly formatted.

Readme

FMPocket

FMPocket 💶 is a lightweight 🪽 (34.66 kB) universal client for the Financial Modeling Prep (FMP) API 🌎, built with Typescript support and works seamlessly across Node, Deno, and Bun. Gets your financial data perfectly formatted ⭐️.

Report a bugForum

Installation

npm install fmpocket
# or
pnpm install fmpocket
# or
deno install npm:fmpocket
# ...

Quick usage

import { FMPocket } from 'fmpocket';

const fmpocket = FMPocket({ key: process.env.API_KEY! });

let [data] = await fmpocket.quote('AAPL');
console.log(data.volume);

Options

The FMPocket constructor supports the following options.

| Option | Description | Default | | :--------- | :------------------------------- | :----------------------------------- | | key | Your API secret key | None (required) | | baseUrl | The base endpoint URL | https://financialmodelingprep.com/ | | version | The API version | stable | | validate | Validates JSON and coerces data | true | | debug | Logs the URL before the request | false | | timeout | Requests timeout in milliseconds | null |

Endpoints

This is the list of currently supported endpoints. If yours is not in this list, please open a request.

Quote

// Single quote
let [data] = await fmpocket.quote('AAPL');
// Single short quote
let [data] = await fmpocket.shortQuote('BTCUSD');
// Aftermarket trade
let [data] = await fmpocket.aftermarketTrade('AAPL');
// Aftermarket quote
let [data] = await fmpocket.aftermarketQuote('AAPL');
// Price change
let [data] = await fmpocket.priceChange('AAPL');
// Batch quote
let data = await fmpocket.batchQuote(['AAPL', 'EURUSD', 'BTCUSD']);
// Batch short quote
let data = await fmpocket.batchShortQuote(['AAPL', 'EURUSD', 'BTCUSD']);
// Batch aftermarket trade
let data = await fmpocket.batchAftermarketTrade(['AAPL', 'MSFT']);
// Batch aftermarket quote
let data = await fmpocket.batchAftermarketQuote(['AAPL', 'MSFT']);

Historical price

// EOD light chart
let data = await fmpocket.lightChart({ symbol: 'AAPL', from: '2025-06-13', to: '2025-10-22' });
// EOD non adjusted chart
let data = await fmpocket.unadjustedChart({ symbol: 'AAPL', from: '2025-06-13', to: '2025-10-22' });
// EOD dividend adjusted chart
let data = await fmpocket.dividendChart({ symbol: 'AAPL', from: '2025-06-13', to: '2025-10-22' });
// EOD full chart
let data = await fmpocket.fullChart({ symbol: 'AAPL', from: '2025-06-13', to: '2025-10-22' });
// Intraday chart
let data = await fmpocket.intradayChart({ symbol: 'AAPL', from: '2025-10-10', to: '2025-10-22', interval: '1hour' });

Search

// Search by name
let data = await fmpocket.search({ query: 'AAPL' });
// Search by symbol (exchange and limit are optional)
let data = await fmpocket.search({ query: 'AP', by: 'symbol', exchange: 'NASDAQ', limit: 10 });

Company information

// Company profile (by symbol)
let [data] = await fmpocket.companyProfile({ symbol: 'AAPL' });
// Company profile (by CIK)
let [data] = await fmpocket.companyProfile({ cik: '0000320193' });
// Employee count
let [data] = await fmpocket.employeeCount('AAPL');
// Historical employee count
let [data] = await fmpocket.employeeHistoryCount('AAPL');
// Market capitalization
let [data] = await fmpocket.marketCap('AAPL');
// Batch market capitalization
let data = await fmpocket.batchMarketCap('AAPL');

Financial statements

// Income statement
let [data] = await fmpocket.income({ symbol: 'POW.TO', period: 'Q3' });
// Balance sheet statement
let [data] = await fmpocket.balanceSheet({ symbol: 'POW.TO', period: 'Q3' });
// Cash flow statement
let [data] = await fmpocket.cashFlow({ symbol: 'POW.TO', period: 'Q3' });
// Latest statements
let data = await fmpocket.latest({ page: 2, limit: 10 });
// Key metrics
let [data] = await fmpocket.keyMetrics({ symbol: 'POW.TO', period: 'Q3' });
// Financial ratios
let [data] = await fmpocket.ratios({ symbol: 'POW.TO', period: 'Q3' });

Technical indicators

// Simple moving average
let data = await fmpocket.sma({ symbol: 'AAPL', periodLength: 20, timeframe: '1min' });
// Exponential moving average
let data = await fmpocket.ema({ symbol: 'AAPL', periodLength: 20, timeframe: '1min' });
// Weighted moving average
let data = await fmpocket.wma({ symbol: 'AAPL', periodLength: 20, timeframe: '1min' });
// Double exponential moving average
let data = await fmpocket.dema({ symbol: 'AAPL', periodLength: 20, timeframe: '1min' });
// Triple exponential moving average
let data = await fmpocket.tema({ symbol: 'AAPL', periodLength: 20, timeframe: '1min' });
// Relative strength index
let data = await fmpocket.rsi({ symbol: 'AAPL', periodLength: 20, timeframe: '1min' });
// Standard deviation
let data = await fmpocket.std({ symbol: 'AAPL', periodLength: 20, timeframe: '1min' });
// Williams
let data = await fmpocket.williams({ symbol: 'AAPL', periodLength: 20, timeframe: '1min' });
// Average directional index
let data = await fmpocket.adx({ symbol: 'AAPL', periodLength: 20, timeframe: '1min' });

List

// List stocks
let data = await fmpocket.listStock();
// List cryptocurrencies
let data = await fmpocket.listCrypto();
// List forex
let data = await fmpocket.listForex();
// List commodities
let data = await fmpocket.listCommodities();

Market hours

// Market hours
let [data] = await fmpocket.marketHours('NASDAQ');
// Holidays
let data = await fmpocket.holidays('NASDAQ');

Any

// Any unsupported endpoint
let [data] = await fmpocket.any('/unsupported-endpoint', null, { foo: 'bar' });

This method allows you to use fmpocket even for unsupported endpoints if an API update occurs. You can also provide a schema to validate the output.