AY Rank Hreflang API

Check a page's hreflang set and whether its alternates link back.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 2

GET /api/v1/hreflang-checker Check a page's hreflang tags #
POST /api/v1/hreflang-checker Check a page's hreflang tags #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ayrank-com:ayrank-com-hreflang-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

ayrank-com-hreflang-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: AY Rank Free Tools Hreflang API
  version: 1.0.0
  summary: Free JSON API for AY Rank SEO and GEO tools.
  description: 'Public JSON versions of the free tools at https://www.ayrank.com/tools. Every endpoint takes GET with query parameters or POST with a JSON body (max 32768 bytes). Free, no key. Rate limit: 30 requests per 60 seconds per IP, shared across all /api/v1 tools. Each success response includes a poweredBy link back to the tool page.'
  termsOfService: https://www.ayrank.com/terms
  contact:
    name: AY Rank
    url: https://www.ayrank.com
servers:
- url: https://www.ayrank.com
tags:
- name: Hreflang
  description: Check a page's hreflang set and whether its alternates link back.
paths:
  /api/v1/hreflang-checker:
    get:
      tags:
      - Hreflang
      summary: Check a page's hreflang tags
      description: 'Reads the hreflang set of one page from the link rel="alternate" hreflang tags in its HTML head and from the HTTP Link header (sitemap hreflang is not read), and checks it against Google''s "Tell Google about localized versions of your page": ISO 639-1 language, optional ISO 15924 script and ISO 3166-1 alpha-2 region, case-insensitive; no region alone; reserved regions like UK, EU and UN; a self-reference; x-default (a warning when missing); one URL per value; fully qualified URLs; tags inside head. It then reads up to 10 alternate URLs, 4 at a time, and reports each one''s status, whether it links back to the page and whether its canonical points to itself. Caps: 2 MB read per page, 6 s per request, 20 s per call, 5 redirects. JavaScript is not run. Public http(s) URLs on ports 80 and 443 only; a blocked or invalid URL returns 400. A page that answers 4xx or 5xx returns 200 with status set and report null. Free, no key. Rate limit: 30 requests per 60 seconds per IP, shared across all /api/v1 tools.'
      externalDocs:
        description: Use the tool in a browser
        url: https://www.ayrank.com/tools/hreflang-checker
      operationId: hreflangCheckerGet
      parameters:
      - name: url
        in: query
        required: true
        description: The page to check, like https://example.com/page.
        schema:
          type: string
      responses:
        '200':
          description: Result
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HreflangCheckerResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '429':
          $ref: '#/components/responses/RateLimited'
    post:
      tags:
      - Hreflang
      summary: Check a page's hreflang tags
      description: 'Reads the hreflang set of one page from the link rel="alternate" hreflang tags in its HTML head and from the HTTP Link header (sitemap hreflang is not read), and checks it against Google''s "Tell Google about localized versions of your page": ISO 639-1 language, optional ISO 15924 script and ISO 3166-1 alpha-2 region, case-insensitive; no region alone; reserved regions like UK, EU and UN; a self-reference; x-default (a warning when missing); one URL per value; fully qualified URLs; tags inside head. It then reads up to 10 alternate URLs, 4 at a time, and reports each one''s status, whether it links back to the page and whether its canonical points to itself. Caps: 2 MB read per page, 6 s per request, 20 s per call, 5 redirects. JavaScript is not run. Public http(s) URLs on ports 80 and 443 only; a blocked or invalid URL returns 400. A page that answers 4xx or 5xx returns 200 with status set and report null. Free, no key. Rate limit: 30 requests per 60 seconds per IP, shared across all /api/v1 tools.'
      externalDocs:
        description: Use the tool in a browser
        url: https://www.ayrank.com/tools/hreflang-checker
      operationId: hreflangCheckerPost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HreflangCheckerRequest'
      responses:
        '200':
          description: Result
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HreflangCheckerResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  headers:
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Seconds until the window resets.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
    X-RateLimit-Limit:
      description: Requests allowed per window.
      schema:
        type: integer
  schemas:
    HreflangCheckerRequest:
      type: object
      required:
      - url
      additionalProperties: false
      properties:
        url:
          type: string
          maxLength: 2000
          description: The page whose hreflang set to check.
      examples:
      - url: https://www.apple.com/
    Error:
      type: object
      required:
      - error
      - docs
      properties:
        error:
          type: object
          required:
          - code
          - message
          properties:
            code:
              type: string
              enum:
              - invalid_input
              - rate_limited
            message:
              type: string
        docs:
          type: string
          format: uri
    HreflangCheckerResponse:
      type: object
      required:
      - input
      - finalUrl
      - status
      - redirects
      - error
      - report
      - alternates
      - alternatesListed
      - limits
      - checkedAt
      - poweredBy
      properties:
        input:
          type: string
        finalUrl:
          type: string
          description: URL that answered after redirects. The set is checked against it.
        status:
          type:
          - integer
          - 'null'
        redirects:
          type: integer
        error:
          type:
          - string
          - 'null'
          description: timeout, network, too-many-redirects or null.
        truncated:
          type: boolean
          description: The page was larger than the read cap.
        report:
          type:
          - object
          - 'null'
          description: 'Null unless the page answered 2xx. { pageUrl, canonical, canonicalMatch (exact, trailing-slash or none), entries, entriesTotal, sources { html, header }, headEnd { reason (end-tag, body, element or eof), tag, line }, issues, errors, warnings }. Each entry is { hreflang, href, url, source (html or header), line, code { valid, xDefault, language, script, region, problem, suggestion }, self }. Each issue is { code, severity (error, warning or info), count, samples }. Codes: invalid-format, underscore, not-iso-639-1, unknown-language, region-only, withdrawn-language, unknown-script, numeric-region, reserved-region, withdrawn-region, unknown-region, missing-href, invalid-href, relative-href, missing-self, outside-head, alternate-not-200, no-return-link, alternate-canonical-mismatch, duplicate-hreflang, self-trailing-slash, missing-x-default, not-alternate, media-attribute, canonical-elsewhere, return-link-trailing-slash, alternate-redirect, alternate-unreachable, no-hreflang, language-looks-like-region, both-sources, alternates-not-checked.'
        alternates:
          type: array
          description: 'One per alternate URL read: { url, hreflang (values the page gives it), outcome (ok, redirect, not-200, blocked, timeout, network, too-many-redirects or skipped), status, redirects, finalUrl, finalStatus, hreflangCount, returnLink (exact, trailing-slash, none or null), returnHreflang, canonical, canonicalMatch }.'
          items:
            type: object
        alternatesListed:
          type: integer
          description: Alternate URLs the page lists, other than itself.
        limits:
          type: object
          description: The caps used for this call.
        checkedAt:
          type: string
          format: date-time
        poweredBy:
          $ref: '#/components/schemas/PoweredBy'
    PoweredBy:
      type: object
      required:
      - text
      - url
      properties:
        text:
          type: string
          const: Powered by AY Rank
        url:
          type: string
          format: uri
  responses:
    BadRequest:
      description: 'Invalid input: unknown field, wrong type, missing required field, value too long, or bad JSON.'
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit hit. Wait Retry-After seconds.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'