# Finished call to 'dbnomics.\_fetch\_response'

**URL:** <https://dbnomics.discourse.group/t/finished-call-to-dbnomics-fetch-response/740>\
**Category:** Documentation\
**Tags:** fetchers\
**Created:** [January 3, 2024, 2:49pm UTC](https://dbnomics.discourse.group/t/finished-call-to-dbnomics-fetch-response/740 "2024-01-03T14:49:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gb1](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@gb1](https://dbnomics.discourse.group/u/gb1)\
**Post date:** [January 3, 2024, 2:49pm UTC](https://dbnomics.discourse.group/t/finished-call-to-dbnomics-fetch-response/740/1 "2024-01-03T14:49:43Z")

</div>

Hi,

I am facing an issue with library. Hope someone can help.  
I have installed DBnomics libaray and trying to run the first sample code that I found in the documentation at this [link](https://docs.db.nomics.world/download-data/).  
However, I am getting the following error:

_Could not fetch data from URL ‘[https://api.db.nomics.world/v22/series/OECD/MEI/USA.B6BLTT01.CXCUSA.Q?observations=1&offset=0](https://api.db.nomics.world/v22/series/OECD/MEI/USA.B6BLTT01.CXCUSA.Q?observations=1&offset=0)’_

However, if I paste that exact URL in the browser, I get a successful response with the data. Am I doing something wrong or it’s a problem related to the library?

Code:  
import dbnomics  
dbnomics.fetch\_series(‘OECD’, ‘MEI’, ‘USA.B6BLTT01.CXCUSA.Q’)

Screenshot:

 ![image](https://global.discourse-cdn.com/free1/uploads/dbnomics/original/1X/a187ec0ab43da50d0925093f9d0fa77471209dd6.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/dbnomics/original/1X/764b1461566371b600794903147968102227c442.png)

---

<div class="post-metadata">

**Author:** ![cbenz](https://yyz2.discourse-cdn.com/free1/user_avatar/dbnomics.discourse.group/cbenz/32/33_2.png) [@cbenz](https://dbnomics.discourse.group/u/cbenz)\
**Post date:** [January 4, 2024, 6:01pm UTC](https://dbnomics.discourse.group/t/finished-call-to-dbnomics-fetch-response/740/2 "2024-01-04T18:01:35Z")

</div>

Hi @gb1 and welcome to the DBnomics community!

Thanks for your detailed error report.

I just tried the code snippet, and it worked as in the docs.

Could you please retry? I suspect that it was a temporary high load on DBnomics that caused the inability to load data.

---

<div class="post-metadata">

**Author:** ![gb1](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@gb1](https://dbnomics.discourse.group/u/gb1)\
**Post date:** [January 5, 2024, 12:46pm UTC](https://dbnomics.discourse.group/t/finished-call-to-dbnomics-fetch-response/740/3 "2024-01-05T12:46:08Z")

</div>

I tried again before and after reinstalling the library but still seeing the same error.

---

<div class="post-metadata">

**Author:** ![gb1](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@gb1](https://dbnomics.discourse.group/u/gb1)\
**Post date:** [January 5, 2024, 12:49pm UTC](https://dbnomics.discourse.group/t/finished-call-to-dbnomics-fetch-response/740/4 "2024-01-05T12:49:10Z")

</div>

[Error.pdf](https://dbnomics.discourse.group/uploads/short-url/dIS4ooRodnmcm6hJwAawhTczjv8.pdf) (107.3 KB)

---

<div class="post-metadata">

**Author:** ![gb1](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@gb1](https://dbnomics.discourse.group/u/gb1)\
**Post date:** [January 5, 2024, 1:07pm UTC](https://dbnomics.discourse.group/t/finished-call-to-dbnomics-fetch-response/740/5 "2024-01-05T13:07:21Z")

</div>

However I noticed that this happens only on my local jupyter. I tried the same query on Colab and it worked seamlessly.

---

<div class="post-metadata">

**Author:** ![cbenz](https://yyz2.discourse-cdn.com/free1/user_avatar/dbnomics.discourse.group/cbenz/32/33_2.png) [@cbenz](https://dbnomics.discourse.group/u/cbenz)\
**Post date:** [January 10, 2024, 10:05am UTC](https://dbnomics.discourse.group/t/finished-call-to-dbnomics-fetch-response/740/6 "2024-01-10T10:05:55Z")

</div>

In the error stack trace you attached (`Error.pdf`), the “real” error is:

```auto
File ~\anaconda3\lib\site-packages\dbnomics\ __init__.py:572, in _fetch_response(url, timeout)
570
timeout = default_timeout
--> 572 response = httpx.get(url, follow_redirects=True, timeout=timeout)
574 if response.status_code in {429, 500, 502, 503, 504}:
TypeError: get() got an unexpected keyword argument 'follow_redirects'

```

This makes me think that a wrong version of the `httpx` dependency could be installed.

However I could not reproduce the problem.  
Doing it myself, here is my command-line logs from scratch:

```bash
$ python -V      
Python 3.11.6

$ virtualenv dbnomics-venv
$ . ./dbnomics-venv/bin/activate

$ pip install dbnomics
[...]

# Checking the versions of the dependencies
$ pip list
Package Version
--------------- ------------
anyio 4.2.0
certifi 2023.11.17
dbnomics 1.2.5
h11 0.14.0
httpcore 1.0.2
httpx 0.26.0
idna 3.6
numpy 1.26.3
pandas 2.1.4
pip 23.3.2
python-dateutil 2.8.2
pytz 2023.3.post1
setuptools 69.0.3
six 1.16.0
sniffio 1.3.0
tenacity 8.2.3
tzdata 2023.4
wheel 0.42.0

$ python  
Python 3.11.6 (main, Nov 14 2023, 09:36:21) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbnomics
>>> dbnomics.fetch_series('OECD', 'MEI', 'USA.B6BLTT01.CXCUSA.Q')
    @frequency provider_code dataset_code ... Subject Measure Frequency
0 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
1 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
2 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
3 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
4 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
.. ... ... ... ... ... ... ...
250 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
251 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
252 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
253 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly
254 quarterly OECD MEI ... Balance of payments BPM6 > Current account Bal... US Dollars, sum over component sub-periods, s.a. Quarterly

[255 rows x 18 columns]
>>> 

```

How did you install the `dbnomics` module locally? What’s your Python version (because older Python versions could lead to an older version of `httpx` also)?

PS: just for your information, instead of a screenshot or a PDF, which are not very convenient to read and copy-paste, the idiomatic way to attach source code in forum messages is by using “fenced code blocks”, cf [docs](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks)

---

<div class="post-metadata">

**Author:** ![gb1](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@gb1](https://dbnomics.discourse.group/u/gb1)\
**Post date:** [February 7, 2024, 7:23pm UTC](https://dbnomics.discourse.group/t/finished-call-to-dbnomics-fetch-response/740/7 "2024-02-07T19:23:20Z")

</div>

> [@cbenz](#):
>
> ` 0.26.0`

That fixed the issue, thanks!
