---
title: "Quickstart"
description: "Dubai to London, end to end, with curl."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.wego.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

import { Code } from "astro:components";
import { siteEnv } from "@/site-env";

Dubai to London, end to end. Get `$TOKEN` per [Authentication](/authentication) first. This needs `jq` (the same threading idiom the CLI uses).

<Code lang="bash" code={String.raw`# 1. Create a search (IATA airport or city codes; results settle async)
SEARCH_ID=$(curl -s -X POST "${siteEnv.apiBase}/v1/flights/searches" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"from":"DXB","to":"LHR","fromDate":"2026-09-21","adults":1}' | jq -r .searchId)

# 2. Read ranked results and take a trip id (empty? rerun: results settle async)
TRIP_ID=$(sleep 3; curl -s -H "Authorization: Bearer $TOKEN" \
  "${siteEnv.apiBase}/v1/flights/searches/$SEARCH_ID/results" | jq -r '.results[0].tripId')

# 3. Open the trip (full itinerary, every fare) and take its Wego fare id
# (null? that trip has no Wego fare: try another tripId from step 2)
FARE_ID=$(curl -s -H "Authorization: Bearer $TOKEN" \
  "${siteEnv.apiBase}/v1/flights/trips/$TRIP_ID?searchId=$SEARCH_ID" \
  | jq -r '[.fares[] | select(.kind=="wego")][0].fareId')

# 4. Get the wego.com URL (the booking-link endpoint)
curl -s -H "Authorization: Bearer $TOKEN" \
  "${siteEnv.apiBase}/v1/flights/fares/$FARE_ID/booking-link?tripId=$TRIP_ID&from=DXB&to=LHR&fromDate=2026-09-21"
# -> { "bookingUrl": "https://www.wego.com/..." }`} />

Do not know the code? `GET /v1/places?query=dubai` resolves free text to typed places with codes. Hotels run the same shape: create a search, read results, list a hotel's rates, get the checkout URL.

For endpoint details and parameters, see the [API Reference](/api).

Source: https://docs.wego.com/quickstart/index.mdx
