Macrotrends Scraper | Stock Financials and Historical Data avatar

Macrotrends Scraper | Stock Financials and Historical Data

Pricing

from $19.00 / 1,000 results

Go to Apify Store
Macrotrends Scraper | Stock Financials and Historical Data

Macrotrends Scraper | Stock Financials and Historical Data

Pull historical stock prices, financial statements, ratios, and macroeconomic charts from Macrotrends. Track revenue, earnings, margins, debt, dividends, and cash flow across decades for any public company. Perfect for analysts, investors, and quant research workflows worldwide.

Pricing

from $19.00 / 1,000 results

Rating

0.0

(0)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

ParseForge Banner

📈 Macrotrends Scraper

🚀 Export decades of financial and macro data in seconds. Scrape stock revenue, earnings, PE ratios, GDP, inflation, unemployment, and 1,000+ other historical time-series from Macrotrends - no API key required, fully automated.

🕒 Last updated: 2026-05-21 · 📊 7 fields per record · Decades of history · Global coverage

The Macrotrends Scraper extracts historical time-series data directly from Macrotrends chart pages. It supports both stock financial charts (revenue, EPS, PE ratio, free cash flow, and more) and global macro charts (GDP, inflation, unemployment, interest rates). Data is parsed from the embedded JavaScript data layer - no browser required, results in seconds.

The dataset covers S&P 500 companies with quarterly and annual data going back to the 1970s for stocks, and annual macro data from the 1960s onward for countries worldwide.

Coverage

  • Stock charts: Revenue, Net Income, EPS, PE Ratio, Free Cash Flow, Gross Profit, EBITDA, and 100+ other metrics for any ticker on Macrotrends
  • Macro charts: GDP, Inflation (CPI), Unemployment, Interest Rates, National Debt, and more for 200+ countries
  • History: Up to 50+ years of quarterly or annual data per series
  • 7 output fields per record including date, value, metric name, ticker, source URL, and timestamp

Target Audience / Use Cases

WhoHow they use it
Financial analystsBuild revenue and earnings models for public companies
EconomistsTrack macro trends across countries and time periods
Quant researchersBacktest strategies using historical PE ratios and earnings data
Data journalistsVerify and visualize long-run economic narratives
Business intelligence teamsEnrich dashboards with external benchmarks
Academic researchersCollect ground-truth financial data for studies

📋 What the Macrotrends Scraper does

  • Scrapes any Macrotrends stock chart URL (e.g. Apple Revenue, Tesla PE Ratio, Microsoft EPS)
  • Scrapes any Macrotrends global-metrics URL (e.g. US GDP, Germany Inflation, Japan Unemployment)
  • Returns one record per time period with date, value, metric name, and ticker
  • Automatically detects URL type and selects the correct data extraction path
  • Limits output to maxItems for cost control; free users get up to 10 records as a preview

💡 Why it matters: Macrotrends is one of the richest free sources of historical financial and macro data on the internet. This scraper makes that data programmatically accessible for any workflow - financial modeling, macro research, dashboard enrichment, or academic study.

🎬 Full Demo

🚧 Coming soon

⚙️ Input

FieldTypeRequiredDefaultDescription
startUrlstringYeshttps://www.macrotrends.net/stocks/charts/AAPL/apple/revenueFull Macrotrends chart URL to scrape
maxItemsintegerNo10Maximum number of records to return (free: 10, paid: up to 1,000,000)

Example 1 - Apple Quarterly Revenue

{
"startUrl": "https://www.macrotrends.net/stocks/charts/AAPL/apple/revenue",
"maxItems": 50
}

Example 2 - US GDP (Annual)

{
"startUrl": "https://www.macrotrends.net/global-metrics/countries/usa/united-states/gdp-gross-domestic-product",
"maxItems": 60
}

⚠️ Good to Know: The startUrl must be a full Macrotrends chart page URL - either /stocks/charts/{TICKER}/{slug}/{metric} for stock data or /global-metrics/countries/{country-id}/{slug}/{metric} for macro data. The scraper automatically detects which type it is and adapts accordingly.

📊 Output

FieldTypeDescription
📅 datestringDate of the data point in YYYY-MM-DD format
💹 valuenumberNumeric value of the metric for this period
📊 metricstringHuman-readable metric name (e.g. "Apple Revenue", "GDP")
🔖 tickerstringStock ticker (e.g. AAPL) or country ID (e.g. usa)
🔗 urlstringSource Macrotrends chart URL
🕒 scrapedAtstringISO 8601 timestamp of when the record was collected
errorstring/nullError message if scraping failed, otherwise null

Sample Records

Stock data (Apple Revenue):

[
{
"date": "2012-03-31",
"value": 39.186,
"metric": "Apple Revenue",
"ticker": "AAPL",
"url": "https://www.macrotrends.net/stocks/charts/AAPL/apple/revenue",
"scrapedAt": "2026-05-21T23:23:25.741Z",
"error": null
},
{
"date": "2012-06-30",
"value": 35.023,
"metric": "Apple Revenue",
"ticker": "AAPL",
"url": "https://www.macrotrends.net/stocks/charts/AAPL/apple/revenue",
"scrapedAt": "2026-05-21T23:23:25.741Z",
"error": null
},
{
"date": "2012-09-30",
"value": 35.966,
"metric": "Apple Revenue",
"ticker": "AAPL",
"url": "https://www.macrotrends.net/stocks/charts/AAPL/apple/revenue",
"scrapedAt": "2026-05-21T23:23:25.741Z",
"error": null
}
]

Macro data (US GDP):

[
{
"date": "1960-01-01",
"value": 541988586206.9,
"metric": "GDP",
"ticker": "usa",
"url": "https://www.macrotrends.net/global-metrics/countries/usa/united-states/gdp-gross-domestic-product",
"scrapedAt": "2026-05-21T23:21:26.955Z",
"error": null
}
]

✨ Why choose this Actor

FeatureDetails
⚡ FastExtracts data directly from embedded JavaScript - no browser, no delays
🌐 Dual modeSupports both stock charts and global macro charts from one actor
📅 Long historyDecades of quarterly or annual data per series
🔒 No auth neededPublic data, no account or API key required
💡 Auto-detectionAutomatically detects URL type and picks the right extraction path
📦 Clean outputStructured JSON/CSV/Excel/XML - ready for spreadsheets or databases

📈 How it compares to alternatives

FeatureThis ActorManual downloadFinancial data APIs
Historical depth50+ years50+ yearsVaries (often 10-20 years)
CostFree preview / Pay-per-useFree (manual)$50-$500/month subscription
AutomationFully automatedManual CSV downloadRequires API integration
No-code friendlyYes (Apify UI)Spreadsheet onlyRequires coding
Macro + stock combinedYesSeparate pagesSeparate providers
Output formatsJSON, CSV, Excel, XMLCSV onlyJSON

🚀 How to use

  1. Create a free Apify account with $5 in free credit
  2. Open this Actor in the Apify Console
  3. Paste any Macrotrends chart URL into the startUrl field
  4. Set maxItems to control how many records you want (10 for preview, or higher for full history)
  5. Click Start and wait a few seconds
  6. Download your dataset as CSV, Excel, JSON, or XML

💼 Business use cases

Financial Modeling and Valuation

Analysts building DCF models or comparable company analyses need historical revenue, earnings, and margin data. This scraper provides quarterly financial data going back 10+ years for any S&P 500 company - pull AAPL, MSFT, TSLA, NVDA revenue in one run and feed it directly into your model.

Macroeconomic Research and Dashboards

Economists and BI teams tracking inflation, GDP growth, or unemployment trends can automate collection of time-series data across multiple countries. Schedule this scraper on a cadence to keep dashboards current without manual CSV downloads.

Quantitative Strategy Backtesting

PE ratio history, EPS trends, and free cash flow yield are key inputs for quant strategies. This scraper extracts decades of that data so you can backtest valuation-based signals across full market cycles including 2008, 2020, and beyond.

Academic and Journalism Research

Students, professors, and journalists need verifiable, citable economic data. Macrotrends aggregates World Bank, Fed, and FRED data in one place. This scraper makes it programmable for reproducible research pipelines.

🔌 Automating Macrotrends Scraper

Connect this Actor to your favorite automation tool:

  • Make (Integromat): Trigger on a schedule, push results to Google Sheets or Airtable
  • Zapier: Run the actor weekly and send new records to Slack or a database
  • Apify Scheduler: Set a daily or weekly cron to keep financial data fresh
  • Webhooks: Receive a POST notification when each run finishes with dataset URL
  • REST API: Call the Apify API directly from Python, Node.js, or any HTTP client

🌟 Beyond business use cases

Research and Academia

Track long-run relationships between variables - does PE ratio expansion precede recessions? Does GDP per capita correlate with life expectancy? Automate data collection for studies that would otherwise require hours of manual work.

Creative and Storytelling

Data journalists can build compelling timelines showing how Apple's revenue grew from $39B to $400B in a decade, or how US GDP recovered after 2008. The clean structured output is chart-ready.

Non-profit and Policy Analysis

Policy researchers can extract inflation and unemployment data for multiple countries to compare recovery trajectories after crises, identify outliers, and inform evidence-based recommendations.

Experimentation and Learning

Finance students learning valuation can pull real data for case studies. Data science students can practice time-series modeling on actual quarterly earnings data. No fake datasets needed.

🤖 Ask an AI assistant about this scraper

You can ask an AI assistant to help you use this actor. For example:

  • "Write me a Python script that calls the Apify API to run ParseForge/macrotrends-scraper and download AAPL PE ratio history as a CSV"
  • "How do I schedule this scraper to run monthly and push results to Google Sheets using Make?"
  • "What Macrotrends URL should I use to get Tesla's free cash flow history?"

❓ Frequently Asked Questions

❓ What URLs does this scraper support?

Any Macrotrends chart page URL. Stock charts follow the pattern /stocks/charts/{TICKER}/{company-slug}/{metric}. Macro charts follow /global-metrics/countries/{country-id}/{country-slug}/{metric}. Paste the URL directly from your browser.

❓ What metrics are available for stocks?

Revenue, net income, EPS (diluted), PE ratio, free cash flow, gross profit, operating income, EBITDA, book value per share, and dozens more. Any metric with a chart on Macrotrends will work.

❓ What macro indicators are available?

GDP, GDP per capita, inflation (CPI), unemployment rate, interest rates, national debt, trade balance, and more. Availability varies by country. The US, EU, and major economies have the most complete coverage.

❓ How far back does the data go?

For most S&P 500 stocks, quarterly data starts in the early 2000s or earlier. For macro data, annual series often go back to 1960. The exact start date depends on the specific metric and company.

❓ Is the data quarterly or annual?

Stock data is quarterly by default (the scraper uses the quarterly frequency endpoint). Macro data frequency depends on the chart - GDP is annual, CPI may be monthly or annual.

❓ Are the values in billions or millions?

Values are in the same units as displayed on the Macrotrends chart - typically billions of USD for revenue and market cap, dollars per share for EPS, and a ratio for PE. Check the source page for the unit label.

❓ How do I get data for a different company or country?

Just change the startUrl to any Macrotrends chart URL. Navigate to macrotrends.net, find the chart you want, and copy the URL from your browser.

❓ How fast is the scraper?

Typically under 5 seconds per URL. Data is embedded in the page HTML, so no pagination or JavaScript rendering is needed.

❓ Will this work if the site changes its layout?

The scraper targets the data layer (JavaScript variables embedded in the page), which is more stable than HTML structure. If Macrotrends changes its data format, the actor will be updated.

❓ Is there a limit on how many records I can get?

Free users get up to 10 records as a preview. Paid users can set maxItems up to 1,000,000. Most charts have 50-200 records of history, so a single run typically uses minimal compute.

❓ Can I run multiple URLs in one run?

The current version supports one URL per run. To scrape multiple metrics or tickers, run the actor multiple times (or use Apify's parallelism features).

❓ Do I need a Macrotrends account?

No. The data is publicly available without login.

🔌 Integrate with any app

Export the dataset in your preferred format and connect to:

Spreadsheets: Google Sheets, Microsoft Excel, LibreOffice Calc

Databases: PostgreSQL, MySQL, MongoDB, Snowflake, BigQuery, Redshift

BI Tools: Tableau, Power BI, Looker, Metabase, Grafana

Data Pipelines: Airbyte, Fivetran, dbt, Apache Airflow

No-code Platforms: Airtable, Notion, Coda, Retool

Automation: Make (Integromat), Zapier, n8n, Pipedream

Programming: Python (pandas, requests), Node.js, R, Julia

ActorDescription
HUD User Data ScraperScrape US housing data from HUD including fair market rents and income limits
FINRA BrokerCheck ScraperExtract financial advisor and broker records from FINRA
USGS Earthquake ScraperReal-time and historical seismic data from USGS
EPA AQS Air Quality ScraperAir quality monitoring data from the EPA AQS database
World Bank Data Scraper16,000+ World Bank economic indicators by country

💡 Pro Tip: browse the complete ParseForge collection to find scrapers for financial data, government databases, job boards, and more.


Disclaimer: This actor is not affiliated with, endorsed by, or sponsored by Macrotrends. It accesses only publicly available data. Use in accordance with Macrotrends' terms of service and applicable laws. Data accuracy depends on the source; always verify critical figures before use in financial decisions.