Matlab Access Datafeed
MathWorksOfficialCreated by MathWorks
- Skill
- Tool integration
- Data and AI
- BSD-2-Clause
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The Datafeed Toolbox provides a unified interface for MATLAB users to retrieve data from various external providers, including Bloomberg, FRED, Haver Analytics, LSEG Datastream, NOAA, and US government agencies like the BEA, BLS, Census, and EIA. This skill covers the necessary connection patterns, interface selection, and data retrieval methods for these services, enabling seamless integration of external time-series and market data into MATLAB workflows.
What it does
- Connects to Bloomberg for market and reference data using C++ or REST APIs.
- Retrieves economic time series from the St. Louis Fed (FRED) via the fredrs interface.
- Fetches global economic and financial data from Haver Analytics.
- Accesses historical financial data from LSEG Datastream.
- Retrieves historical climate and weather data from NOAA Climate Data Online.
- Provides interfaces for US government agency data including BEA, BLS, Census, and EIA.
When to use it
- When you need to integrate real-time or historical market data into your MATLAB analysis.
- When performing economic research requiring time series from FRED or Haver Analytics.
- When working with historical financial data from LSEG Datastream.
- When your research requires climate or weather data from NOAA.
- When you need to pull public economic indicators from US government agencies.
Advantages
- Unified access to diverse data sources within the MATLAB environment.
- Supports both local terminal-based connections and platform-independent cloud/REST APIs.
- Provides specific interfaces optimized for different license types and environments.
- Enables programmatic data retrieval for automated research and modeling pipelines.
Usage examples
- “How do I connect to Bloomberg using the recommended C++ interface?”
- Use the bloomberg constructor to initialize the connection, then call getdata to retrieve security information.
- “How can I fetch historical data from LSEG Datastream?”
- Initialize a datastreamws connection object with your credentials and use the history method to retrieve time series data.
- “What is the correct way to get FRED data in MATLAB?”
- Use the fredrs interface, which is the current standard for accessing FRED economic data in MATLAB R2026a and later.
- “How do I access US government data like BLS employment statistics?”
- Use the usbls interface from the GitHub-based collection to query specific employment data series.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/matlab/matlab-access-datafeed/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip matlab-access-datafeed.zip -d .agents/skills
Documentation by MathWorks
Datafeed Toolbox — Bloomberg, FRED, Haver Analytics, LSEG Datastream, NOAA, and US Government Data
Access financial, economic, climate, and government data from multiple providers through the MATLAB Datafeed Toolbox and related GitHub interfaces.
When to Use
User wants to connect to Bloomberg, FRED, Haver Analytics, LSEG Datastream, NOAA, or US government agencies (BEA, BLS, Census, EIA) from MATLAB
User needs to retrieve market data (prices, history, real-time, reference data) via Bloomberg
User needs to retrieve economic time series from the St. Louis Fed (FRED)
User needs to fetch economic/financial time series from Haver Analytics databases
User needs to retrieve historical financial data from LSEG Datastream
User needs help choosing between interfaces within a provider (e.g., bloomberg vs blp vs bloombergHypermedia, haver vs haverview)
User needs to retrieve historical climate or weather data from NOAA Climate Data Online
User needs to retrieve GDP, employment, population, or energy data from US government agencies
User is writing MATLAB code involving securities, economic indicators, climate data, government data, or data provider connectivity
When NOT to Use
General financial modeling or portfolio optimization that doesn't involve data provider connectivity
Bloomberg Terminal keyboard shortcuts or Excel add-in questions (not MATLAB)
Datastream Excel add-in (not MATLAB)
Real-time streaming from LSEG (datastreamws is historical only)
NOAA forecast API (weather.gov) or NOAA CO-OPS tidal data (different services from CDO)
Direct REST/HTTP calls to US government agency APIs without MATLAB
Agency-specific data interpretation (what BLS series IDs mean, Census variable codes, etc.)
Data sources not covered here (e.g., Yahoo Finance)
Installing MATLAB, Datafeed Toolbox, or toolbox products → use
matlab-install-productsQuerying relational databases via SQL, JDBC, or ODBC → use
matlab-use-databaseDebugging generic MATLAB runtime errors not specific to a data provider → use
matlab-debug-code
Provider Overview
| Provider | Data Type | Interfaces | Reference |
|---|---|---|---|
| Bloomberg | Market data (equities, fixed income, derivatives, indices) | bloomberg, blp, bloombergHypermedia, bloombergEMSX | references/bloomberg.md |
| FRED | U.S. economic data (GDP, unemployment, CPI, interest rates) | fredrs (replaces obsolete fred) | references/fred.md |
| Haver Analytics | Global economic & financial data (macro, industry, surveys) | haver, haverdirect, haverview | references/haver.md |
| LSEG Datastream | Historical financial data (equities, indices, economics, expressions) | datastreamws | references/datastreamws.md |
| NOAA CDO | Historical climate/weather data (temperature, precipitation, snowfall) | noaa (GitHub) | references/noaa.md |
| US Government Data | GDP, employment, population, energy (BEA, BLS, Census, EIA) | usbea, usbls, uscensus, useia (GitHub) | references/us-govt-data.md |
Quick Interface Selection
Bloomberg — see references/bloomberg.md for full API patterns
Windows Desktop/Terminal user →
bloomberg(C++)Need platform independence (Data License) →
bloombergHypermediaServer/cloud, no Terminal (BPIPE) →
bloombergBPIPEExisting
blpusers → migrate tobloomberg(same API, no Java needed)
FRED — see references/fred.md for full API patterns
Any platform →
fredrs(requires R2026a+, API key)fredis obsolete — do NOT use it
Haver Analytics — see references/haver.md for full API patterns
Windows with local data files →
haverWindows needing remote access →
haverdirectNon-Windows / server / cloud →
haverview(REST API)
LSEG Datastream — see references/datastreamws.md for full API patterns
Any platform →
datastreamws(REST API, requires Datastream credentials)
NOAA Climate Data Online — see references/noaa.md for full API patterns
Any platform →
noaa(GitHub interface, requires free CDO API token)Clone from
github.com/mathworks/noaaandaddpath— not part of Datafeed Toolbox
US Government Data — see references/us-govt-data.md for full API patterns
BEA →
usbea(GDP, national/regional/international economic accounts)BLS →
usbls(employment, unemployment, CPI, wages)Census Bureau →
uscensus(population, ACS, economic census)EIA →
useia(electricity, petroleum, natural gas, coal)Clone from
github.com/mathworks/Access-Public-US-Government-Data-from-MATLABandaddpath— not part of Datafeed Toolbox
How to Use References
Before generating code for a specific provider, read the corresponding reference file for detailed API patterns, function signatures, gotchas, and examples:
Working with Bloomberg data → read
references/bloomberg.mdWorking with FRED economic data → read
references/fred.mdWorking with Haver Analytics data → read
references/haver.mdWorking with LSEG Datastream data → read
references/datastreamws.mdWorking with NOAA climate/weather data → read
references/noaa.mdWorking with BEA, BLS, Census, or EIA data → read
references/us-govt-data.md
Common Rules
Always use
getSecret()for credentials and API keys — never hardcode secretsBloomberg, FRED, Haver, and Datastream require the Datafeed Toolbox.
fredrsadditionally requires R2026a or laterdatastreamwsavailable since R2018bNOAA is a standalone GitHub interface requiring MATLAB only.
US government data interfaces (
usbea,usbls,uscensus,useia) are available on GitHub only and require MATLAB R2026b+ and Datafeed Toolbox R2026b+Bloomberg and Haver local interfaces (
bloomberg,blp,haver,haverdirect) are Windows-only; cloud/REST variants (bloombergHypermedia,bpipe,haverview,fredrs,datastreamws) are platform-independent
Copyright 2026 The MathWorks, Inc.
Files
- ATTRIBUTION.mdAdded by AutoGineer1.0 KiB
- LICENSELicence file added by AutoGineer1.4 KiB
- SKILL.md6.6 KiB
- manifest.yaml620 B
- references/bloomberg.md11.5 KiB
- references/datastreamws.md3.2 KiB
- references/fred.md4.0 KiB
- references/haver.md4.8 KiB
- references/noaa.md5.8 KiB
- references/us-govt-data.md8.2 KiB
references/noaa.md
NOAA Climate Data Online (CDO) — @noaa Interface
The @noaa class provides access to the NOAA Climate Data Online (CDO) Web Services API v2 from MATLAB. It is a GitHub-hosted interface, not part of the Datafeed Toolbox.
Installation
Clone the repository and add it to the MATLAB path:
% From a terminal:
% git clone https://github.com/mathworks/noaa.git
% In MATLAB:
addpath("C:\work\noaa") % adjust to your clone locationRequires MATLAB R2026b+.
Connecting
Create a connection using your CDO API token (register at ncdc.noaa.gov/cdo-web/token):
token = getSecret("NOAA_CDO_TOKEN");
c = noaa(token);The constructor validates the token by issuing a GET request to the API base URL. If the token is invalid, it throws datafeed:noaa:connectFailure.
Discovery Methods
Six methods share the same calling pattern and all return tables (via struct2table):
[d, response] = methodName(c, id, Name1, Value1, ...)id— optional record identifier; pass[]to omitName-value pairs map directly to CDO REST API query parameters
Default limit is 25 records per request; maximum is 1000 (
"limit", "1000")responseis amatlab.net.http.ResponseMessage
datasets
d = datasets(c); % all datasets (up to 25)
d = datasets(c, "GHCND"); % specific dataset by IDReturns table: uid, name, id (string); mindate, maxdate (datetime).
datacategories
d = datacategories(c);
d = datacategories(c, [], "limit", "42"); % all 42 categoriesReturns table: name, id (string). No date columns.
datatypes
d = datatypes(c);
d = datatypes(c, [], "datasetid", "GHCND", "limit", "1000");
d = datatypes(c, [], "datacategoryid", "TEMP", "datasetid", "GSOM", "limit", "100");Returns table: name, id (string); mindate, maxdate (datetime).
locationcategories
d = locationcategories(c);Returns table: name, id (string). No date columns.
locations
d = locations(c);
d = locations(c, [], "datasetid", "GHCND", "locationcategoryid", "ST", "limit", "52");Returns table: name, id (string); mindate, maxdate (datetime).
stations
d = stations(c);
d = stations(c, [], "datasetid", "GHCND", "locationid", "FIPS:12", "limit", "1000");
d = stations(c, "GHCND:USW00012839"); % specific stationReturns table: name, id, elevationUnit (string); mindate, maxdate (datetime).
Known issue: stations() can error on large result sets where station records have inconsistent fields. The struct2table call fails when some records have fields others lack. If this happens, filter by dataset, location, or limit to reduce the result set. For very large station queries, use direct HTTP requests with matlab.net.http as a fallback.
getdata — Retrieve Observations
[d, response] = getdata(c, datasetID, startdate, enddate, Name1, Value1, ...)All four positional arguments are required:
| Argument | Type | Notes |
|---|---|---|
datasetID | string | e.g. "GHCND", "GSOM", "GSOY" |
startdate | datetime or datenum | |
enddate | datetime or datenum |
Common name-value parameters: stationid, datatypeid, locationid, limit, units.
[d, ~] = getdata(c, "GHCND", datetime(2023,1,1), datetime(2023,12,31), ...
"stationid", "GHCND:USW00012839", ...
"datatypeid", "TMAX", ...
"units", "metric", ...
"limit", "1000");Returns a table with no column type conversion — all columns retain their JSON-deserialized types. This is different from discovery methods which convert specific columns to string and datetime. Typical columns: date (string), datatype (string), station (string), value (numeric).
To convert dates from getdata results:
dates = datetime(d.date, InputFormat="yyyy-MM-dd'T'HH:mm:ss");Common Datasets and Data Types
| Dataset | ID | Description |
|---|---|---|
| Daily Summaries | "GHCND" | Daily observations from ~100k stations worldwide |
| Monthly Summaries | "GSOM" | Monthly aggregates |
| Annual Summaries | "GSOY" | Annual aggregates |
| Data Type | ID | Unit (metric) |
|---|---|---|
| Average temperature | "TAVG" | tenths of °C |
| Maximum temperature | "TMAX" | tenths of °C |
| Minimum temperature | "TMIN" | tenths of °C |
| Precipitation | "PRCP" | tenths of mm |
| Snowfall | "SNOW" | mm |
Year-by-Year Looping for Large Requests
The API returns at most 1000 records per request. For multi-year daily data, loop year by year and concatenate:
allData = table();
for yr = 2020:2023
[d, ~] = getdata(c, "GHCND", datetime(yr,1,1), datetime(yr,12,31), ...
"stationid", "GHCND:USW00012839", ...
"datatypeid", "TMAX", ...
"units", "metric", ...
"limit", "1000");
if istable(d) && ~isempty(d)
allData = [allData; d]; %#ok<AGROW>
end
endBuilding a Timetable from Results
dates = datetime(allData.date, InputFormat="yyyy-MM-dd'T'HH:mm:ss");
values = allData.value / 10; % tenths of °C to °C
tt = timetable(dates, values, VariableNames="TMAX_C");Notes
The
@noaaclass is hosted on GitHub (github.com/mathworks/noaa), not shipped with the Datafeed Toolbox. It requiresaddpathafter cloning.Name-value parameter values should be passed as strings (e.g.
"limit", "1000"not"limit", 1000).Do not name variables
datatypesordatasets— these shadow the@noaamethod names.Large API responses (1000+ items) may deserialize as cell arrays of structs instead of struct arrays, causing
struct2tableto fail. Reduce the result set with filters orlimit.
Copyright 2026 The MathWorks, Inc.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an API key
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- MathWorks
- Publisher
- MathWorks (Official)
- Source
- matlab/matlab-agentic-toolkit · skills-catalog/computational-finance/matlab-access-datafeed · commit 2a7f215
- Licence
- BSD 2-Clause License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE.md)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by MathWorks or MathWorks.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-access-datafeed.zip