> ## Documentation Index
> Fetch the complete documentation index at: https://docs.geekflare.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Broken Link Checker



## OpenAPI

````yaml POST /brokenlink
openapi: 3.1.0
info:
  title: Geekflare
  description: Official OpenAPI specification for all Geekflare endpoints.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.geekflare.com
security:
  - x-api-key: []
paths:
  /brokenlink:
    post:
      tags:
        - api-tool
      summary: Check if a webpage contains broken links
      operationId: brokenLink
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BrokenLinkDto'
      responses:
        '200':
          description: Successfully checked for broken links
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrokenLinkResponseDto'
        '400':
          description: Invalid URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 400
                message: INVALID_URL
                details: The URL must be a valid HTTP or HTTPS URL.
        '422':
          description: Unable to connect to the target website.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 422
                message: UNABLE_TO_CONNECT
                details: >-
                  The destination server could not be resolved, refused the
                  connection, timed out, or is redirecting indefinitely.
components:
  schemas:
    BrokenLinkDto:
      type: object
      properties:
        url:
          type: string
          description: Target URL
          example: https://example.com
        followRedirect:
          type: boolean
          description: Whether to follow redirects when checking site status
          example: false
          default: false
        proxyCountry:
          type: string
          description: Proxy country code to route the request
          example: us
      required:
        - url
    BrokenLinkResponseDto:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the request in milliseconds
          example: 1783943217189
        apiStatus:
          type: string
          description: API status message
          example: success
          enum:
            - success
            - failure
        apiCode:
          type: number
          description: API status code
          example: 200
        message:
          type: string
          description: Human-readable message about the broken link scan result
          example: No broken links found.
        meta:
          description: Metadata about the broken link request
          example:
            url: example.com
            proxyCountry: United States
            followRedirect: true
            redirectedURL: https://example.com/
            test:
              id: wf0b7yrn05br8xtwple7ngj7hhxzvl2e
          allOf:
            - $ref: '#/components/schemas/BrokenLinkMetaDto'
        summary:
          description: Summary of link check results categorized by status
          example:
            total: 5
            successful: 2
            redirects: 2
            broken: 1
            serverError: 0
          allOf:
            - $ref: '#/components/schemas/BrokenLinkSummaryDto'
        data:
          description: List of links found on the page and their HTTP status
          example:
            - link: https://example.com/
              status: 200
            - link: https://example.com/articles
              status: 200
          type: array
          items:
            type: string
      required:
        - timestamp
        - apiStatus
        - apiCode
        - message
        - meta
        - summary
        - data
    BaseErrorResponseDto:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the request in milliseconds
          example: 1778737930991
        apiStatus:
          type: string
          description: API status message
          example: success
          enum:
            - success
            - failure
        apiCode:
          type: number
          description: API status code
          example: 200
        message:
          type: string
          description: Error message
          example: Invalid URL provided
        details:
          type: string
          description: Detailed error information
          example: The URL must be a valid HTTP or HTTPS URL
      required:
        - timestamp
        - apiStatus
        - apiCode
        - message
    BrokenLinkMetaDto:
      type: object
      properties:
        url:
          type: string
          description: The target URL checked for broken links
          example: example.com
        proxyCountry:
          type: string
          description: Proxy country used for this request
          example: United States
        followRedirect:
          type: boolean
          description: Whether redirection was followed
          example: true
        redirectedURL:
          type: string
          description: Final URL after redirection (if any)
          example: https://example.com/
        test:
          description: Test details object
          allOf:
            - $ref: '#/components/schemas/TestMetaDto'
      required:
        - url
        - proxyCountry
        - followRedirect
        - redirectedURL
        - test
    BrokenLinkSummaryDto:
      type: object
      properties:
        total:
          type: number
          description: Total number of links checked
          example: 5
        successful:
          type: number
          description: Number of successful links (2xx status codes)
          example: 2
        redirects:
          type: number
          description: Number of redirect links (3xx status codes)
          example: 2
        broken:
          type: number
          description: Number of broken links (4xx status codes and DNS/network failures)
          example: 1
        serverError:
          type: number
          description: Number of server errors (5xx status codes)
          example: 0
        forbidden:
          type: number
          description: Number of forbidden links (403 status codes)
          example: 0
        timedOut:
          type: number
          description: Number of timed-out links
          example: 0
      required:
        - total
        - successful
        - redirects
        - broken
        - serverError
        - forbidden
        - timedOut
    TestMetaDto:
      type: object
      properties:
        id:
          type: string
          description: Unique test identifier
          example: mxqx9v9y0742lap6altwdteqd28t23nq
      required:
        - id
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key required for all endpoints

````