Call the SitemapKit API from PHP using cURL. Ideal for WordPress plugins, Laravel applications, and PHP-based SEO tools.
<?php
$apiKey = 'YOUR_API_KEY';
$ch = curl_init('https://sitemapkit.com/api/v1/sitemap/full');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
"x-api-key: $apiKey",
],
CURLOPT_POSTFIELDS => json_encode(['url' => 'example.com']),
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "Found " . count($data['sitemaps']) . " sitemaps\n";
echo "Extracted " . count($data['urls']) . " URLs\n";
// Filter blog posts
$blogUrls = array_filter($data['urls'], function($u) {
return strpos($u['loc'], '/blog/') !== false;
});sk_live_* API key./api/v1/sitemap/full endpoint to discover and extract all sitemaps from a domain in one call.POST /api/v1/sitemap/discover — Find all sitemaps on a domainPOST /api/v1/sitemap/extract — Parse a sitemap URL and extract all URLsPOST /api/v1/sitemap/full — Discover + extract in one call (recommended)100 free API calls/month. No credit card required.