## Calculate a route between two points `client.routing.route(RoutingRouteParamsbody, RequestOptionsoptions?): RouteResult` **post** `/api/v1/route` Calculate a route between two points ### Parameters - `body: RoutingRouteParams` - `destination: GeoJsonGeometry` Destination point (GeoJSON Point geometry) - `coordinates: Array | Array> | Array>> | Array>>>` GeoJSON coordinates array (nesting depth varies by geometry type) - `Array` - `Array>` - `Array>>` - `Array>>>` - `type: "Point" | "LineString" | "Polygon" | 3 more` - `"Point"` - `"LineString"` - `"Polygon"` - `"MultiPoint"` - `"MultiLineString"` - `"MultiPolygon"` - `origin: GeoJsonGeometry` Origin point (GeoJSON Point geometry) - `mode?: "auto" | "foot" | "bicycle"` - `"auto"` - `"foot"` - `"bicycle"` ### Returns - `RouteResult` - `geometry: GeoJsonGeometry` - `coordinates: Array | Array> | Array>> | Array>>>` GeoJSON coordinates array (nesting depth varies by geometry type) - `Array` - `Array>` - `Array>>` - `Array>>>` - `type: "Point" | "LineString" | "Polygon" | 3 more` - `"Point"` - `"LineString"` - `"Polygon"` - `"MultiPoint"` - `"MultiLineString"` - `"MultiPolygon"` - `properties: Properties` - `distance?: number` Total distance in meters - `duration?: number` Estimated duration in seconds - `mode?: string` Travel mode used - `type: "Feature"` - `"Feature"` ### Example ```typescript import Plaza from '@plazafyi/sdk'; const client = new Plaza({ apiKey: process.env['PLAZA_API_KEY'], // This is the default and can be omitted }); const routeResult = await client.routing.route({ destination: { coordinates: [0], type: 'Point' }, origin: { coordinates: [0], type: 'Point' }, }); console.log(routeResult.geometry); ```