API for transliterating a traditional character (writing the pinyin)?
There are several libraries for converting Chinese characters to pinyin. If you are comfortable with programming languages (which you probably are if you are asking for an API), your choice will depend on the programming languages you know, the quality of the library and the licence under which it is available. If you need a user interface, you should probably first look at pinyin4j and ZDT. 


pinyin4net: C# library that supports both simplified and traditional Chinese characters. Output is hanyu pinyin. Licence: MIT. 
PinYin4Objc: Objective-C library (with some Ruby) that supports both simplified and traditional Chinese characters and most popular pinyin systems. Licence: Apache License 2.0.
HanziPinyin: Swift library that supports both simplified and traditional Chinese characters. Licence: MIT License. 
PiPinyin: Java library for Android for converting Chinese characters to pinyin. I assume it supports simplified characters but could not find out if it also supports traditional characters. (The older pinyin4android library, on which PiPinyin is based, appears to have no documentation.) Licence: Apache License 2.0.
pinyin4cpp: C++ library. Licence: Apache License 2.0. (Possibly inspired by pinyin4j, below.)
pinyin4j: Java library for conversion "between Chinese characters and most popular Pinyin systems". Can also ouput Wade-Giles, Yale and Gwoyeu Romatzyh! Licence: GPL v2.
Unihanconver: a Perl library "to convert between Traditional/Simplified Chinese directly in Unicode (not GB/Big5 conversion)". It can be used through a Gtk2+ Interface and from the console. (See also the developer site.) Licence: GPL 2. 
ZDT (Zhongwen Development Tool), written in Java, "is an easy to use, open-source Mandarin Chinese flashcard application that can help you learn Chinese". One of its features is conversion between Chinese charactes and pinyin. (Developer site.) Licence: Eclipse Public License. 
zh2tone / Chinese Word to ZuYin Code: a tool to convert Chinese characters/words to zhuyin fuhao (bopomofo). The tool has not been updated since 2012, has no licence, ... 


Notes: 


I have not checked the quality of these libraries (alpha/beta/production-ready, test coverage, etc.) nor their completeness (how many characters they support etc.). 
If you need such a library for professional use, I would steer clear of libraries that have no licence. Software available under Apache 2.0, MIT or BSD can be reused both in open source and commercial applications. Libraries available under a GPL licence ("GNU General Public Licence") can only be used in other GPL code.