2015年5月14日木曜日

How to get an appId at e-stat.go.jp

Disclaimer

I do not guarantee the correctness or completeness of material on this article though I took some reasonable steps when translating legal information in Japanese into English.

e-Stat API available since last October

When you are working with Japanese statistics in English, you will confront with some readability problems. You may be at a loss with Excel format files or CSV files with lots of descriptions beside the data. They are definitely necessary, but it is a tiresome work to remove those headers, or set extents to be readable by scripts. They may become causes of errorous analyses when you treat them with a tabular software.
It was a great news that the Statistics Bureau of Japan (SBJ) has released the API at October 31st 2014. (API top page here.)  Unfortunately, they are only in Japanese language at the moment. You have to register to acquire Application ID, in Japanese. Since they have released a 'News Bulletin' at July 30th 2013 in English, I assume some people have been looking forward to the use of the API.
I guess anyone can use the API at the moment now, as long as I read the terms of service in Japanese. The terms of service is also in Japanese. It means you must read in Japanese and decide to take it on your own. Just for your convenience, here are what I think as important in the terms of service:
  • The User must not lend the API key to the third person. (article 3.2)
  • The User must notify the statement here (in Japanese) to the public if you make your API open to the public. (article 7) Here is my translation (please use it for your understanding only):
    • This service uses the API at e-Stat, the Portal Site of Official Statistics of Japan, though the contents of the service is not guaranteed by the Government.
  • The Government disclaims all liability or responsibility. (article 10)
  • The Government does not compensate any losses. (article 11)
  • Applicable laws is Japanese. Court of Jurisdiction is Tokyo. (article 14)
  • The User shall be deemed to take registration procedure and contact in Japanese. (article 15)

How to get the Application ID (appId)

There are five steps to go.  You have to (1) register your e-mail address, (2) get subscription e-mail, (3) register, (4) log-in, and (5) issue AppIDs (up to three IDs).

(1) Filling the interim registration form

You can register your e-mail address in the interim registeration page. The interim registration page is like below:
Fig.1. Screenshot at https://www.e-stat.go.jp/api/apiuser/provisional/.

(2) Receiving interim registration e-mail

Soon you will get an e-mail titled "政府統計の総合窓口(e-Stat)-API機能 利用登録(本登録)のご案内" in Japanese from "no-reply" account. You will see "(e-Stat)-API" in the title. There must be a URL with https header, like "https://www.e-stat.go.jp/api...". The expire time of the e-mail is one day.

(3) Filling the registration form

Following the link leads to the registration page. You have to fill most of the form to register. I have not made an contact on how to fill them if you live abroad, but I assume you can fill it with the state(, region, or province) and nation you live in. I have modified workplace and department(or branch) to "two-byte blank character" after registration, but it seems OK.
Fig. 2. Screenshot at the registration page.

The form is in the order:
  • e-mail address
  • password: 32 letters or less, in grep style: [0-9a-zA-Z\-\.@_]
  • password confirmation
  • name: 50 letters or less
  • workplace(or school): 100 letters or less
  • division(or faculty): 100 letters or less
  • purpose of use: (from the top) business, researches, use at public institutions, personal, others
  • address(prefecture)
  • age
If you agree to the terms of service(link) and still want to register, push the orange button to go.

(4) Logging in

If you took the step above, then you should be logged in when you push the orange button "利用規約に同意して登録する(agree and register)". Next time, you can use the log-in page (link), or choose "ログイン(log in)" menu from the top page (link) .
Fig.3. Screenshot at e-Stat API top page.

(5) Issuing appId

After logging-in, the browser should show the registration/appid page.
(https://www.e-stat.go.jp/api/apiuser/appid_regist/)
The tab "アプリケーションIDの取得(Taking out appId)" is where can issue appId.
Fig. 4. Screenshot and description for issuing appId.
 The step here is:
  1. Choose "アプリケーションIDの取得(Taking out appId)" tab.
  2. Input the name that appId is going to be implemented.
  3. Set URL of the application. If you are not going to make it open, you can input "http://localhost".
  4. Write some descriptions.
  5. Push "発行(Issue)" button.
  6. Copy the appId in the inputbox. (In Fig. 4, it is masked.)
  7. Log out.
Now you have the appId in your hand.  There are some great blogs/webpages on how to use it. However, they are in Japanese.  I am going to write other articles on this topic myself, in some days.

0 件のコメント:

コメントを投稿

コメントありがとうございます。お返事にはお時間いただくかもしれません。気長にお待ちいただけると幸いです。