Financial and Economic Data API
The MacroFinance API gives programmatic access to the financial database and economic database through 77 endpoints at https://api.macrofinance.ai. A free account downloads the last 5 years of history, up to 50 requests a month; other endpoints need a trial or paid plan.
Getting started
Authentication
Add api_key to each /api/ call; your key is in the activation email. /query uses the header Authorization: email;password. Keep both private and call the API from your own server or computer.
Requests and answers
GET with query parameters, or POST with a JSON body. /api/ answers are JSON: {"status": true, "data": …}. /query returns CSV; check for the header row, because it reports errors as text.
Errors
400 missing or wrong parameter, 403 your plan does not include the data, 429 monthly limit reached, 500 server error.
Daily prices as JSON
curl "https://api.macrofinance.ai/api/security_history?api_key=YOUR_API_KEY&ticker=I.SPX&limit=250"
An economic series as JSON
curl "https://api.macrofinance.ai/api/macro_data?api_key=YOUR_API_KEY&name=CPI%20All%20Items&limit=60"
CSV, as the Excel workbook does it
curl -H "Authorization: [email protected];YOUR_PASSWORD" "https://api.macrofinance.ai/query?code=I.SPX&start_date=2026-01-01"
History and downloads
Price and macro time series.
| Endpoint | Returns | Parameters | Access |
|---|---|---|---|
/query | CSV history of one series; used by the Excel workbook. Sign in with the header Authorization: email;password | code, symbid or name; optional start_date, end_date | Free account |
/api/security_history | Daily history of one security as JSON | secid, symbid or ticker; optional start, end, limit (up to 5000), columns | Free account |
/api/macro_data | Macroeconomic series with signals as JSON | macrid, symbid, ticker or name; optional start, end, limit, columns | Free account |
/api/security_history_export | Security history as a CSV, XLSX or JSON file | secid, symbid or ticker; optional format, start, end, columns | Plus and above |
/api/macro_data_export | Macro series as a CSV, XLSX or JSON file | macrid, symbid, ticker or name; optional format, start, end, columns | Plus and above |
/api/security_chart | Interactive price chart page for one security | secid, symbid or ticker; optional range (1M to MAX) | Trial or paid |
Search and reference
Find instruments and what exists for them.
| Endpoint | Returns | Parameters | Access |
|---|---|---|---|
/api/smarkets | Search the instrument catalogue | query | Trial or paid |
/api/security_overview | Overview of one security of any asset class | symbid, secid or ticker | Trial or paid |
/api/security_context | Counts of the data available for one instrument | symbid, secid, ticker or name | Trial or paid |
/api/today | Today and the latest market data date | optional secid, symbid or ticker | Trial or paid |
Markets
Cross-asset tables and rankings.
| Endpoint | Returns | Parameters | Access |
|---|---|---|---|
/api/global_markets | Headline cross-asset board | none | Trial or paid |
/api/equity_indices | Ranked national and regional stock indices | optional country, scope, sort, order, limit | Trial or paid |
/api/bonds | Government bond yields, curves and spreads | optional type, country, tenor, sort, order, limit | Trial or paid |
/api/fx | Exchange rates and the US Dollar Index | optional min_move, sort, order, q, limit | Trial or paid |
/api/commodities | Commodity futures, ETCs and indices | optional min_move, sort, order, q, limit | Trial or paid |
/api/crypto | Major crypto assets and crypto ETPs | optional kind, min_move, sort, order, q, limit | Trial or paid |
/api/securities_movers | Largest movers in one asset class | asset_class (stocks, indices, etfs, futures, fx, commodities, crypto, yields, credit); optional horizon, threshold_pct, direction, country, q, limit | Trial or paid |
/api/securities_movers_export | Movers list as a file | as securities_movers, plus format | Plus and above |
/api/market_signals | Latest market signals, newest first | optional limit | Trial or paid |
/api/factor_returns_analysis | Distribution of returns under factor filters | secid, symbid or ticker; optional tf, start, end, histogram, filters | Trial or paid |
Global macro and risk
World-level panels.
| Endpoint | Returns | Parameters | Access |
|---|---|---|---|
/api/global_macro | Manufacturing and services PMI by region | none | Trial or paid |
/api/global_macro_weekly | Economic surprise index by region | none | Trial or paid |
/api/global_liquidity | Central bank balance sheets, M2 and FX reserves | optional tables (cb, m2, fx) | Trial or paid |
/api/global_risk | Volatility and credit risk indicators | none | Trial or paid |
/api/global_risk_overview | Risk index and macro backdrop | optional groups | Trial or paid |
/api/macro_movers | Countries ranked on one macro indicator | indicator or indicator_type (list=1 for the catalogue); optional metric, direction, region, country, limit | Trial or paid |
/api/macro_movers_export | Macro ranking as a file | as macro_movers, plus format | Plus and above |
/api/economic_calendar | Economic releases and events | optional start, end, country, event | Trial or paid |
/api/corporate_calendar | Company earnings calendar | optional start, end, country, event | Trial or paid |
Countries
Economic data and factors by country.
| Endpoint | Returns | Parameters | Access |
|---|---|---|---|
/api/country_factors_overview | Country factor overview | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_factors_markets_overview | Country market factors | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_factors_macro_overview | Country macro factors | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_factors_risk_overview | Country risk factors | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_master_esi_overview | Economic sentiment indicators | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_advanced_esi_overview | Detailed sentiment indicators | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_economic_overview | Economic indicators | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_manufacturing_overview | Manufacturing | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_services_overview | Services | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_consumer_overview | Consumer | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_construction_overview | Construction | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_government_overview | Government | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_inflation_overview | Inflation | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_cpi_overview | Consumer price index detail | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_employment_overview | Employment | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_monetary_policy_overview | Monetary policy | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_fiscal_policy_overview | Fiscal policy | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_trade_overview | Trade | country (name, ISO2 or ISO3) | Trial or paid |
/api/country_macro_detail_overview | One macro variable for one country | symbid, macrid, ticker, or country and indicator | Trial or paid |
/api/country_macro_detail_factors | Momentum and trend signals of a macro variable | symbid, macrid, ticker, or country and indicator | Trial or paid |
Stocks and fundamentals
Company, sector and industry data.
| Endpoint | Returns | Parameters | Access |
|---|---|---|---|
/api/stock_lookup | Search the stock universe | query; optional country, limit | Trial or paid |
/api/stock_overview | Overview of one stock | entity_id or ticker | Trial or paid |
/api/stock_factors | Composite factor signals; the full grid needs Research | entity_id or ticker | Trial or paid |
/api/country_stocks | Ranked stocks of one country | country (name, ISO2 or ISO3); optional sort, order, sector, limit | Trial or paid |
/api/country_stock_fundamentals | Fundamentals of a country’s stocks | country (name, ISO2 or ISO3); optional sector, industry_group, industry, subindustry | Trial or paid |
/api/security_factors | Factor model of one security | symbid, secid or ticker | Trial or paid |
/api/factor_explain | Plain explanation of a factor | view_kind or idf; optional lang | Trial or paid |
/api/stock_country_fundamentals | Country aggregates for the stock’s country | entity_id or ticker | Quant |
/api/stock_sector_fundamentals | Sector aggregates | entity_id or ticker | Quant |
/api/stock_indgrp_fundamentals | Industry group aggregates | entity_id or ticker | Quant |
/api/stock_industry_fundamentals | Industry aggregates | entity_id or ticker | Quant |
/api/stock_subindustry_fundamentals | Sub-industry aggregates | entity_id or ticker | Quant |
/api/stock_sector_market_overview | Momentum, trend and volatility of the sector | entity_id or ticker | Quant |
/api/stock_indgrp_market_overview | The same for the industry group | entity_id or ticker | Quant |
/api/stock_industry_market_overview | The same for the industry | entity_id or ticker | Quant |
/api/stock_subindustry_market_overview | The same for the sub-industry | entity_id or ticker | Quant |
/api/global_risk_factors | Global risk factor exposures of a security | entity_id or ticker | Quant |
/api/stock_outliers | Large statistical moves of a security | entity_id or ticker; optional window_days, days, limit | Quant |
Research and news
Reports, papers and news.
| Endpoint | Returns | Parameters | Access |
|---|---|---|---|
/api/news | News posts | optional start, end, country, stock, security, sector, industry, subindustry, query | Trial or paid |
/api/quant_papers | Quant paper references; summaries and links need Research | symbid, secid, ticker or domain; optional limit | Trial or paid |
/api/research | Search research reports; full access needs Research | query, or entity_kind with entity or entity_id | Trial or paid |
/api/stock_research_reports | Reports mentioning a stock | entity_id, ticker or company; optional limit | Quant |
/api/country_research_reports | Reports about a country | country (name, ISO2 or ISO3); optional limit | Quant |
/api/securities-research-reports | Reports on an index, future, currency or bond | symbid, ticker or secid; optional limit | Quant |
/api/macro-research-reports | Reports on a macro indicator | symbid or ticker; optional limit | Quant |
/api/sector-research-reports | Reports on a sector | sector_id or sector; optional limit | Quant |
/api/industries-research-reports | Reports on an industry | industry_id or industry; optional limit | Quant |
/api/subindustries-research-reports | Reports on a sub-industry | subindustry_id or subindustry; optional limit | Quant |