The XML tag inside a sitemap that specifies the URL of a page.
The `<loc>` element is the only required child of a `<url>` entry in an XML sitemap. It contains the full, absolute URL of a page on the website. The URL must include the protocol (http or https) and must be properly encoded.
Special characters like ampersands (`&`), quotes, and angle brackets must be XML-escaped. For example, `&` becomes `&`. URLs should be under 2,048 characters.
SitemapKit's extract endpoint parses the `<loc>` tag from every URL entry and returns it in the structured JSON response.
<url>
<loc>https://example.com/products/widget-a?ref=home&color=blue</loc>
</url>SitemapKit's API lets you discover, extract, and parse XML sitemaps from any domain. Get structured JSON data with all sitemap elements including loc.