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

> Measure how long a webpage takes to fully load from a real browser. Pass `targetCountries` (up to 3 ISO country codes) to also test reachability from those locations via proxy alongside the default US server test, and compare results side by side.

<Info>
  Want to test from multiple countries in one request? See [Load Time:
  Multi-Location Testing](/load-time-multi-location).
</Info>


## 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
      description: >-
        Measure how long a webpage takes to fully load from a real browser. Pass
        `targetCountries` (up to 3 ISO country codes) to also test reachability
        from those locations via proxy alongside the default US server test, and
        compare results side by side.
      operationId: loadTime
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoadTimeDto'
            examples:
              default:
                summary: Default
                value:
                  url: https://example.com
              withProxy:
                summary: With proxy
                value:
                  url: https://example.com
                  proxyCountry: gb
              withTargetCountries:
                summary: With target countries
                value:
                  url: https://example.com
                  targetCountries:
                    - gb
                    - ca
      responses:
        '200':
          description: >-
            Load time retrieved successfully. Returns a single-location result
            by default, or a per-location breakdown when `targetCountries` is
            set.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/LoadTimeResponseDto'
                  - $ref: '#/components/schemas/LoadTimeMultiLocationResponseDto'
              examples:
                singleLocation:
                  summary: Default (single location)
                  value:
                    timestamp: 1783943217189
                    apiStatus: success
                    apiCode: 200
                    message: Site is reachable.
                    meta:
                      url: https://example.com
                      followRedirect: true
                      redirectedURL: https://example.com/
                      test:
                        id: mxqx9v9y0742lap6altwdteqd28t23nq
                    data:
                      dns: 10
                      connect: 12
                      tls: 9
                      send: 19
                      wait: 86
                      total: 88
                      statusCode: 200
                      reasonPhrase: OK
                multiLocation:
                  summary: targetCountries set (multi-location)
                  value:
                    timestamp: 1785938505112
                    apiStatus: success
                    apiCode: 200
                    message: Reachable from all 3 tested locations.
                    meta:
                      url: https://logi.com
                      test:
                        id: cc20cf78-3bfb-4ad4-8e75-4be137f7fb3d
                      targetCountries:
                        - us
                        - gb
                        - ca
                      followRedirect: true
                    summary:
                      reachable:
                        - us
                        - gb
                        - ca
                    locations:
                      - location: us
                        countryName: United States
                        status: reachable
                        data: {}
                      - location: gb
                        countryName: Great Britain
                        status: reachable
                        data: {}
                      - location: ca
                        countryName: Canada
                        status: reachable
                        data: {}
        '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
        targetCountries:
          type: array
          description: >-
            Test the URL from up to 3 additional locations via proxy, alongside
            the default US server test. Each entry is an ISO alpha-2 country
            code. When set, the response includes a per-location reachability
            breakdown instead of a single result.
          example:
            - gb
            - ca
          maxItems: 3
          items:
            type: string
      required:
        - url
    LoadTimeResponseDto:
      type: object
      properties:
        timestamp:
          type: number
          description: Timestamp of the request in milliseconds
          example: 1787223157468
        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
    LoadTimeMultiLocationResponseDto:
      type: object
      description: >-
        Returned instead of LoadTimeResponseDto when `targetCountries` is set on
        the request
      properties:
        timestamp:
          type: number
          description: Timestamp of the request in milliseconds
          example: 1787223157468
        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 summary of reachability across all tested locations
          example: Reachable from all 3 tested locations.
        meta:
          description: Metadata about the multi-location test
          allOf:
            - $ref: '#/components/schemas/LoadTimeMultiLocationMetaDto'
        summary:
          type: object
          description: Locations grouped by reachability outcome
          properties:
            reachable:
              type: array
              description: Locations from which the site was reachable
              example:
                - us
                - gb
                - ca
              items:
                type: string
        locations:
          type: array
          description: Per-location test results, including the default US server test
          items:
            $ref: '#/components/schemas/LoadTimeLocationResultDto'
      required:
        - timestamp
        - apiStatus
        - apiCode
        - message
        - meta
        - summary
        - locations
    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
    LoadTimeMultiLocationMetaDto:
      type: object
      properties:
        url:
          type: string
          description: The tested URL
          example: https://logi.com
        test:
          description: Metadata about the test execution
          allOf:
            - $ref: '#/components/schemas/TestMetaDto'
        targetCountries:
          type: array
          description: >-
            The full list of locations tested: the default US server plus every
            requested targetCountries entry
          example:
            - us
            - gb
            - ca
          items:
            type: string
        followRedirect:
          type: boolean
          description: Indicates if redirects were followed during the test
          example: true
      required:
        - url
        - test
        - targetCountries
    LoadTimeLocationResultDto:
      type: object
      properties:
        location:
          type: string
          description: ISO alpha-2 country code for this test location
          example: gb
        countryName:
          type: string
          description: Full country name for this test location
          example: Great Britain
        status:
          type: string
          description: Whether the site was reachable from this location
          example: reachable
          enum:
            - reachable
            - unreachable
        data:
          type: object
          description: >-
            Load time metrics for this location, same structure as the
            single-location `data` object
          additionalProperties: true
      required:
        - location
        - countryName
        - status
        - data
    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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.