Hi all, I have been pulling data from FRED that was possible through the community’s help in this thread . However, I am facing an error -
ERROR GET Request 3:1 Execute failed: java.lang.IllegalArgumentException: Illegal character in query at index 122: https://api.stlouisfed.org/fred/series/observations?series_id=M2SL&api_key=xxxxxxxxx&file_type=json
All other data can be pulled without any issue, only this series si causing problems. Any help?
Have you tried running the query in another tool (Postman, Python,…) for comparison?
br
The query returns fine in the Chrome browser. Not to mention, I have several other queries with different IDs.
You could use this workflow and avoid json entirely.
1 Like
thor
March 25, 2024, 8:03pm
5
I guess character at position 122 is somewhere in your API key. In contrast to web browser our nodes do not perform automated encoding of URLs. Therefore you have to make sure that the URL you provide only contains valid characters and characters that not valid in a URL (or the query part in this particular case) are encoded upfront.
1 Like
You were right, but it was an extra space at the end of the whole URL. I guess it happened during copy-pasting. Thanks.
I saw that earlier. Tbh, json API is a lot easier and universally available.
system
Closed
June 24, 2024, 12:30pm
7
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.