光緒三年（1877年）隨何如璋東渡出使日本。在任期間，就琉球問題同日本積極交涉。後來佢去美國、英國、星加坡等地擔任外交官。駐外期間，佢留心觀察所在國嘅事物，認為中國要革新自強，必須效法日本維新變法。佢撰寫《日本國志》，全書共四十卷，五十幾萬字，詳細論述日本變革嘅經過及其得失，藉此提出改革中國嘅主張。
In the third year of Guangxu (1877), he went east with He Ruzhang to Japan. During his tenure, he actively negotiated with Japan on the Ryukyu issue. Later, he went to United States, United Kingdom, Singapore and other places to work as a diplomat. During his stay abroad, he paid close attention to the affairs of his host country and believed that if China wanted to reform and strengthen itself, it must follow Japan's reform and reform methods. He wrote the "National Records of Japan," a book of 40 volumes and more than 500,000 characters, which discussed in detail the process of Japan's reform and its gains and losses, and put forward the idea of reforming China.