r-fmpapi

Financial Modeling Prep API Client

https://github.com/tidy-finance/r-fmpapi

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (19.1%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Financial Modeling Prep API Client

Basic Info
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created over 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# r-fmpapi


[![CRAN status](https://www.r-pkg.org/badges/version/fmpapi)](https://cran.r-project.org/package=fmpapi)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/fmpapi)](https://cran.r-project.org/package=fmpapi)
[![R-CMD-check](https://github.com/tidy-finance/r-fmpapi/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidy-finance/r-fmpapi/actions/workflows/R-CMD-check.yaml)
[![Lint](https://github.com/tidy-finance/r-fmpapi/actions/workflows/lint.yaml/badge.svg)](https://github.com/tidy-finance/r-fmpapi/actions/workflows/lint.yaml)
[![Codecov test coverage](https://codecov.io/gh/tidy-finance/r-fmpapi/graph/badge.svg)](https://app.codecov.io/gh/tidy-finance/r-fmpapi)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)



Provides a flexible interface to the ['Financial Modeling Prep' API](https://site.financialmodelingprep.com/developer/docs). The package supports all available endpoints and parameters, enabling R users to interact with a wide range of financial data.

> :bulb: This package is developed by Christoph Scheuch and not sponsored by or affiliated with FMP. However, you can get **15% off** your FMP subscription by using [this affiliate link](https://site.financialmodelingprep.com/pricing-plans?couponCode=tidyfinance). By signing up through this link, you also support the development of this package at no extra cost to you.

For a Python implementation, please consider the [`py-fmpapi`](https://github.com/tidy-finance/py-fmpapi) library.

## Installation

You can install the package from CRAN via:

```r
install.packages("fmpapi")
```

You can install the development version from GitHub:

```r
pak::pak("tidy-finance/r-fmpapi")
```

## Setup

Before using the package, you need to set your Financial Modeling Prep API key. You can set it using the `fmp_set_api_key()` function, which saves the key to your `.Renviron` file for future use (either in your project or home folder).

```r
library(fmpapi)

fmp_set_api_key()
```

## Usage

Since the FMP API has a myriad of endpoints and parameters, the package provides a single function to handle requests: `fmp_get()`.

You can retrieve a company’s profile by providing its stock symbol to the `profile` endpoint:

```r
fmp_get(resource = "profile", symbol = "AAPL")
```

To retrieve the balance sheet statements for a company, use the `balance-sheet-statement` endpoint. You can specify whether to retrieve annual or quarterly data using the `period` parameter and the number of records via `limit`. Note that you need a paid account for quarterly data. 

```r
fmp_get(resource = "balance-sheet-statement", symbol = "AAPL", params = list(period = "annual", limit = 5))
```

The `income-statement` endpoint allows you to retrieve income statements for a specific stock symbol. 

```r
fmp_get(resource = "income-statement", symbol = "AAPL")
```

You can fetch cash flow statements using the `cash-flow-statement` endpoint.

```r
fmp_get(resource = "cash-flow-statement", symbol = "AAPL")
```

Most free endpoints live under API version 3, but you can also control the api version in `fmp_get()`, which you need for some paid endpoints. For instance, the `symbol_change` endpoint:

```r
fmp_get(resource = "symbol_change", api_version = "v4")
```

## Relation to Existing Packages

There are two existing R packages that also provide an interface to the FMP API. Both packages lack flexibility because they provide dedicated functions for each endpoint, which means that users need to study both the FMP API docs and the package documentation and developers have to create new functions for each new endpoint. 

- [fmpapi](https://github.com/jpiburn/fmpapi): not released on CRAN and last commit more than 3 years ago. 
- [fmpcloudr](https://cran.r-project.org/package=fmpcloudr): last updated on CRAN more than 3 years ago.

## Contributing

Feel free to open issues or submit pull requests to improve the package. Contributions are welcome!

## License

This package is licensed under the MIT License.

Owner

  • Name: Tidy Finance
  • Login: tidy-finance
  • Kind: organization
  • Email: contact@tidy-finance.org

GitHub Events

Total
  • Create event: 16
  • Release event: 2
  • Issues event: 8
  • Watch event: 5
  • Delete event: 13
  • Issue comment event: 10
  • Push event: 47
  • Pull request event: 26
Last Year
  • Create event: 16
  • Release event: 2
  • Issues event: 8
  • Watch event: 5
  • Delete event: 13
  • Issue comment event: 10
  • Push event: 47
  • Pull request event: 26

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 2
  • Total pull requests: 6
  • Average time to close issues: 29 days
  • Average time to close pull requests: 2 minutes
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.33
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 6
  • Average time to close issues: 29 days
  • Average time to close pull requests: 2 minutes
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.33
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • christophscheuch (4)
Pull Request Authors
  • christophscheuch (14)
Top Labels
Issue Labels
release (2) enhancement (1)
Pull Request Labels
documentation (6) enhancement (4) release (2)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 510 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: fmpapi

Flexible Client for the 'Financial Modeling Prep' API

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 510 Last month
Rankings
Dependent packages count: 27.5%
Dependent repos count: 33.9%
Average: 49.5%
Downloads: 87.0%
Last synced: 10 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
  • r-lib/actions/setup-tinytex v2 composite
DESCRIPTION cran
  • cli >= 1.0.0 imports
  • dplyr >= 1.0.0 imports
  • httr2 >= 1.0.0 imports
  • testthat >= 3.0.0 suggests