MoltFlights — Flight Search Skill
Search cheap flights using the MoltFlights API. Returns structured JSON with real-time prices and direct booking links.
No API key required. No authentication. Just call the endpoint.
Tools
moltflights_search — Search Flights
CODEBLOCK0
| Parameter | Required | Type | Description |
|---|
| INLINECODE1 | yes | string | IATA airport code (e.g. HEL) |
| INLINECODE3 |
yes | string | IATA airport code (e.g.
NRT) |
|
date | no | string | Departure date
YYYY-MM-DD |
|
returnDate | no | string | Return date
YYYY-MM-DD (round-trip)|
|
adults | no | integer | Number of adults, 1–9 (default: 1) |
|
children | no | integer | Children ages 2–12, 0–8 (default: 0) |
|
infants | no | integer | Infants under 2, 0–8 (default: 0) |
If date is omitted, the API returns the cheapest flights for the upcoming month.
moltflights_autocomplete — Look Up Airport Codes
CODEBLOCK1
| Parameter | Required | Type | Description |
|---|
| INLINECODE14 | yes | string | City or airport name (min 2 characters) |
Example: Search Flights
CODEBLOCK2
Response
CODEBLOCK3
Each result includes a book_link — a direct booking URL the user can open.
Example: Round-Trip with Passengers
CODEBLOCK4
The price field shows the total for all seat-occupying passengers. price_per_person shows the per-person price.
Common Use Cases
1. Find the cheapest flight to a destination
Search without a specific date to get the cheapest options for the whole month:
CODEBLOCK5
2. Compare prices across dates
Run multiple searches for different dates and compare:
CODEBLOCK6
3. Price monitoring / alerts (cron job)
Check a route daily and alert when price drops below a threshold:
CODEBLOCK7
4. Multi-city search
Search several routes and pick the cheapest:
CODEBLOCK8
Common IATA Codes
| Code | City | Code | City |
|---|
| HEL | Helsinki | LHR | London |
| JFK |
New York | CDG | Paris |
| NRT | Tokyo Narita | BKK | Bangkok |
| BCN | Barcelona | FCO | Rome |
| SIN | Singapore | DXB | Dubai |
| LAX | Los Angeles | SFO | San Francisco |
| BER | Berlin | AMS | Amsterdam |
| IST | Istanbul | LIS | Lisbon |
Don't know the code? Use the moltflights_autocomplete tool:
CODEBLOCK9
Error Handling
- - 400 — Missing
origin or destination parameter - Empty
data array — No flights found for this route/date. Try a different date or omit the date for flexible search.
Tips
- - Prices are in EUR (€)
- Results are sorted: exact date matches first, then nearby dates by price
- Omitting
date gives you the cheapest flights across the whole upcoming month - The API is free and requires no authentication
- Responses are cached for 5 minutes
MoltFlights — 航班搜索技能
使用 MoltFlights API 搜索廉价航班。返回包含实时价格和直接预订链接的结构化 JSON 数据。
无需 API 密钥。无需身份验证。直接调用接口即可。
工具
moltflights_search — 搜索航班
GET https://moltflights.com/api/search?origin=HEL&destination=BKK&date=2026-03-15
| 参数 | 必填 | 类型 | 描述 |
|---|
| origin | 是 | string | IATA 机场代码(例如 HEL) |
| destination |
是 | string | IATA 机场代码(例如 NRT) |
| date | 否 | string | 出发日期 YYYY-MM-DD |
| returnDate | 否 | string | 返程日期 YYYY-MM-DD(往返) |
| adults | 否 | integer | 成人数量,1–9(默认:1) |
| children | 否 | integer | 儿童年龄 2–12,0–8(默认:0) |
| infants | 否 | integer | 婴儿年龄 2 岁以下,0–8(默认:0) |
如果省略 date,API 将返回未来一个月内最便宜的航班。
moltflights_autocomplete — 查询机场代码
GET https://moltflights.com/api/autocomplete?term=bangkok
| 参数 | 必填 | 类型 | 描述 |
|---|
| term | 是 | string | 城市或机场名称(至少 2 个字符) |
示例:搜索航班
bash
curl https://moltflights.com/api/search?origin=HEL&destination=BKK&date=2026-03-15
响应
json
{
meta: {
source: MoltFlights,
origin: HEL,
destination: BKK,
date: 2026-03-15,
adults: 1,
children: 0,
infants: 0,
results: 12
},
data: [
{
airline: Finnair,
flight_number: 809,
price: €432,
priceperperson: €432,
departure: 2026-03-15T10:30:00,
return_at: ,
transfers: 1,
origin: HEL,
destination: BKK,
book_link: https://www.aviasales.com/search/...
}
]
}
每个结果包含一个 book_link — 用户可直接打开预订链接。
示例:带乘客的往返航班
bash
curl https://moltflights.com/api/search?origin=JFK&destination=CDG&date=2026-06-01&returnDate=2026-06-15&adults=2&children=1
price 字段显示所有占座乘客的总价。priceperperson 显示每人价格。
常见用例
1. 查找前往目的地的最便宜航班
不指定具体日期搜索,获取整个月的最优惠选项:
bash
curl https://moltflights.com/api/search?origin=LHR&destination=TYO
2. 跨日期比价
对多个日期分别搜索并比较:
bash
for date in 2026-04-01 2026-04-08 2026-04-15; do
echo === $date ===
curl -s https://moltflights.com/api/search?origin=HEL&destination=BKK&date=$date | head -20
done
3. 价格监控/提醒(定时任务)
每日检查某条航线,当价格低于阈值时发送提醒:
bash
通过 cron 每日运行:0 8 * /path/to/check-price.sh
PRICE=$(curl -s https://moltflights.com/api/search?origin=HEL&destination=BKK&date=2026-05-01 \
| grep -o price:€[0-9]
| head -1 | grep -o [0-9])
if [ $PRICE -lt 400 ]; then
echo 发现特价:HEL→BKK 仅需 €$PRICE
fi
4. 多城市搜索
搜索多条航线并选择最便宜的:
bash
for dest in BKK TYO BCN LIS; do
echo === HEL → $dest ===
curl -s https://moltflights.com/api/search?origin=HEL&destination=$dest \
| grep -o price:€[0-9]* | head -1
done
常用 IATA 代码
纽约 | CDG | 巴黎 |
| NRT | 东京成田 | BKK | 曼谷 |
| BCN | 巴塞罗那 | FCO | 罗马 |
| SIN | 新加坡 | DXB | 迪拜 |
| LAX | 洛杉矶 | SFO | 旧金山 |
| BER | 柏林 | AMS | 阿姆斯特丹 |
| IST | 伊斯坦布尔 | LIS | 里斯本 |
不知道代码?使用 moltflights_autocomplete 工具:
bash
curl https://moltflights.com/api/autocomplete?term=bangkok
错误处理
- - 400 — 缺少 origin 或 destination 参数
- 空 data 数组 — 未找到该航线/日期的航班。请尝试其他日期,或省略日期进行灵活搜索。
提示
- - 价格以欧元 (€) 显示
- 结果排序:精确日期匹配优先,然后按价格排列附近日期
- 省略 date 将返回未来整个月内最便宜的航班
- API 免费使用,无需身份验证
- 响应缓存 5 分钟