> ## 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.

# Load Time



## OpenAPI

````yaml POST /loadtime
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:
  /loadtime:
    post:
      tags:
        - api-tool
      summary: Measure the page load time for a given URL
      operationId: loadTime
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoadTimeDto'
      responses:
        '200':
          description: Load time retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoadTimeResponseDto'
        '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.
        '500':
          description: Failed to measure page load time.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 500
                message: LOAD_TIME_FAILED
                details: Unable to measure the page load time for the target URL.
components:
  schemas:
    LoadTimeDto:
      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
    LoadTimeResponseDto:
      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: Overall message about site reachability
          example: Site is reachable.
        meta:
          description: Metadata about the load time test
          allOf:
            - $ref: '#/components/schemas/LoadTimeMetaDto'
        data:
          description: Comprehensive site load time metrics
          allOf:
            - $ref: '#/components/schemas/LoadTimeDataDto'
      required:
        - timestamp
        - apiStatus
        - apiCode
        - meta
        - 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
    LoadTimeMetaDto:
      type: object
      properties:
        url:
          type: string
          description: The tested URL
          example: https://example.com
        proxyCountry:
          type: string
          description: Proxy country used for the test
          example: us
        followRedirect:
          type: boolean
          description: Indicates if redirects were followed during the test
          example: true
        redirectedURL:
          type: string
          description: Final URL after redirection (if any)
          example: https://example.com/
        test:
          description: Metadata about the test execution
          allOf:
            - $ref: '#/components/schemas/TestMetaDto'
      required:
        - url
        - redirectedURL
        - test
    LoadTimeDataDto:
      type: object
      properties:
        dns:
          type: number
          description: Time spent in DNS lookup (ms)
          example: 10
        connect:
          type: number
          description: Time to establish TCP connection (ms)
          example: 12
        tls:
          type: number
          description: Time to complete TLS handshake (ms)
          example: 9
        send:
          type: number
          description: Time to send request (ms)
          example: 19
        wait:
          type: number
          description: Time waiting for response (ms)
          example: 86
        total:
          type: number
          description: Total load time (ms)
          example: 88
        statusCode:
          type: number
          description: HTTP status code of the response
          example: 404
        reasonPhrase:
          type: string
          description: HTTP reason phrase
          example: Not Found
        timings:
          description: Detailed timing breakdown
          allOf:
            - $ref: '#/components/schemas/TimingsDto'
        network:
          description: Network information
          allOf:
            - $ref: '#/components/schemas/NetworkDto'
        headers:
          type: object
          description: Response headers as key-value pairs
          example:
            server: cloudflare
            content-type: text/html; charset=utf-8
            cache-control: no-cache
        protocolSupport:
          description: HTTP protocol support information
          allOf:
            - $ref: '#/components/schemas/ProtocolSupportDto'
      required:
        - dns
        - connect
        - tls
        - send
        - wait
        - total
        - statusCode
        - reasonPhrase
        - timings
        - network
        - headers
        - protocolSupport
    TestMetaDto:
      type: object
      properties:
        id:
          type: string
          description: Unique test identifier
          example: mxqx9v9y0742lap6altwdteqd28t23nq
      required:
        - id
    TimingsDto:
      type: object
      properties:
        dns:
          type: number
          description: Time spent in DNS lookup (ms)
          example: 21
        connect:
          type: number
          description: Time to establish TCP connection (ms)
          example: 15
        tls:
          type: number
          description: Time to complete TLS handshake (ms)
          example: 40
        send:
          type: number
          description: Time to send request (ms)
          example: 1
        wait:
          type: number
          description: Server processing time (ms)
          example: 457
        ttfb:
          type: number
          description: Time to First Byte - calculated as dns+connect+tls+send+wait (ms)
          example: 534
        download:
          type: number
          description: Time to download response body (ms)
          example: 4
        total:
          type: number
          description: Total load time (ms)
          example: 538
        redirectDuration:
          type: number
          description: Time spent in redirects before reaching final URL (ms)
          example: 0
      required:
        - dns
        - connect
        - tls
        - send
        - wait
        - ttfb
        - download
        - total
        - redirectDuration
    NetworkDto:
      type: object
      properties:
        protocol:
          type: string
          description: The actual HTTP protocol used (e.g. h2, h3, http/1.1, http/1.0)
          example: h2
        remoteIp:
          type: string
          description: Remote IP address of the server
          example: 1.1.1.1
        bytesRead:
          type: number
          description: Total bytes read from the response
          example: 15400
      required:
        - protocol
        - bytesRead
    ProtocolSupportDto:
      type: object
      properties:
        http10:
          type: boolean
          description: Whether HTTP/1.0 is supported
          example: false
        http11:
          type: boolean
          description: Whether HTTP/1.1 is supported
          example: true
        http2:
          type: boolean
          description: Whether HTTP/2 is supported
          example: true
        http3:
          type: boolean
          description: Whether HTTP/3 is supported
          example: false
        http3SupportedVersion:
          description: HTTP/3 supported versions if available
          example:
            - h3-29
            - h3
          type: array
          items:
            type: string
      required:
        - http10
        - http11
        - http2
        - http3
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key required for all endpoints

````