During the development of one Market Information System, the client requested to have an ability to have a currency conversion functionality on their web application. The client specifically requested that the exchange rates be sourced from the Central Bank of Kenya. This thus ruled out using many of the free exchange rate providers that currently exist, since none explicitly states that they get their rates from the Central Bank of Kenya. Unfortunately the Central Bank of Kenya website provides no efficient way to download or access the exchange rates as they are just displayed in a table.


I did a bit of research and found an excellent article written by Jacob Ward on web scrapping with PHP and Curl. Using the examples and logic I was able to build a simple scrapping function that would extract the exchange rates from the Central Bank website. After examining the url structure of the Central Bank I was able to pull data dating back to 2005. I then created a cron job that ran the script everyday updating the exchange rates on the clients database. Problem solved.


I then realized I could extract data that could be useful to other developers especially those who are dealing with foreign currency where the Kenya Shilling was the base currency. I decided to build a simple JSON API that could be freely accessed and could give developers access to daily and historical exchange rates.

This web application was developed using the slim framework which is an awesome micro framework along with RedBean an easy to use ORM. The rates are extracted daily from the Central Bank website and are stored on the application's database.

The API service requires users to register and receive an API key via their email address. The service is rate limited at 1000 requests monthly. The API allows querying of daily and historical rates dating back to 2005. There are currently exchange rates for over 21 currencies and this includes both the buying and selling rates in comparison to the Kenya Shilling. Head over to to see the usage details. Currently that is all there is to it, in case you have ideas or suggestions to share to improve this service please let me know.