The following is a number of interesting / useful solutions to problems, or recipes, written in Moya code.

Get the price of Bitcoin

The following one liner will retrieve the current price of Bitcoin (in USD) from


How does this work? Well, the URL contains a JSON object with the current Bitcoin prices. The get: modifier reads that request from the internet, and the fromjson: modifier converts the text in to a dictionary with a number of values. Finally the index operator ['ask'] looks up the value of 'ask' which is the current asking price.

NOTE This recipe depends on the the bitstamp api. We can't guarantee that will still be working, but we would be surprised if isn't.