Languages

SitemapKit + Go

Use SitemapKit in Go applications with the standard net/http package. Great for high-performance sitemap processing pipelines.

Written by SitemapKit Editorial TeamUpdated: Jul 21, 2026

Prerequisites

  • A SitemapKit API key kept outside browser and mobile client bundles.
  • A server-side Go environment that can make HTTPS requests and parse JSON responses.

How to connect SitemapKit and Go

  1. 1

    Store the API key for Go

    Use the secret or environment-variable mechanism provided by your languages setup. Never expose the key in client-side code.

  2. 2

    Call the SitemapKit full endpoint

    Adapt the request shown in the Go example below and send the target domain from a trusted server process.

  3. 3

    Map the response in Go

    Handle discovered sitemap files, extracted URLs, lastmod values, truncation flags, and API errors before passing the result downstream.

Quick start

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
)

type SitemapURL struct {
    Loc     string `json:"loc"`
    Lastmod string `json:"lastmod,omitempty"`
}

type FullResponse struct {
    Sitemaps []string     `json:"sitemaps"`
    URLs     []SitemapURL `json:"urls"`
}

func main() {
    body, _ := json.Marshal(map[string]string{"url": "example.com"})
    req, _ := http.NewRequest("POST",
        "https://sitemapkit.com/api/v1/sitemap/full",
        bytes.NewBuffer(body))
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("x-api-key", "YOUR_API_KEY")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()

    var data FullResponse
    json.NewDecoder(resp.Body).Decode(&data)
    fmt.Printf("Found %d sitemaps, %d URLs\n", len(data.Sitemaps), len(data.URLs))
}

Continue with SitemapKit

Start using SitemapKit with Go

100 free API calls/month. No credit card required.

More Languages integrations