It is possible with the following code:
<?php
$url = "http://steamcommunity.com/market/priceoverview/?currency=1&appid=730&market_hash_name=M249%20|%20Contrast%20Spray%20(Field-Tested)";
$json = file_get_contents($url);
$decode = json_decode($json, TRUE);
$preco_medio = $decode['median_price'];
?>
In other words, we access the URL with file_get_contents
and decode JSON, which will become an array . So, we assign the value of the array corresponding to the average price to the variable you want:)
PS: Through print_r
you can view the array generated from JSON to get the correct value to use in the brackets
print_r ($decode);