Security error using fred/fetch

46 visualizaciones (últimos 30 días)
Luca
Luca el 26 de Jul. de 2025
Comentada: Yvan Becard el 8 de Sept. de 2025
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 comentarios
Gauthier
Gauthier el 29 de Jul. de 2025
Movida: dpb el 29 de Jul. de 2025
Hi,
Same error with MATLAB R2024b and windows OS.
Best
Yvan Becard
Yvan Becard el 19 de Ag. de 2025
Same error with MATLAB R2025a and Ubuntu 24.04.3 LTS

Iniciar sesión para comentar.

Respuesta aceptada

Meet
Meet el 29 de Jul. de 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!
  7 comentarios
Edu Benet Cerda
Edu Benet Cerda el 3 de Sept. de 2025
Editada: Edu Benet Cerda el 3 de Sept. de 2025
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:
Yvan Becard
Yvan Becard el 8 de Sept. de 2025
Thanks a lot Edu

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Help and Support en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by