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

# Ping



## OpenAPI

````yaml POST /ping
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:
  /ping:
    post:
      tags:
        - api-tool
      summary: Perform ICMP Ping test on a given URL or IP
      operationId: ping
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PingDto'
      responses:
        '200':
          description: Ping test completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PingResponseDto'
        '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.
        '504':
          description: Host is unreachable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 504
                message: TCP_PING_FAILED
                details: All TCP ping attempts to the target host failed.
components:
  schemas:
    PingDto:
      type: object
      properties:
        url:
          type: string
          description: Target URL
          example: https://example.com
      required:
        - url
    PingResponseDto:
      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
        meta:
          description: Metadata about the Ping test execution
          allOf:
            - $ref: '#/components/schemas/PingMetaDto'
        data:
          description: Ping result statistics
          example:
            requests: 4
            loss: 0
            latency: 32.5
            min: 30
            max: 35
            avg: 32.5
            stdDev: 1.5
            ip: 142.250.183.206
          allOf:
            - $ref: '#/components/schemas/PingDataDto'
      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
    PingMetaDto:
      type: object
      properties:
        url:
          type: string
          description: The tested URL or IP address
          example: example.com
        test:
          description: Metadata about the test execution
          allOf:
            - $ref: '#/components/schemas/TestMetaDto'
      required:
        - url
        - test
    PingDataDto:
      type: object
      properties:
        requests:
          type: number
          description: Number of ping requests sent
          example: 4
        loss:
          type: number
          description: Packet loss percentage
          example: 0
        latency:
          type: number
          description: Average latency in milliseconds
          example: 32.5
        min:
          type: number
          description: Minimum round-trip time (RTT) in milliseconds
          example: 30
        max:
          type: number
          description: Maximum round-trip time (RTT) in milliseconds
          example: 35
        avg:
          type: number
          description: Average round-trip time (RTT) in milliseconds
          example: 32.5
        stdDev:
          type: number
          description: Standard deviation of RTT in milliseconds
          example: 1.5
        ip:
          type: string
          description: Resolved IP address of the tested domain
          example: 142.250.183.206
      required:
        - requests
        - loss
        - latency
        - min
        - max
        - avg
        - stdDev
        - ip
    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

````