Search Flights
curl --request POST \
--url https://stardrift.ai/api/v1/search/flights \
--header 'Content-Type: application/json' \
--data '
{
"legs": [
{
"departure_id": "<string>",
"arrival_id": "<string>",
"date": "2023-12-25"
}
],
"adults": 1,
"currency": "USD",
"trip_type": "one_way",
"children": 0,
"travel_class": "economy",
"max_price": 1,
"max_stops": 1
}
'import requests
url = "https://stardrift.ai/api/v1/search/flights"
payload = {
"legs": [
{
"departure_id": "<string>",
"arrival_id": "<string>",
"date": "2023-12-25"
}
],
"adults": 1,
"currency": "USD",
"trip_type": "one_way",
"children": 0,
"travel_class": "economy",
"max_price": 1,
"max_stops": 1
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
legs: [{departure_id: '<string>', arrival_id: '<string>', date: '2023-12-25'}],
adults: 1,
currency: 'USD',
trip_type: 'one_way',
children: 0,
travel_class: 'economy',
max_price: 1,
max_stops: 1
})
};
fetch('https://stardrift.ai/api/v1/search/flights', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stardrift.ai/api/v1/search/flights",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'legs' => [
[
'departure_id' => '<string>',
'arrival_id' => '<string>',
'date' => '2023-12-25'
]
],
'adults' => 1,
'currency' => 'USD',
'trip_type' => 'one_way',
'children' => 0,
'travel_class' => 'economy',
'max_price' => 1,
'max_stops' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stardrift.ai/api/v1/search/flights"
payload := strings.NewReader("{\n \"legs\": [\n {\n \"departure_id\": \"<string>\",\n \"arrival_id\": \"<string>\",\n \"date\": \"2023-12-25\"\n }\n ],\n \"adults\": 1,\n \"currency\": \"USD\",\n \"trip_type\": \"one_way\",\n \"children\": 0,\n \"travel_class\": \"economy\",\n \"max_price\": 1,\n \"max_stops\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://stardrift.ai/api/v1/search/flights")
.header("Content-Type", "application/json")
.body("{\n \"legs\": [\n {\n \"departure_id\": \"<string>\",\n \"arrival_id\": \"<string>\",\n \"date\": \"2023-12-25\"\n }\n ],\n \"adults\": 1,\n \"currency\": \"USD\",\n \"trip_type\": \"one_way\",\n \"children\": 0,\n \"travel_class\": \"economy\",\n \"max_price\": 1,\n \"max_stops\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stardrift.ai/api/v1/search/flights")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"legs\": [\n {\n \"departure_id\": \"<string>\",\n \"arrival_id\": \"<string>\",\n \"date\": \"2023-12-25\"\n }\n ],\n \"adults\": 1,\n \"currency\": \"USD\",\n \"trip_type\": \"one_way\",\n \"children\": 0,\n \"travel_class\": \"economy\",\n \"max_price\": 1,\n \"max_stops\": 1\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}mcp-server
Search Flights
POST
/
v1
/
search
/
flights
Search Flights
curl --request POST \
--url https://stardrift.ai/api/v1/search/flights \
--header 'Content-Type: application/json' \
--data '
{
"legs": [
{
"departure_id": "<string>",
"arrival_id": "<string>",
"date": "2023-12-25"
}
],
"adults": 1,
"currency": "USD",
"trip_type": "one_way",
"children": 0,
"travel_class": "economy",
"max_price": 1,
"max_stops": 1
}
'import requests
url = "https://stardrift.ai/api/v1/search/flights"
payload = {
"legs": [
{
"departure_id": "<string>",
"arrival_id": "<string>",
"date": "2023-12-25"
}
],
"adults": 1,
"currency": "USD",
"trip_type": "one_way",
"children": 0,
"travel_class": "economy",
"max_price": 1,
"max_stops": 1
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
legs: [{departure_id: '<string>', arrival_id: '<string>', date: '2023-12-25'}],
adults: 1,
currency: 'USD',
trip_type: 'one_way',
children: 0,
travel_class: 'economy',
max_price: 1,
max_stops: 1
})
};
fetch('https://stardrift.ai/api/v1/search/flights', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stardrift.ai/api/v1/search/flights",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'legs' => [
[
'departure_id' => '<string>',
'arrival_id' => '<string>',
'date' => '2023-12-25'
]
],
'adults' => 1,
'currency' => 'USD',
'trip_type' => 'one_way',
'children' => 0,
'travel_class' => 'economy',
'max_price' => 1,
'max_stops' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stardrift.ai/api/v1/search/flights"
payload := strings.NewReader("{\n \"legs\": [\n {\n \"departure_id\": \"<string>\",\n \"arrival_id\": \"<string>\",\n \"date\": \"2023-12-25\"\n }\n ],\n \"adults\": 1,\n \"currency\": \"USD\",\n \"trip_type\": \"one_way\",\n \"children\": 0,\n \"travel_class\": \"economy\",\n \"max_price\": 1,\n \"max_stops\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://stardrift.ai/api/v1/search/flights")
.header("Content-Type", "application/json")
.body("{\n \"legs\": [\n {\n \"departure_id\": \"<string>\",\n \"arrival_id\": \"<string>\",\n \"date\": \"2023-12-25\"\n }\n ],\n \"adults\": 1,\n \"currency\": \"USD\",\n \"trip_type\": \"one_way\",\n \"children\": 0,\n \"travel_class\": \"economy\",\n \"max_price\": 1,\n \"max_stops\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stardrift.ai/api/v1/search/flights")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"legs\": [\n {\n \"departure_id\": \"<string>\",\n \"arrival_id\": \"<string>\",\n \"date\": \"2023-12-25\"\n }\n ],\n \"adults\": 1,\n \"currency\": \"USD\",\n \"trip_type\": \"one_way\",\n \"children\": 0,\n \"travel_class\": \"economy\",\n \"max_price\": 1,\n \"max_stops\": 1\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Required array length:
1 - 4 elementsShow child attributes
Show child attributes
Required range:
1 <= x <= 9Available options:
ALL, DZD, ARS, AMD, AWG, AUD, AZN, BSD, BHD, BYN, BMD, BAM, BRL, GBP, BGN, XPF, CAD, CLP, CNY, COP, CRC, CUP, CZK, DKK, DOP, EGP, EUR, GEL, HKD, HUF, ISK, INR, IDR, IRR, ILS, JMD, JPY, JOD, KZT, KWD, LBP, MKD, MYR, MXN, MDL, MAD, TWD, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, RSD, SGD, ZAR, KRW, SEK, CHF, THB, TRY, USD, UAH, AED, VND Available options:
one_way, roundtrip, multi_city Required range:
0 <= x <= 8Available options:
economy, premium_economy, business, first Required range:
x >= 0Required range:
0 <= x <= 2Response
Successful Response
The response is of type Response Search Flights V1 Search Flights Post · object.
