# Problem Retrieving 1 time series via Python API

**URL:** <https://dbnomics.discourse.group/t/problem-retrieving-1-time-series-via-python-api/334>\
**Category:** Uncategorized\
**Created:** [February 12, 2020, 9:54am UTC](https://dbnomics.discourse.group/t/problem-retrieving-1-time-series-via-python-api/334 "2020-02-12T09:54:25Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![snaiste](https://yyz2.discourse-cdn.com/free1/user_avatar/dbnomics.discourse.group/snaiste/32/27_2.png) [@snaiste](https://dbnomics.discourse.group/u/snaiste)\
**Post date:** [February 2, 2021, 2:28pm UTC](https://dbnomics.discourse.group/t/problem-retrieving-1-time-series-via-python-api/334/7 "2021-02-02T14:28:40Z")

</div>

Hi @thomasbrand,

I hope you’re well!

I’ve been looking at this issue, but I still can’t figure it out…

So I extracted 3 examples that either work or don’t when retrieving data using Python API:

Working:

1. Germany GDP: DESTATIS/81000BV007/DG.VGRPVK.X13JDKSB.VGR014

Not working:

1. Spain GDP: INE-SPAIN/30679/72.b1gq.l.y.00.index
2. US GDP: BEA/NIPA-T11706/A191RX-Q

I find that the issue with the not working series is in this method: fetch\_series\_by\_api\_link(api\_link, max\_nb\_series=None, editor\_api\_base\_url=default\_editor\_api\_base\_url, filters=None), lines 233-237, i.e. that’s where the code breaks for not working series.

If I look at ‘series\_infos’ when trying to retrieve each of the series, I can see that in the case of Germany, ‘dimensions’ and ‘dimension\_labels’ objects match, i.e.: there is a key equivalent in both the objects.:

‘dimensions’: {  
‘DINSG’: ‘DG’,  
‘VGRPB5’: ‘VGRPVK’,  
‘WERT05’: ‘X13JDKSB’,  
‘freq’: ‘Q’,  
‘ind’: ‘VGR014’,  
‘unit’: ‘jew\_me’  
}

‘dimensions\_labels’: {  
‘DINSG’: ‘Germany’,  
‘VGRPB5’: ‘Price base (current prices / price-adjusted)’,  
‘WERT05’: ‘Original and adjusted data’,  
‘freq’: ‘Frequency’,  
‘ind’: ‘Indicator’,  
‘unit’: ‘Unit’  
}

But when I look at Spain time series, I can see there are 2 additional key-value pairs in it’s dimension\_labels object.:

‘dimensions’: {  
‘3’: ‘72’,  
‘482’: ‘b1gq’,  
‘501’: ‘l’,  
‘544’: ‘y’,  
‘nac’: ‘00’,  
‘units’: ‘index’  
}  
‘dimensions\_labels’: {  
‘3’: ‘Type of data’,  
**’481’: ‘DISTRIBUTION TRANSACTIONS’,**  
‘482’: ‘ACCOUNTING BALANCES’,  
**’495’: ‘GVA ACCOUNTING BALANCE’,**  
‘501’: ‘Prices\_ESA’,  
‘544’: ‘Correction of effects’,  
‘nac’: ‘National Total’,  
‘units’: ‘Units’  
}

Similar thing happens with the US GDP:

‘dimensions’: {  
‘FREQ’: ‘Q’,  
‘concept’: ‘gross-domestic-product-gdp’,  
‘metric’: ‘millions-of-chained-dollars’,  
‘unit’: ‘level’  
}

‘dimensions\_labels’: {  
‘FREQ’: ‘Frequency’,  
‘concept’: ‘Concept’,  
**’industry’: ‘Industry’,**  
‘metric’: ‘Metric’,  
**’sub-industry’: ‘Industry precision’,**  
‘unit’: ‘Unit’  
}

So because of these additional key-value pairs, the code breaks when it iterates over ‘dimensions\_labels’ object and tries to find all key-values in the ‘dimensions’ object.

Unfortunatelly, I don’t know why in the case of Spain or the US these ‘dimensions’ and ‘dimensions\_labels’ objects are different in terms of lenght.

There are many more time series like this, I was wondering if you guys are aware of this issue and or know the workaround?

Thank you!

Have a great day,  
Aiste

---

_[View the full topic](https://dbnomics.discourse.group/t/problem-retrieving-1-time-series-via-python-api/334)._
