Skip to content
Utilerio
All endpoints

Hreflang Tag Generator

POST/api/v1/tools/hreflang-generator

Generate reciprocal hreflang link tags for a page's translations, with an optional x-default.

Authentication

Requires an API key in the X-API-Key header.

Try it

POST/api/v1/tools/hreflang-generator

Parameters

entriesstringrequired

Locale/URL pairs (array): [{ locale, url }].

xDefaultUrlstringoptional

URL for the x-default fallback tag.

Request body

{
  "entries": [
    {
      "locale": "en",
      "url": "https://example.com/en/page"
    },
    {
      "locale": "tr",
      "url": "https://example.com/tr/sayfa"
    }
  ],
  "xDefaultUrl": "https://example.com/en/page"
}

Response codes

  • 200Success.
  • 400Invalid request — check your body or parameters.
  • 401Missing or invalid API key.
  • 403The API key is not scoped to this endpoint.
  • 429Rate limit exceeded — retry after a short wait.

Language

cURL

Request

curl -X POST https://utilerio.com/api/v1/tools/hreflang-generator \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"entries":[{"locale":"en","url":"https://example.com/en/page"},{"locale":"tr","url":"https://example.com/tr/sayfa"}],"xDefaultUrl":"https://example.com/en/page"}'

Response

{ "html": "<link rel=\"alternate\" hreflang=\"en\" href=\"https://example.com/en/page\" />\n..." }