# API for Gretl

**URL:** <https://dbnomics.discourse.group/t/api-for-gretl/130>\
**Category:** Data Issues\
**Created:** [January 18, 2018, 12:37pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130 "2018-01-18T12:37:33Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrd](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@mrd](https://dbnomics.discourse.group/u/mrd)\
**Post date:** [January 18, 2018, 12:37pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/1 "2018-01-18T12:37:33Z")

</div>

Hi everyone,  
Has anybody tried to access db.nomics data from gretl or knows how to do?  
Cheers,  
Martin

---

<div class="post-metadata">

**Author:** ![svens](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@svens](https://dbnomics.discourse.group/u/svens)\
**Post date:** [January 21, 2018, 8:40am UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/2 "2018-01-21T08:40:46Z")

</div>

Hi, as it happens, I’ve heard it’s in the making… (on the gretl side).  
Have you tried using the csv format in the meantime? (Honest question, haven’t done it myself.)

---

<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:** [January 21, 2018, 7:33pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/3 "2018-01-21T19:33:37Z")

</div>

Yep, we’re working on it!

---

<div class="post-metadata">

**Author:** ![thomasbrand](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@thomasbrand](https://dbnomics.discourse.group/u/thomasbrand)\
**Post date:** [February 6, 2018, 1:18pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/4 "2018-02-06T13:18:12Z")

</div>

Hi!  
Just to keep you informed that we push a new version of the python client for DBnomics, with more features : [https://git.nomics.world/dbnomics/dbnomics-python-client/tree/master](https://git.nomics.world/dbnomics/dbnomics-python-client/tree/master). I hope it can help. We are currently adapting the R client.

---

<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:** [June 30, 2018, 3:25pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/5 "2018-06-30T15:25:03Z")

</div>

Hello again,

We (gretl team) now have a quite functional prototype dbnomics interface in testing (using the new API). But I have a question. I notice that the API has changed quite substantially within the last 24 hours, including renaming of certain key JSON fields (“value” -\> “values”, “period” -\> “periods”, “categories\_tree” -\> “category\_tree”, etc.) and revised URLs (“datasets” -\> “search”). Is there an automated way of getting notification when such changes are made? Or if not, is there a recommended way of ensuring that we keep up to date? Thanks.

---

<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:** [July 2, 2018, 1:14pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/6 "2018-07-02T13:14:23Z")

</div>

Hello Gretl,

Thanks for your interest in DBnomics.

> Is there an automated way of getting notification when such changes are made? Or if not, is there a recommended way of ensuring that we keep up to date? Thanks.

First, the API follows sermantic versioning policy ([https://semver.org/](https://semver.org/)). Before version 1.0, all 0.X versions  
introduce breaking changes. So 0.20.0 to 0.20.1 doesn’t implies any changes on your side, but 0.20 to 0.21 does.  
Until the API reaches version 1.0, it is considered a beta version. It is quite stable now, and that the kind of changes you’re talking about are not willing to occur anymore in the near future.

We plan to add version numbers directly to the URL, allowing supporting many versions of the API in parallel. Clients like Gretl will be able to continue using an older version while transitioning to the new one. Cf [this issue](https://git.nomics.world/dbnomics-fetchers/management/issues/200).

We will introduce a changelog in the dbnomics-api repository when the next version introducing breaking changes will be released (this is not planned for now).

There is currently no automated way to get notifications of dbnomics-api updates. We use Git tags (see [this page](https://git.nomics.world/dbnomics/dbnomics-api/tags)) to track the releases of dbnomics-api. Apparently GitLab doesn’t allow to subscribe to tags yet, sadly. We could post a topic on DBnomics forum for each release of the API. Would that be useful for you?

Please note that we intend to ship the 1.0 version in the near future, after [this milestone](https://git.nomics.world/dbnomics-fetchers/management/milestones/6) is completed.

Thanks again for your interest in DBnomics!

---

<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:** [July 2, 2018, 1:45pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/7 "2018-07-02T13:45:18Z")

</div>

Thanks, that’s all very clear. I think it would be helpful if you could post a topic on the forum for each API release.

---

<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:** [July 4, 2018, 4:56pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/8 "2018-07-04T16:56:36Z")

</div>

Hi @acottrell

I had an afterthought about your message and felt it would be useful to comment some changes:

- “categories\_tree” -\> “category\_tree”: this is a pure English language fix which was reported by an American native user
- “value” -\> “values” and “period” -\> “periods”: this was a mistake, and I switched back to singular spellings. All JSON fields are singular in series returned by `/series` API endpoint.

Sorry for inconvenience, again.

---

<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:** [July 4, 2018, 7:51pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/9 "2018-07-04T19:51:54Z")

</div>

Thanks again. It’s true, “category\_tree” reads better to a native English speaker.

On reverting to the singular for “value” and “period”: fine; we’re currently equipped to search for both singular and plural but it will be helpful to scrub that complication.

---

<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:** [July 4, 2018, 9:17pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/10 "2018-07-04T21:17:52Z")

</div>

I just want to say: we really appreciate your work at DB.NOMICS, this is a fantastic resource in the making!

Anyway, I’m exploring the full tree of providers’ datasets as accessed via our new gretl code and I’ve come across a couple of anomalies (or so it seems to me), namely the providers DREES and ONS. Our working assumption is that if we look for datasets under a provider’s category\_tree we should find an equal number of “code” and “name” elements, either under “children” (if the provider groups its datasets into named categories) or just under the “category\_tree” itself. This works for all the currently listed providers except for DREES and ONS.

DREES: has 10 “code” entries but only 8 of them have a corresponding “name”.

ONS: the JSON tree looks weird, with multiple levels of “children” – is this supposed to be OK?

---

<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:** [July 11, 2018, 8:42pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/11 "2018-07-11T20:42:21Z")

</div>

On closer examination, while the results for DREES and ONS are both somewhat strange, they don’t seem to be formally erroneous. Our gretl client is now able to handle them.

You might want to take a look at these cases, but this does not have the status of a bug report.

---

<div class="post-metadata">

**Author:** ![jacklucchetti](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@jacklucchetti](https://dbnomics.discourse.group/u/jacklucchetti)\
**Post date:** [August 12, 2018, 8:23am UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/12 "2018-08-12T08:23:33Z")

</div>

The new version of gretl (2018b, released on 10/8) contains a native interface to dbnomics.

I recorded an instructional video to show its most salient features: [https://youtu.be/B2KmX9A6ICg](https://youtu.be/B2KmX9A6ICg)

Comments welcome!

---

<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:** [August 20, 2018, 4:36pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/13 "2018-08-20T16:36:43Z")

</div>

Hi @acottrell

thanks for your feedback. You’re right, it’s not bugs, but for the record I wanted to answer more precisely:

> [@acottrell](#):
>
> DREES: has 10 “code” entries but only 8 of them have a corresponding “name”.

This is OK, our data model requires only `code` to be defined for datasets (see [here](https://git.nomics.world/dbnomics/dbnomics-data-model/blob/e9092d9946303c6ee0bfc550ce0486278d91b68e/dbnomics_data_model/schemas/v0.8/category_tree.json#L65) for technical source). Sometimes the fetchers can’t extract the name of the dataset programmatically, or sometimes the developer of the fetcher did not managed to do it. If it is possible, we could enhance the fetcher, or accept a pull-request in that sense.

> [@acottrell](#):
>
> ONS: the JSON tree looks weird, with multiple levels of “children” – is this supposed to be OK?

Yes, because the category tree can be defined with arbitrary levels of depth. DBnomics aims to reproduce the category tree of the provider, as presented on the original website/database.

Thanks for making the video, we’re glad to see DBnomics in action 🙂

---

<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:** [August 21, 2018, 7:38pm UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/14 "2018-08-21T19:38:14Z")

</div>

Jack Lucchetti is the one to thank for the video. It’s a nice showcase for both DBnomics and gretl, I think.

---

<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:** [October 19, 2018, 8:37am UTC](https://dbnomics.discourse.group/t/api-for-gretl/130/15 "2018-10-19T08:37:40Z")

</div>

Hi @jacklucchetti and @acottrell,

I just wanted to inform you that we updated the DBnomics web-site to add a link to Gretl in the footer.
