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

# MTR



## OpenAPI

````yaml POST /mtr
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:
  /mtr:
    post:
      tags:
        - api-tool
      summary: Perform MTR (My Traceroute) network diagnostic test
      operationId: mtr
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MtrDto'
      responses:
        '200':
          description: MTR test completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MtrResponseDto'
        '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.
        '500':
          description: MTR is not installed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseErrorResponseDto'
              example:
                timestamp: 1700000000000
                apiStatus: failure
                apiCode: 500
                message: MTR_NOT_FOUND
                details: The mtr command is not available on the server.
components:
  schemas:
    MtrDto:
      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
    MtrResponseDto:
      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 MTR test execution
          allOf:
            - $ref: '#/components/schemas/MtrMetaDto'
        data:
          description: Array of hop details observed in the MTR trace route
          example:
            - hop: 1
              host: 240.192.18.19
              asn: AS???
              loss: 0
              sent: 2
              last: 0.28
              avg: 0.29
              best: 0.28
              worst: 0.3
              stdDev: 0.01
            - hop: 2
              host: 240.0.60.49
              asn: AS???
              loss: 0
              sent: 2
              last: 0.28
              avg: 0.29
              best: 0.28
              worst: 0.29
              stdDev: 0.01
          type: array
          items:
            $ref: '#/components/schemas/MtrDataDto'
      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
    MtrMetaDto:
      type: object
      properties:
        url:
          type: string
          description: The tested URL or IP address
          example: example.com
        proxyCountry:
          type: string
          description: Country used for proxy
          example: United States
        followRedirect:
          type: boolean
          description: Indicates if redirects should be followed
          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
    MtrDataDto:
      type: object
      properties:
        hop:
          type: number
          description: Hop number in the traceroute path
          example: 1
        host:
          type: string
          description: Host IP or domain name at this hop
          example: 240.192.18.19
        asn:
          type: string
          description: Autonomous System Number (ASN) for the host
          example: AS???
        loss:
          type: number
          description: Packet loss percentage at this hop
          example: 0
        sent:
          type: number
          description: Number of packets sent to this hop
          example: 2
        last:
          type: number
          description: Last recorded round-trip time (RTT) in milliseconds
          example: 0.28
        avg:
          type: number
          description: Average RTT across packets
          example: 0.29
        best:
          type: number
          description: Best (lowest) RTT observed
          example: 0.28
        worst:
          type: number
          description: Worst (highest) RTT observed
          example: 0.3
        stdDev:
          type: number
          description: Standard deviation of RTT measurements
          example: 0.01
      required:
        - hop
        - host
        - asn
        - loss
        - sent
        - last
        - avg
        - best
        - worst
        - stdDev
    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

````