All posts

Introducing the GoGoDuk Directions API for Vietnam

A new routing endpoint with turn-by-turn directions, optimized for motorbikes and returned in a Google Directions–compatible format so you can swap in with almost no code changes.

Today we're shipping one of our most requested features: a Directions API. GET /v1/directions returns a route between two points — distance, duration and turn-by-turn steps — purpose-built for Vietnamese roads and optimized for motorbikes, the way most of the country actually moves.

Why we built it

Delivery, ride-hailing, field-service and logistics apps in Vietnam all need the same thing: a realistic route for a motorbike, not a car. Cars and bikes take different roads here — bikes use narrow alleys and lanes a car can't. Generic car routing over-/under-estimates both distance and time.

Our routing engine runs on an OpenStreetMap road graph tuned for the motorbike profile, so the route — and the ETA — match how a rider would actually go.

Google Directions–compatible

If your app already speaks Google Maps or Goong Directions, switching is almost free: we return the same response shaperoutes[] → legs[] → steps[] with distance/duration ({ text, value }), html_instructions, maneuver (turn-left, turn-right, …) and encoded polyline strings.

Request

curl -G "https://api.gogoduk.com/v1/directions" \
  -H "X-API-Key: $GOGODUK_API_KEY" \
  --data-urlencode "origin=21.0285,105.8542" \
  --data-urlencode "destination=21.2212,105.8072" \
  --data-urlencode "vehicle=motobike"
  • origin / destinationlat,lng (the same order Google/Goong use).
  • vehiclemotobike today; car is coming.
  • Scope required: routing:read.

Response

{
  "status": "OK",
  "routes": [
    {
      "legs": [
        {
          "distance": { "text": "5.7 km", "value": 5704.1 },
          "duration": { "text": "9 phút", "value": 511.2 },
          "steps": [
            {
              "distance": { "text": "243 m", "value": 243.4 },
              "html_instructions": "Head northwest on Pasteur",
              "maneuver": "turn-right",
              "polyline": { "points": "suw`Aq{fjSOF{Bx@..." },
              "travel_mode": "DRIVING"
            }
          ]
        }
      ],
      "overview_polyline": { "points": "suw`Aq{fjS..." }
    }
  ]
}

Decode overview_polyline.points with any standard Google/Mapbox polyline decoder (precision 5) and draw it straight onto your map.

Always a drawable line

When no road route exists between two points (a routable-network gap, an island, bad input), we don't fail — we return a straight-line estimate so your UI always has something to draw:

  • status becomes "ESTIMATED".
  • distance is the great-circle distance with a road-detour factor; duration is estimated from an average speed.

We recommend rendering ESTIMATED routes differently (e.g. a dashed line) so users know it isn't a real road route.

Try it

Questions or feedback? Join our Telegram support group — we'd love to hear what you build.

Want to use GoGoDuk?

Free forever — 100 requests/day per account, no credit card. Higher limits on request.

Sign up →