---
agentTools:
  projectIndex: https://docs.qdelivery.app/llms.txt
---

# Distance

With the Estimated Time of Arrival service, you can get the courier movement distance and time between two locations.

[block:api-header]
{
  "title": "ETA (Estimated time of arrival)"
}
[/block]

* Distance type is meters.
* Duration type is seconds.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Integration",
    "version": "1.6.1"
  },
  "servers": [
    {
      "url": "https://api.dev.qdelivery.app/api/integration"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/routing/distance": {
      "post": {
        "summary": "Distance",
        "description": "With the Estimated Time of Arrival service, you can get the courier movement distance and time between two locations.",
        "operationId": "routing-distance",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "pickup_lat",
                  "pickup_lng",
                  "destination_lat",
                  "destination_lng"
                ],
                "properties": {
                  "pickup_lat": {
                    "type": "number",
                    "description": "Pickup Latitude. Example: 43.223643 Must be 6 decimals as in the example.",
                    "format": "float"
                  },
                  "pickup_lng": {
                    "type": "number",
                    "description": "Pickup Longitude. Example: 43.323643 Must be 6 decimals as in the example.",
                    "format": "float"
                  },
                  "destination_lat": {
                    "type": "number",
                    "description": "Destination Latitude. Example: 43.423643 Must be 6 decimals as in the example.",
                    "format": "float"
                  },
                  "destination_lng": {
                    "type": "number",
                    "description": "Destination Longitude. Example: 43.523643 Must be 6 decimals as in the example.",
                    "format": "float"
                  },
                  "strategy": {
                    "type": "string",
                    "description": "Usable strategies: basic, accurate.  Basic is birds eye view. Accurate is use of paid services. If strategy is null, it is considered basic.",
                    "default": "basic"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"distance\": 1602.4,\n\t\"duration\": 5,\n\t\"type\": \"ors\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "distance": {
                      "type": "number",
                      "example": 1602.4,
                      "default": 0
                    },
                    "duration": {
                      "type": "integer",
                      "example": 5,
                      "default": 0
                    },
                    "type": {
                      "type": "string",
                      "example": "ors"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t\"message\": \"pickup lat alanı gereklidir. (and 3 more errors)\",\n\t\"errors\": {\n\t\t\"pickup_lat\": [\n\t\t\t\"pickup lat alanı gereklidir.\"\n\t\t],\n\t\t\"pickup_lng\": [\n\t\t\t\"pickup lng alanı gereklidir.\"\n\t\t],\n\t\t\"destination_lat\": [\n\t\t\t\"destination lat alanı gereklidir.\"\n\t\t],\n\t\t\"destination_lng\": [\n\t\t\t\"destination lng alanı gereklidir.\"\n\t\t]\n\t}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "pickup lat alanı gereklidir. (and 3 more errors)"
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "pickup_lat": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "pickup lat alanı gereklidir."
                          }
                        },
                        "pickup_lng": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "pickup lng alanı gereklidir."
                          }
                        },
                        "destination_lat": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "destination lat alanı gereklidir."
                          }
                        },
                        "destination_lng": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "destination lng alanı gereklidir."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6602b1495613fc002042a788:6602b14a5613fc002042a7ae"
}
```