A simple API to fetch and analyze annual income statements for AAPL (Apple). The API is designed to provide insights into key metrics such as revenue, net income, gross profit, EPS(Earnings Per Share) and operating income. The API is built using Python and FastAPI framework.
- Try it out: https://finview-api.vercel.app
- API Documentation: https://finview-api.vercel.app/docs
- Alternative API Documentation: https://finview-api.vercel.app/redoc
-
Income Statement Data Retrieval:
- Return key financial metrics including:
- Date of statement
- Revenue
- Net Income
- Gross Profit
- EPS (Earnings Per Share)
- Operating Income
- Return key financial metrics including:
-
Advanced Filtering Capabilities:
- Date range filtering (e.g., 2020-2024)
- Revenue range filtering (minimum and maximum)
- Net Income range filtering (minimum and maximum)
-
Flexible Sorting Options:
- Sort by date (ascending/descending)
- Sort by revenue (ascending/descending)
- Sort by net income (ascending/descending)
- Clone the repository and navigate to the project directory:
git clone https://github.com/sixtusagbo/finview-api cd finview-api
- Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows use: venv\Scripts\activate
- Install requirements:
pip install -r requirements.txt
- Get a free API key from Financial Modeling Prep
- Set your API key as an environment variable:
export FMP_KEY=your_api_key_here # On Windows use: set FMP_KEY=your_api_key_here
To run the project locally:
fastapi dev api/v1/main.py