This article analyzes stock portfolios and worldwide economic challenges. This study uses APIs to retrieve data and analyze correlations. To determine and measure how economic indicators affect stock performance. This work introduces an autoencoder-based model to better comprehend the complex relationship between economic conditions and stock portfolio dynamics. The analysis begins with an API retrieval of a wide range of macroeconomic information. These indicators include global economic metrics like GDP, unemployment, CPI, federal funds rates, and treasury bill rates. After collection, data is carefully curated and prepared for analysis. This study uses correlation analysis to understand economic variables and stock portfolio performance. This study explores how economic conditions affect stock prices and portfolio returns. This study seeks to discover trends, dependencies, and future issues that may affect investment decisions. This study also introduces an autoencoder-based neural network model to capture complex nonlinear relationships between economic variables and stock portfolio behavior. Deep learning improves interpretability and prediction, allowing a better understanding of the complex financial ecosystem dynamics. The inquiry provides valuable insights for investors, financial experts, and regulators. This study advances data-driven investment and risk management solutions. The autoencoder-based approach also reveals latent structures and hidden factors that affect stock portfolios. This novel approach opens new study options. In conclusion, this study provides a thorough stock portfolio analysis approach for global economic challenges. API data retrieval, correlation analysis, and a novel autoencoder model are used in this work to better understand the complicated relationships between economic indicators and financial markets. These insights can improve investment and policy decisions in a more integrated and dynamic global economy.