Short, working examples of the DataPorium financial data API in different languages and tools. Get stock prices, company financial statements, US economic data and US housing data with a few lines of code or a spreadsheet formula. The API covers real-time and historical market data across stocks, ETFs, crypto, forex and commodities, plus company fundamentals, news, the US economy and US housing: 203 endpoints in 42 categories, all returning JSON.
| Folder | Use it from |
|---|---|
| curl | The terminal, or to try a request before writing code |
| javascript | Node.js, with plain fetch or the JavaScript library |
| python | Python, with requests or the Python library |
| r | R, with httr2 |
| google-sheets | Google Sheets formulas such as =DP_PRICES("AAPL", 30) |
| excel | Excel, through Power Query |
| mcp | Claude, ChatGPT, Cursor and other AI assistants, with no code |
- Base URL:
https://api.dataporium.io - API key: send it in the
apikeyrequest header (recommended), or as?apikey=YOUR_API_KEYin the address. The header keeps the key out of server and proxy logs. - Answer: JSON.
curl -H "apikey: YOUR_API_KEY" "https://api.dataporium.io/company-info?symbol=AAPL"Your API key comes with the Premium plan. Sign up at dataporium.tech; the key is in your account settings once you subscribe. The same key works for the REST API (600 requests per minute) and the MCP server.
| What | Path | Parameters |
|---|---|---|
| Company profile | /company-info |
symbol=AAPL |
| Daily prices of a stock, ETF, index or crypto | /stock-price-1d |
ticker=AAPL, ^GSPC or BTC-USD |
| Income statement of one quarter | /income-statements-summary |
symbol=AAPL&fiscal_year_qtr=2025Q4 |
| US economic series | /economic-metrics |
economic_metrics=unemployment_Rate |
| Treasury yield curve | /treasury-yields/curve |
compare=1m,1y |
| Homes for sale with a price cut | /properties |
zip=92602&price_cut=true |
All 203 endpoints and their parameters are in the API documentation.
| Code | Meaning |
|---|---|
| 401 | API key required. Include your API key in the request |
| 403 | Invalid or expired API key, or subscription inactive |
| 429 | Rate limit exceeded. The maximum is 600 requests per minute |
| 500 | Internal server error. Try again or contact support |
Python scripts that each solve one task, built on the Python library:
- stock-price-history-to-csv: daily stock, ETF and crypto prices to CSV
- company-financials-to-excel: income statement, balance sheet and cash flow to Excel
- yield-curve-inversion-tracker: 10-year minus 2-year Treasury spread and every inversion
- inflation-by-category: which prices are rising fastest
- layoffs-tracker: US layoffs by company, state and industry to CSV
- home-price-cut-finder: homes with the biggest price cuts by ZIP code, city or county
- Do not put the key in code that you commit or share. Use an environment variable or your tool's secret settings.
- Do not put the key in a web page or a mobile app. Call the API from your own server.
- If a key leaks, create a new key in your account settings. The old one stops working.
- Website: https://dataporium.tech
- API documentation: https://dataporium.tech/api-docs
- MCP server: https://dataporium.tech/mcp
- Python library: https://github.com/DataPorium/dataporium-python
- JavaScript library: https://github.com/DataPorium/dataporium-js
- Questions: open an issue or write to [email protected]
The examples are released under the MIT License. Data is for information only and is not investment advice.