Call the SitemapKit API from PHP using cURL. Ideal for WordPress plugins, Laravel applications, and PHP-based SEO tools.
Use the secret or environment-variable mechanism provided by your languages setup. Never expose the key in client-side code.
Adapt the request shown in the PHP example below and send the target domain from a trusted server process.
Handle discovered sitemap files, extracted URLs, lastmod values, truncation flags, and API errors before passing the result downstream.
<?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;
});Check authentication, endpoints, response fields, and limits.
Preview the URL extraction result before writing integration code.
See how teams use sitemap data in SEO and engineering workflows.
Look up lastmod, sitemap indexes, and other response concepts.
100 free API calls/month. No credit card required.
Use the SitemapKit API with Python's requests library to discover and extract sitemaps. Perfect for SEO scripts, data pipelines, and AI training data collection.
Integrate SitemapKit into your Node.js applications or serverless functions. Use fetch or axios to call the API and process sitemap data in your JavaScript projects.
Use SitemapKit with full TypeScript type safety. Define response types for sitemap data and integrate into your typed codebases.