# DBnomics API v22 released

**URL:** <https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204>\
**Category:** Community\
**Created:** [December 20, 2018, 5:36pm UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204 "2018-12-20T17:36:19Z")\
**Posts on this page:** 11\
**Page:** 1

<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:** [December 20, 2018, 5:36pm UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/1 "2018-12-20T17:36:19Z")

</div>

Dear DBnomics community,

We released today the next version (22) of the Web API, and the website ([https://db.nomics.world/](https://db.nomics.world/)) uses it.

In short, this new version allows “table” and “multi series charts” views in the dataset pages of the website ([example](https://db.nomics.world/AMECO/ZUTN/): click on the “Table” and “Chart” tabs.

Note that if you are a user of the website and don’t call the API, you’re not concerned by these changes.

But it you make calls to the API in your scripts or application, you’ll want to upgrade to version 22. The version 21 will remain available at least until version 23 is released, to avoid breaking your application.

Here are some links to help you with this upgrade:

- The new base URL is [https://api.db.nomics.world/v22/](https://api.db.nomics.world/v22/) and documentation is [here](https://api.db.nomics.world/v22/apidocs).
- The [changelog](https://git.nomics.world/dbnomics/dbnomics-api/blob/master/CHANGELOG.md#0216-2200) lists the differences from version 21 to 22.
- This [commit](https://git.nomics.world/dbnomics/dbnomics-python-client/commit/36be063682f08e129e6f101600ca2f5ac81f070a) on DBnomics Python shows the changes we did to port it from version 21 to 22.

Summary of URL changes (URL parameters are filled with examples):

```nohighlight
https://api.db.nomics.world/v21/series?provider_code=P1&dataset_code=D1&dimensions={"FREQ":["A"]}
https://api.db.nomics.world/v22/series/P1/D1?observations=1&dimensions={"FREQ":["A"]}

https://api.db.nomics.world/v21/series?provider_code=P1&dataset_code=D1&series_code_mask=A.FR+DE
https://api.db.nomics.world/v22/series/P1/D1/A.FR+DE?observations=1

https://api.db.nomics.world/v21/series?series_ids=P1/D1/S1,P1/D2/S3
https://api.db.nomics.world/v22/series?observations=1&series_ids=P1/D1/S1,P1/D2/S3

```

If you have any question, please answer to this message and we will try to help you the best we can.

Best regards and merry Christmas 🙂

---

<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:** [December 20, 2018, 5:38pm UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/2 "2018-12-20T17:38:32Z")

</div>

In particular I’m thinking to @acottrell, @jacklucchetti, @signorsignore and @webapperc.

---

<div class="post-metadata">

**Author:** ![acottrell](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@acottrell](https://dbnomics.discourse.group/u/acottrell)\
**Post date:** [December 24, 2018, 3:21pm UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/3 "2018-12-24T15:21:32Z")

</div>

Thanks! Gretl’s client code for v22 is now in testing – seems to work fine so far.

---

<div class="post-metadata">

**Author:** ![acottrell](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@acottrell](https://dbnomics.discourse.group/u/acottrell)\
**Post date:** [December 25, 2018, 6:37pm UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/4 "2018-12-25T18:37:42Z")

</div>

Having experimented a bit further I have two comments on the v22 APIs.

1. The new path `/datasets/{provider_code}` (“Respond datasets of a provider.”)

This could do with fuller documentation. The “limit” and “offset” parameters are  
not mentioned under apidocs/v22, and it’s perhaps surprising that the default  
limit is 10 (given that some providers have thousands of datasets).

1. The element “observations\_attributes” which appears under series.docs  
in some cases.

This element is represented as an array of arrays. For example under  
`IMF/CPI/Q.BE.PCPIT_IX` we have:

`"observations_attributes" : [["REFERENCE_PERIOD", "2013A"]]`

Making the inner element here an array suggests that “REFERENCE\_PERIOD”  
and “2013A” have the same logical status, but I guess it’s actually a matter of  
key plus value, in which case it would be more transparent to represent the  
inner element(s) as JSON object(s):

`"observations_attributes" : [{"REFERENCE_PERIOD" : "2013A"}]`

---

<div class="post-metadata">

**Author:** ![webapperc](https://avatars.discourse-cdn.com/v4/letter/w/47e85d/32.png) [@webapperc](https://dbnomics.discourse.group/u/webapperc)\
**Post date:** [January 13, 2019, 10:08am UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/5 "2019-01-13T10:08:31Z")

</div>

How can I request series values by id with v22 API without all dimension descriptions about data set returned in response? For example with v21:

```
https://api.db.nomics.world/v21/series?provider_code=OECD&dataset_code=KEI&series_code=SLRTCR03.AUS.ST.M&format=json&orientation=column

```

The response returns only with series values, with the short dataset field.  
Same series with v22:

```
https://api.db.nomics.world/v22/series?observations=1&series_ids=OECD/KEI/SLRTCR03.AUS.ST.M

```

The response returns with series values and all dimension descriptions about data sets in the datasets field: **dimensions\_codes\_order, dimensions\_labels, dimensions\_values\_labels**.

It seems not big deal, but it increases amount of unused traffic for big data sets in case of only values of series are interested.

Thanks in advance.

---

<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 16, 2019, 4:30pm UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/6 "2019-01-16T16:30:58Z")

</div>

Hi @acottrell

Thanks for your feedback!

You’re right, the API documentation was incomplete. We added the missing “limit” and “offset” parameters, in particular for `/datasets/{provider_code}`.

We also increased the default limit to 50, with a maximum of 500.

About “observations\_attributes”, it is implemented as a list to keep the order of the columns.

Thanks again for your contribution!

---

<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 16, 2019, 4:56pm UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/7 "2019-01-16T16:56:14Z")

</div>

Hi @webapperc

Thanks for your message!

Indeed, in the version 22 of the API we unified the fields that are returned. There is no way to select which fields to return.

I created an issue for that: [https://git.nomics.world/dbnomics-fetchers/management/issues/370](https://git.nomics.world/dbnomics-fetchers/management/issues/370)

I can’t tell you right now when we will do it, we must plan it before.

Thanks again!

---

<div class="post-metadata">

**Author:** ![webapperc](https://avatars.discourse-cdn.com/v4/letter/w/47e85d/32.png) [@webapperc](https://dbnomics.discourse.group/u/webapperc)\
**Post date:** [January 16, 2019, 8:50pm UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/8 "2019-01-16T20:50:21Z")

</div>

Hi @cbenz

Okay, I understand. It is not urgent.

Adapter for DBnomics API is updated to v22 in web app ERC (Economic RESTful Client).

Thanks.

---

<div class="post-metadata">

**Author:** ![Klaus](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Klaus](https://dbnomics.discourse.group/u/Klaus)\
**Post date:** [March 1, 2019, 3:01pm UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/9 "2019-03-01T15:01:58Z")

</div>

I want raise the subject again. With Api v22 a big bunch of meta data is transmitted which makes fetching data difficult.  
Thanks for going to change that with a new realease.

---

<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:** [March 4, 2019, 10:41am UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/10 "2019-03-04T10:41:06Z")

</div>

Hi @Klaus

due to the requests of the community we are going to reevaluate this feature with more priority.

Thanks for your feedback!

---

<div class="post-metadata">

**Author:** ![bruno.duye](https://yyz2.discourse-cdn.com/free1/user_avatar/dbnomics.discourse.group/bruno.duye/32/65_2.png) [@bruno.duye](https://dbnomics.discourse.group/u/bruno.duye)\
**Post date:** [March 7, 2019, 7:02pm UTC](https://dbnomics.discourse.group/t/dbnomics-api-v22-released/204/11 "2019-03-07T19:02:27Z")

</div>

Hi @Klaus, we added a `metadata` argument that can be set to false to disable metadata.

It is documented in API doc: [http://api.db.nomics.world/v22/apidocs](http://api.db.nomics.world/v22/apidocs)
