Hello all
I am trying to extract data from the UN Comtrade database using their API (https://comtrade.un.org/data/doc/api/). However I consistently get an error message stating that the file was not found- which is strange considering the API call by itself seems to be working fine (when used in a browser for example). The code and error message are given below. I am aware of an existing thread on the same issue, but the matter does not seem to have been resolved there- I am trying to apply wbuchanan's advice to use jsonio by reading up on the documentation of the package and understand how it works. But if anyone has a simpler solution or any idea of what could be causing this issue, needless to say I would appreciate your input.
Attempt to extract using jsonio in JSON format
Any thoughts on why could a command give a 'Break' return without my explicit instruction?
I am trying to extract data from the UN Comtrade database using their API (https://comtrade.un.org/data/doc/api/). However I consistently get an error message stating that the file was not found- which is strange considering the API call by itself seems to be working fine (when used in a browser for example). The code and error message are given below. I am aware of an existing thread on the same issue, but the matter does not seem to have been resolved there- I am trying to apply wbuchanan's advice to use jsonio by reading up on the documentation of the package and understand how it works. But if anyone has a simpler solution or any idea of what could be causing this issue, needless to say I would appreciate your input.
Code:
import delimited "http://comtrade.un.org/api/get?r=all&freq=A&ps=all&px=H1&p=all&rg=2&cc=AG4&fmt=csv"
Code:
file http://comtrade.un.org/api/get?r=all&freq=A&ps=all&px=H1&p=all&rg=2&cc=AG4&fm t=csv not found server says file temporarily redirected to https://comtrade.un.org/api/get?r=all&freq=a&ps=all&px=h1&p=all&rg=2&cc=ag4&fm t=csv could not open url r(603);
Code:
jsonio kv, file("http://comtrade.un.org/api/get?r=all&freq=A&ps=all&px=H1&p=all&rg=2&cc=AG4&fmt=csv")
Code:
--Break-- r(1);
Comment