About the Stata plugin


thank you for writing this stata plugin! I would like to use it, but run into the following error under any dbnomics command I try (e.g. dbnomics news):
Downloading recently added datasets…
Kernel panic. Abort

r(5100) signals a probelm with a Java runtime exception. However, I could not trace the problem using ‘set debug on’ and ‘set trace on’ to find a solution by myself (if needed, I can post the debug output, but it is just a quote from the ado file).

I have stata version 14.1 and installed libjson, moss and dbnomics from the ssc library.
My OS is Windows 10 (my colleague uses a macbook and does not have this problem)

Thanks for any hints!



Hi all,
Agreed that the Stata plugin is a welcomed addition! For the most part it appears to be working, but I have run into a particular issue when attempting to import a complete World Bank dataset, specifically the GDP per capita data:

dbnomics import, provider(WB) dataset(WDI) indicator(NY.GDP.PCAP.KD) clear

For some reason it returns the error r(679) which I believe indicates some sort of web error. To be clear, I’m able to successfully import the data when I specify a specific country, but not the entire indictor. Any thoughts and/or suggestions would be greatly appreciated!


Hey Christoph, thanks a lot for using my command!

I often face the same issue, and in my case this is due to my Institution’s proxy. The problem seems to lie in the fact that the proxy uses a proprietary https certificate that is not recognised by the java https library used by Stata to connect to secure sites. Not sure this is the same issue that is affecting you, but here are a couple of solutions that worked for me.

One possibility could be to add the certificate to the Stata java path. To identify the certificate, open a mock page on the dbnomics website (e.g. https://api.db.nomics.world/v21/providers), see what secure certificate the browser is using and export it. You might need to convert the exported certificate to a .pem certificate file (or not).

Follow the procedure below to install the certificate (sent to me by the Stata tech support team):

We need to copy the certificate file to the “lib\security” folder in your Java directory found under the official Stata installation folder. For the instructions below I will use the fake certificate file name “fakecert.cer”, you will need to perform the steps and substitute the correct cert file name. On Windows you will need to have Administrator access to perform these tasks.

Note that on Windows there are two Java directories windows-i586 and windows-x64.
If you are using 64bit Stata choose the windows-x64 directory, otherwise choose the windows-i586 directory for 32-bit Stata. You can type:


in Stata to determine whether you are running 64 or 32 bit. The example below assumes you are on a 64-bit Stata 14. The java folder will look like:

C:\Program Files (x86)\Stata14\utilities\java\windows-x64\jre1.8.0_121\lib\security

Copy the “fakecert.cer” file in this directory. To import the certificate we will need to open a command terminal and run it as administrator. On a Windows 10 machine you can type:


into the search bar next to the Windows start button. Next right click on the best match and select “run as administrator”. Now navigate the directory where you copied the certificate file. On Windows the command you type in the terminal should be:

cd C:\Program Files (x86)\Stata14\utilities\java\windows-x64\jre1.8.0_121\lib\security

We can now execute the following command to register the certificate:

"C:\Program Files (x86)\Stata14\utilities\java\windows-x64\jre1.8.0_121\bin\keytool" -keystore cacerts -importcert -file "fakecert.cer"

It will ask you for a password which by default is: changeit

Then you will need to type: yes to the prompt below

Trust this certificate? [no]:

Finally close Stata, launch a fresh copy and test it with an HTTPS link.

Second option, and if you are comfortable with the lost secure connection, I could advise to change the main API endpoint in my ado-file. Replace the URL in line 42 with the following: http://api.db.nomics.world/v21. It should now work with or without your institution’s proxy (at the cost of the lack of secure data transfer).

Hope this helps.



Hi there, thanks a lot for using my command!

This is a very interesting issue. I also obtain an http error (r(675)) when running your query.

I am afraid the error might be on the server side, because if you type the underlying API call that is generated by my command (API call) I get a “502 bad gateway error”.

Interestingly, if I run the same query with version 22 of the API, the server returns the correct payload: v22 API call. So you should not expect this issue to be sorted out, because it only affects a legacy version of the API.

A new version of my command, compatible with v22 of the dbnomics API, is definitely due. Unfortunately, due to time constrains on my side, I won’t be able to push this before early next year.

As a short-term solution, you can use the v22 API and the option format to import this query directly in stata using import delimited:

import delimited using "http://api.db.nomics.world/v22/series/WB/WDI?dimensions=%7B%22indicator%22:%5B%22NY.GDP.PCAP.KD%22%5D%7D&limit=500&offset=0&&format=csv", clear varnames(1) encoding(utf-8).



Hi all!

Apologies again for the long silence, I wanted to give you some quick feedback regarding my presentation of the DBnomics platform and the dbnomics stata plugin at the London Stata Conference last September.

The presentation went quite well, I had good feedback on my plugin and in general the audience seemed very interested in the platform, which is great. The command and the platforms were featured in a recent newsletter from Stata, which is also great!

As next steps, I definitely wish to update the command to the v22 of the API. At the same time I will start writing a technical article about the routine that I will then submit to the Stata Journal. Should the article be published, it would be a nice way to increase the outreach of both command and platform. Unfortunately I do not have much spare time right now, so the earliest I expect to progress on this is early 2020.