Is there an API for price estimation? I need to display at my website what a certain amount of Bitcoins will likely cost. I can fetch the latest price using the MtGox API and multiply it by the amount, but for large amounts this is inaccurate because the buy itself will move the price. The only other option seems to fetch the whole orderbook, and calculate it myself each time, but isn't there an API for this?
while amount &gt; 0:
        amount_i = int(mtgox_depth['bids'][index]['amount_int'])
        price_i = int(mtgox_depth['bids'][index]['price_int'])
        if amount_i &lt; amount:
            total_value += amount_i * price_i
            amount -= amount_i
        elif amount_i &gt;= amount:
            total_value += amount * price_i
            amount = 0
        index -= 1
    spot = int(total_value / float(total_amount))
    return spot


Something like this, where mtgox_depth is a json object of https://mtgox.com/api/1/BTCUSD/depth?raw, should work for you.