import json


def parse_prices(raw):
    """
    Parse raw response from coinmarketcap API.

    Example body:
    {
        "status": {
            "timestamp": "2019-02-08T12:56:52.772Z",
            "error_code": 0,
            "error_message": null,
            "elapsed": 7,
            "credit_count": 1
        },
        "data": [
            {
                "id": 1,
                "name": "Bitcoin",
                "symbol": "BTC",
                "slug": "bitcoin",
                "circulating_supply": 17526900,
                "total_supply": 17526900,
                "max_supply": 21000000,
                "date_added": "2013-04-28T00:00:00.000Z",
                "num_market_pairs": 6600,
                "tags": [
                    "mineable"
                ],
                "platform": null,
                "cmc_rank": 1,
                "last_updated": "2019-02-08T12:56:26.000Z",
                "quote": {
                    "USD": {
                        "price": 3453.29201346,
                        "volume_24h": 5513059982.85242,
                        "percent_change_1h": 0.145325,
                        "percent_change_24h": 1.11952,
                        "percent_change_7d": -0.43863,
                        "market_cap": 60525503790.712074,
                        "last_updated": "2019-02-08T12:56:26.000Z"
                    }
                }
            }
        ]
    }

    Example return:
    [('BTC', 3450.22714956), ('XRP', 0.298489261075), ... ,('ETH', 108.606675153)]

    :param raw: response body
    :return: list of symbols with prices
    """
    prices = []
    payload = json.loads(raw)

    for item in payload.get('data', {}):
        prices.append((item['symbol'], item['quote']['USD']['price']))

    return prices