curl --request POST \
--url https://api.anysite.io/api/hopper/flights/search \
--header 'Content-Type: application/json' \
--header 'access-token: <api-key>' \
--data '
{
"origin": "<string>",
"destination": "<string>",
"departure_date": "2023-12-25",
"count": 2,
"timeout": 300,
"return_date": "2023-12-25",
"trip_type": "round_trip",
"origin_type": "airport",
"destination_type": "airport",
"adults": 1,
"children": 0,
"seat_infants": 0,
"lap_infants": 0,
"airlines": [],
"max_stops": 1,
"max_price": 1,
"sort": "recommended"
}
'import requests
url = "https://api.anysite.io/api/hopper/flights/search"
payload = {
"origin": "<string>",
"destination": "<string>",
"departure_date": "2023-12-25",
"count": 2,
"timeout": 300,
"return_date": "2023-12-25",
"trip_type": "round_trip",
"origin_type": "airport",
"destination_type": "airport",
"adults": 1,
"children": 0,
"seat_infants": 0,
"lap_infants": 0,
"airlines": [],
"max_stops": 1,
"max_price": 1,
"sort": "recommended"
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
origin: '<string>',
destination: '<string>',
departure_date: '2023-12-25',
count: 2,
timeout: 300,
return_date: '2023-12-25',
trip_type: 'round_trip',
origin_type: 'airport',
destination_type: 'airport',
adults: 1,
children: 0,
seat_infants: 0,
lap_infants: 0,
airlines: [],
max_stops: 1,
max_price: 1,
sort: 'recommended'
})
};
fetch('https://api.anysite.io/api/hopper/flights/search', 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://api.anysite.io/api/hopper/flights/search",
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([
'origin' => '<string>',
'destination' => '<string>',
'departure_date' => '2023-12-25',
'count' => 2,
'timeout' => 300,
'return_date' => '2023-12-25',
'trip_type' => 'round_trip',
'origin_type' => 'airport',
'destination_type' => 'airport',
'adults' => 1,
'children' => 0,
'seat_infants' => 0,
'lap_infants' => 0,
'airlines' => [
],
'max_stops' => 1,
'max_price' => 1,
'sort' => 'recommended'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);
$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://api.anysite.io/api/hopper/flights/search"
payload := strings.NewReader("{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departure_date\": \"2023-12-25\",\n \"count\": 2,\n \"timeout\": 300,\n \"return_date\": \"2023-12-25\",\n \"trip_type\": \"round_trip\",\n \"origin_type\": \"airport\",\n \"destination_type\": \"airport\",\n \"adults\": 1,\n \"children\": 0,\n \"seat_infants\": 0,\n \"lap_infants\": 0,\n \"airlines\": [],\n \"max_stops\": 1,\n \"max_price\": 1,\n \"sort\": \"recommended\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("access-token", "<api-key>")
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://api.anysite.io/api/hopper/flights/search")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departure_date\": \"2023-12-25\",\n \"count\": 2,\n \"timeout\": 300,\n \"return_date\": \"2023-12-25\",\n \"trip_type\": \"round_trip\",\n \"origin_type\": \"airport\",\n \"destination_type\": \"airport\",\n \"adults\": 1,\n \"children\": 0,\n \"seat_infants\": 0,\n \"lap_infants\": 0,\n \"airlines\": [],\n \"max_stops\": 1,\n \"max_price\": 1,\n \"sort\": \"recommended\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anysite.io/api/hopper/flights/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departure_date\": \"2023-12-25\",\n \"count\": 2,\n \"timeout\": 300,\n \"return_date\": \"2023-12-25\",\n \"trip_type\": \"round_trip\",\n \"origin_type\": \"airport\",\n \"destination_type\": \"airport\",\n \"adults\": 1,\n \"children\": 0,\n \"seat_infants\": 0,\n \"lap_infants\": 0,\n \"airlines\": [],\n \"max_stops\": 1,\n \"max_price\": 1,\n \"sort\": \"recommended\"\n}"
response = http.request(request)
puts response.read_body[
{
"trip_id": "<string>",
"@type": "HopperFlightItinerary",
"price": 123,
"base_amount": 123,
"taxes_and_fees": 123,
"currency": "<string>",
"outbound": {
"@type": "HopperFlightSlice",
"origin": "<string>",
"destination": "<string>",
"departure": "<string>",
"arrival": "<string>",
"duration_minutes": 123,
"stops": 123,
"segments": []
},
"inbound": {
"@type": "HopperFlightSlice",
"origin": "<string>",
"destination": "<string>",
"departure": "<string>",
"arrival": "<string>",
"duration_minutes": 123,
"stops": 123,
"segments": []
},
"fares": []
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}/hopper/flights/search
Search Hopper flights between an origin and destination (IATA airport codes or city codes) for a departure date, and a return date for round trips, for a given passenger mix (adults, children, seat infants, lap infants). Optionally filter by airlines, maximum stops and maximum price, and choose the ordering. Returns flight itineraries, each with the cheapest total price (base fare and taxes/fees), currency, the outbound and return slices (origin, destination, departure and arrival times, duration, stops and per-segment airline and flight number), and the list of available fare brands with their prices, cabin and remaining seats. Resolve codes via the locations search (kind=flight).
Price: 20 credits
⚠️ Common errors: 412: No flights found for this route and dates
curl --request POST \
--url https://api.anysite.io/api/hopper/flights/search \
--header 'Content-Type: application/json' \
--header 'access-token: <api-key>' \
--data '
{
"origin": "<string>",
"destination": "<string>",
"departure_date": "2023-12-25",
"count": 2,
"timeout": 300,
"return_date": "2023-12-25",
"trip_type": "round_trip",
"origin_type": "airport",
"destination_type": "airport",
"adults": 1,
"children": 0,
"seat_infants": 0,
"lap_infants": 0,
"airlines": [],
"max_stops": 1,
"max_price": 1,
"sort": "recommended"
}
'import requests
url = "https://api.anysite.io/api/hopper/flights/search"
payload = {
"origin": "<string>",
"destination": "<string>",
"departure_date": "2023-12-25",
"count": 2,
"timeout": 300,
"return_date": "2023-12-25",
"trip_type": "round_trip",
"origin_type": "airport",
"destination_type": "airport",
"adults": 1,
"children": 0,
"seat_infants": 0,
"lap_infants": 0,
"airlines": [],
"max_stops": 1,
"max_price": 1,
"sort": "recommended"
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
origin: '<string>',
destination: '<string>',
departure_date: '2023-12-25',
count: 2,
timeout: 300,
return_date: '2023-12-25',
trip_type: 'round_trip',
origin_type: 'airport',
destination_type: 'airport',
adults: 1,
children: 0,
seat_infants: 0,
lap_infants: 0,
airlines: [],
max_stops: 1,
max_price: 1,
sort: 'recommended'
})
};
fetch('https://api.anysite.io/api/hopper/flights/search', 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://api.anysite.io/api/hopper/flights/search",
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([
'origin' => '<string>',
'destination' => '<string>',
'departure_date' => '2023-12-25',
'count' => 2,
'timeout' => 300,
'return_date' => '2023-12-25',
'trip_type' => 'round_trip',
'origin_type' => 'airport',
'destination_type' => 'airport',
'adults' => 1,
'children' => 0,
'seat_infants' => 0,
'lap_infants' => 0,
'airlines' => [
],
'max_stops' => 1,
'max_price' => 1,
'sort' => 'recommended'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);
$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://api.anysite.io/api/hopper/flights/search"
payload := strings.NewReader("{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departure_date\": \"2023-12-25\",\n \"count\": 2,\n \"timeout\": 300,\n \"return_date\": \"2023-12-25\",\n \"trip_type\": \"round_trip\",\n \"origin_type\": \"airport\",\n \"destination_type\": \"airport\",\n \"adults\": 1,\n \"children\": 0,\n \"seat_infants\": 0,\n \"lap_infants\": 0,\n \"airlines\": [],\n \"max_stops\": 1,\n \"max_price\": 1,\n \"sort\": \"recommended\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("access-token", "<api-key>")
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://api.anysite.io/api/hopper/flights/search")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departure_date\": \"2023-12-25\",\n \"count\": 2,\n \"timeout\": 300,\n \"return_date\": \"2023-12-25\",\n \"trip_type\": \"round_trip\",\n \"origin_type\": \"airport\",\n \"destination_type\": \"airport\",\n \"adults\": 1,\n \"children\": 0,\n \"seat_infants\": 0,\n \"lap_infants\": 0,\n \"airlines\": [],\n \"max_stops\": 1,\n \"max_price\": 1,\n \"sort\": \"recommended\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anysite.io/api/hopper/flights/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departure_date\": \"2023-12-25\",\n \"count\": 2,\n \"timeout\": 300,\n \"return_date\": \"2023-12-25\",\n \"trip_type\": \"round_trip\",\n \"origin_type\": \"airport\",\n \"destination_type\": \"airport\",\n \"adults\": 1,\n \"children\": 0,\n \"seat_infants\": 0,\n \"lap_infants\": 0,\n \"airlines\": [],\n \"max_stops\": 1,\n \"max_price\": 1,\n \"sort\": \"recommended\"\n}"
response = http.request(request)
puts response.read_body[
{
"trip_id": "<string>",
"@type": "HopperFlightItinerary",
"price": 123,
"base_amount": 123,
"taxes_and_fees": 123,
"currency": "<string>",
"outbound": {
"@type": "HopperFlightSlice",
"origin": "<string>",
"destination": "<string>",
"departure": "<string>",
"arrival": "<string>",
"duration_minutes": 123,
"stops": 123,
"segments": []
},
"inbound": {
"@type": "HopperFlightSlice",
"origin": "<string>",
"destination": "<string>",
"departure": "<string>",
"arrival": "<string>",
"duration_minutes": 123,
"stops": 123,
"segments": []
},
"fares": []
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API token from the dashboard
Headers
Body
11x >= 120 <= x <= 1500round_trip, one_way airport, city airport, city 1 <= x <= 90 <= x <= 80 <= x <= 80 <= x <= 8x >= 0x >= 0recommended, price_low, price_high Response
Successful Response