Announcing imfapi: User-Friendly Access to IMF Data in R
New IMF API, new IMF API R library — part of the econdataverse initiative

We’re excited to announce the release of imfapi, a new R package for programmatic access to the International Monetary Fund’s “SDMX 3.0 IMF Data API.” This package is part of the econdataverse project, funded by an R Consortium grant to create a unified ecosystem of tools for economic data access and analysis.
Why imfapi?
The IMF’s recent rollout of their SDMX 3.0 API caught the econ data community off guard. Existing packages like imfp and imfr (which I authored/maintained) relied on the SDMX 2.0 API, which suddenly stopped working.
The imfapi package was developed as an emergency response to this API migration. Fortunately, we already had R Consortium funding to develop the econdataverse, a family of R and Python packages to provide programmatic access to the universe of macroeconomic data through consistent, user-friendly interfaces, with tidy data outputs and comprehensive testing. Our original project plan mostly called for patching and extending the existing IMF API packages, but with the 3.0 API rollout, it made more sense to build a new R package from the ground up.
A Four-Step Workflow
The imfapi package provides an intuitive workflow for accessing IMF data:
Discover datasets with
imf_get_dataflows()Identify the “dimensions” on which you can filter a given dataset with
imf_get_datastructure()Find valid “codes” for filtering a given dimension with
imf_get_codelists()Fetch the actual data with your filters with
imf_get()
Here’s a quick example retrieving annual Producer Price Index data for the USA and Canada:
library(imfapi)
# Get the data
ppi_data <- imf_get(
dataflow_id = "PPI",
dimensions = list(FREQUENCY = c("A"), COUNTRY = c("USA", "CAN"))
)All data is returned in tidy format, ready for analysis with the tidyverse or other modern R tools.
Built for the econdataverse
The imfapi package follows the econdataverse design principles:
Consistent naming: Functions follow the
imf_*pattern with clear, predictable names and signaturesTidy outputs: All data returned in tidy format for seamless integration with modern R workflows
Comprehensive testing: Extensive unit tests ensure reliability
Open source: Released under the MIT License for maximum flexibility
This package joins other econdataverse tools like wbids (World Bank debt statistics), wbwdi (World Development Indicators), and owidapi (Our World in Data), all designed to work together seamlessly.
Real-World Impact
The imfapi package isn’t just a technical tool—it’s infrastructure for better policy decisions. Tools like the Nature Finance Debt Dynamics Explorer, which will be demonstrated to V20 policymakers at the spring IMF/World Bank Meetings, rely on packages like this to help climate-vulnerable countries understand their debt trajectories without expensive data subscriptions.
For developing country policymakers who often face the choice between paying tens of thousands of dollars for commercial data platforms or making decisions with incomplete information, the econdataverse provides a third option: free, open-source tools that democratize access to critical economic data.
Get Started
Install imfapi from CRAN:
install.packages("imfapi")Visit the documentation website for detailed documentation and examples, or check out the Github repo to contribute.
Acknowledgments
This work was developed by my company, Promptly Technologies, under contract for Teal Insights as part of the econdataverse initiative, with funding from the R Consortium. Special thanks to Teal Emery (Teal Insights) and Christoph Scheuch (Tidy Intelligence) for their collaboration on the broader econdataverse vision.
The econdataverse is a collaborative effort between Tidy Intelligence, Teal Insights, Promptly Technologies, and the ONE Campaign to build a universe of open-source packages for working seamlessly with economic data in R and Python. Learn more at https://www.econdataverse.org/.

I tried to reproduce the code, but it doens't works! When I get ppi_data, returns me a 0-0 df