Skip to content

Commit 78222b9

Browse files
authored
New FRED URL
Updated url to reflect the changes by fred.stlouisfed.org for downloading CSV.
1 parent 3b88171 commit 78222b9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas_datareader/fred.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class FredReader(_BaseReader):
1717

1818
@property
1919
def url(self):
20-
return "http://research.stlouisfed.org/fred2/series/"
20+
return "https://fred.stlouisfed.org/graph/fredgraph.csv"
2121

2222
def read(self):
2323
try:
@@ -31,8 +31,7 @@ def _read(self):
3131
else:
3232
names = self.symbols
3333

34-
urls = [self.url + '%s' % n + '/downloaddata/%s' % n + '.csv' for
35-
n in names]
34+
urls = ["{}?id={}".format(self.url, n) for n in names]
3635

3736
def fetch_data(url, name):
3837
resp = self._read_url_as_StringIO(url)

0 commit comments

Comments
 (0)