Security error using fred/fetch

158 vues (au cours des 30 derniers jours)
Luca
Luca le 26 Juil 2025
Modifié(e) : Edu Benet Cerda il y a environ 23 heures
Hi,
I recently updated the Mac software to Sequoia, and started to receive the following error for a code that has always worked before:
Error using fred/fetch
Unable to retrieve data. Verify valid security request.
Do you know how to fix this? I have updated the Matlab version to the latest, and the error still persists.
Thanks!
  11 commentaires
Gauthier
Gauthier le 29 Juil 2025
Déplacé(e) : dpb le 29 Juil 2025
Hi,
Same error with MATLAB R2024b and windows OS.
Best
Yvan Becard
Yvan Becard le 19 Août 2025 à 17:56
Same error with MATLAB R2025a and Ubuntu 24.04.3 LTS

Connectez-vous pour commenter.

Réponse acceptée

Meet
Meet le 29 Juil 2025
Hi Luca,
I was facing a similar issue and figured out that the FRED website recently changed its API and the built-in "fetch" command is no longer able to access the data. This issue can be resolved by downloading the updated "fetch" function and replacing the old function in the toolbox.
Please rename the MATLAB Script "fetch" to "fetch_old" in the below folder on your macOS:
/Applications/MATLAB_R2025a/toolbox/datafeed/datafeed/@fred/
After, please insert the new "fetch" function into the above location. After doing so, the "fetch" function will be able to retrieve data from the FRED website. This set of operations may require administrator privileges.
Note that because of this API change, the output of "fetch" is slightly different and now only includes "SeriesID" and "Data". Also, the "Data" field in the return structure now contains a cell array with an array of doubles, a table or a timetable depending on the input property "DataReturnFormat". Previously, it was either an array of doubles, a table or a timetable not nested in a cell array.
An alternative solution is to use the https://www.mathworks.com/matlabcentral/fileexchange/68247-fred-rest-for-matlab support package on MATLAB File exchange. However, this requires an API key from the FRED website, and has some syntactical changes.
I hope this helps resolve the issue!
  6 commentaires
Yvan Becard
Yvan Becard il y a environ 4 heures
I was redirected to this page by a Matlab employee:
Does anyone know how to make FRED© REST work?
Edu Benet Cerda
Edu Benet Cerda il y a environ 3 heures
Modifié(e) : Edu Benet Cerda il y a environ 3 heures
get an API key from the fred website: St. Louis Fed Web Services: API Key
And the code as:
c = fredrs(<KEY>);
tt = c.series('NYGDPPCAPKDWLD','observations');
tt.observations{1}
Follow the api options described here:

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Help and Support dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by