Skip to content

Instantly share code, notes, and snippets.

@MrCyjaneK
Created July 24, 2021 16:41
Show Gist options
  • Save MrCyjaneK/736f93c9edd8310eac084b802017e184 to your computer and use it in GitHub Desktop.
Save MrCyjaneK/736f93c9edd8310eac084b802017e184 to your computer and use it in GitHub Desktop.
5sim.net get cheapest price
<?php
$prices = json_decode(file_get_contents("https://5sim.net/v1/guest/prices"));
$what = 'telegram';
$endprice = [];
foreach ($prices as $key => $value) {
if (!isset($value->$what)) continue;
$endprice[$key] = $value->$what;
}
$min = 9999;
foreach ($endprice as $key => $v) {
foreach ($v as $k => $value) {
if ($value->count < 50) continue;
if ($value->cost < $min) {
$min = $value->cost;
echo "New best: ".$key." - ".$min."\n";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment