PHP Matka API — cron + cURL with Bearer key | Satta Matka API
PHP talks to Satta Matka API the same way as cURL: one GET, one Bearer header, JSON back. No PHP kit upload. Replace YOUR_API_KEY with the sm_ key from the dashboard.
Do not put sm_ keys in the URL
Wrong: https://sattamatkaapi.live/api/results/board?key=sm_…. Query-string keys land in access logs, proxies, and Referer headers. New sm_ keys accept Bearer or X-API-Key only. Older mk_ keys still accept ?key=.
cURL with Bearer
Save as fetch-board.php and run php fetch-board.php.
<?php
$ch = curl_init('https://sattamatkaapi.live/api/results/board');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
'Accept: application/json',
],
]);
$response = curl_exec($ch);
if ($response === false) {
fwrite(STDERR, curl_error($ch) . PHP_EOL);
curl_close($ch);
exit(1);
}
curl_close($ch);
$board = json_decode($response, true);
foreach ($board['data'] ?? [] as $row) {
echo $row['market'] . ' '
. ($row['openPana'] ?? '***') . '-'
. ($row['jodi'] ?? '**') . '-'
. ($row['closePana'] ?? '***')
. PHP_EOL;
}Cron every 30 seconds
crontab cannot fire twice in one minute with a single line. Use two lines, or a small loop.
# crontab -e (runs fetch-board.php twice a minute)
* * * * * /usr/bin/php /var/www/html/fetch-board.php
* * * * * sleep 30; /usr/bin/php /var/www/html/fetch-board.php<?php
// Optional long-running loop instead of two crontab lines
while (true) {
passthru('php /var/www/html/fetch-board.php');
sleep(30);
}Laravel HTTP client
Store the key as SM_API_KEY in .env. Same header, same JSON.
<?php
use Illuminate\Support\Facades\Http;
$board = Http::withToken(env('SM_API_KEY'))
->acceptJson()
->get('https://sattamatkaapi.live/api/results/board')
->throw()
->json();
foreach ($board['data'] ?? [] as $row) {
// $row['openPana'], $row['jodi'], $row['closePana'], $row['status']
}Frequently asked questions
- Where does the PHP key go?
- In the Authorization header as Bearer YOUR_API_KEY, or as X-API-Key. Do not put new sm_ keys in the URL as ?key=.
- How often should cron hit the board?
- Every 30 seconds is enough for a live board. The JSON already skips leftover completes, so you do not need to scrape HTML.
Need push instead of cron? See webhooks. Plans are on pricing.