letsfg 2026.5.58 → 2026.5.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -104
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
# LetsFG — Your AI agent just learned to book flights. (Node.js)
|
|
2
|
-
|
|
3
|
-
**Server-side search engine. Real prices. One function call.** Search hundreds of airlines at raw airline prices — **$20–$50 cheaper** than Booking.com, Kayak, and other OTAs. Zero dependencies. Built for AI agents.
|
|
4
|
-
|
|
5
|
-
[](https://github.com/LetsFG/LetsFG)
|
|
6
|
-
[](https://www.npmjs.com/package/letsfg)
|
|
7
|
-
|
|
8
|
-
## Two ways to use LetsFG
|
|
9
|
-
|
|
10
|
-
| | **CLI / SDK** (this package) | **Developer API** |
|
|
11
|
-
|---|---|---|
|
|
12
|
-
| **Search cost** | Free (Twitter/X Bearer token via `letsfg auth`) | Prepaid credits |
|
|
13
|
-
| **Booking
|
|
14
|
-
| **Speed** | 60–90 s | 2–5 s (discover) · 60–90 s (full) |
|
|
15
|
-
| **Setup** | `npm install letsfg` then `letsfg auth` | [letsfg.co/developers](https://letsfg.co/developers) |
|
|
16
|
-
|
|
17
|
-
> **Want direct airline URLs without any per-booking fee?** Use the [Developer API](https://letsfg.co/developers) — prepaid credits, results in seconds, no checkout step.
|
|
18
|
-
|
|
19
|
-
## Install
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npm install letsfg
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Quick Start (SDK)
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
import { LetsFG, cheapestOffer, offerSummary } from 'letsfg';
|
|
29
|
-
|
|
30
|
-
// Register (one-time)
|
|
31
|
-
const creds = await LetsFG.register('my-agent', 'agent@example.com');
|
|
32
|
-
console.log(creds.api_key); // Save this
|
|
33
|
-
|
|
34
|
-
// Use
|
|
35
|
-
const bt = new LetsFG({ apiKey: 'trav_...' });
|
|
36
|
-
|
|
37
|
-
// Search — FREE
|
|
38
|
-
const flights = await bt.search('GDN', 'BER', '2026-03-03');
|
|
39
|
-
const best = cheapestOffer(flights);
|
|
40
|
-
console.log(offerSummary(best));
|
|
41
|
-
|
|
42
|
-
// Unlock
|
|
43
|
-
const unlock = await bt.unlock(best.id);
|
|
44
|
-
|
|
45
|
-
// Book
|
|
46
|
-
const booking = await bt.book(
|
|
47
|
-
best.id,
|
|
48
|
-
[{
|
|
49
|
-
id: flights.passenger_ids[0],
|
|
50
|
-
given_name: 'John',
|
|
51
|
-
family_name: 'Doe',
|
|
52
|
-
born_on: '1990-01-15',
|
|
53
|
-
gender: 'm',
|
|
54
|
-
title: 'mr',
|
|
55
|
-
email: 'john@example.com',
|
|
56
|
-
}],
|
|
57
|
-
'john@example.com'
|
|
58
|
-
);
|
|
59
|
-
console.log(`PNR: ${booking.booking_reference}`);
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Quick Start (CLI)
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
export LETSFG_BEARER_TOKEN=<your-bearer-token>
|
|
66
|
-
|
|
67
|
-
letsfg search GDN BER 2026-03-03 --sort price
|
|
68
|
-
letsfg search LON BCN 2026-04-01 --json # Machine-readable
|
|
69
|
-
letsfg unlock off_xxx
|
|
70
|
-
letsfg book off_xxx -p '{"id":"pas_xxx","given_name":"John",...}' -e john@example.com
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## API
|
|
74
|
-
|
|
75
|
-
### `new LetsFG({ apiKey, baseUrl?, timeout? })`
|
|
76
|
-
|
|
77
|
-
### `bt.search(origin, destination, dateFrom, options?)`
|
|
78
|
-
### `bt.resolveLocation(query)`
|
|
79
|
-
### `bt.unlock(offerId)`
|
|
80
|
-
### `bt.book(offerId, passengers, contactEmail, contactPhone?)`
|
|
81
|
-
### `bt.setupPayment(token?)`
|
|
82
|
-
### `bt.me()`
|
|
83
|
-
### `LetsFG.register(agentName, email, baseUrl?, ownerName?, description?)`
|
|
84
|
-
|
|
85
|
-
### Helpers
|
|
86
|
-
- `offerSummary(offer)` — One-line string summary
|
|
87
|
-
- `cheapestOffer(result)` — Get cheapest offer from search
|
|
88
|
-
|
|
89
|
-
## Zero Dependencies
|
|
90
|
-
|
|
91
|
-
Uses native `fetch` (Node 18+). No `axios`, no `node-fetch`, nothing. Safe for sandboxed environments.
|
|
92
|
-
|
|
93
|
-
## Also Available As
|
|
94
|
-
|
|
95
|
-
- **MCP Server**: `npx letsfg-mcp` — [npm](https://www.npmjs.com/package/letsfg-mcp)
|
|
96
|
-
- **Python SDK + CLI**: `pip install letsfg` — [PyPI](https://pypi.org/project/letsfg/)
|
|
97
|
-
- **Try without installing**: [letsfg.co](https://letsfg.co) — search instantly in your browser
|
|
98
|
-
- **GitHub**: [LetsFG/LetsFG](https://github.com/LetsFG/LetsFG)
|
|
99
|
-
|
|
100
|
-
> ⭐ **[Star the repo](https://github.com/LetsFG/LetsFG)** — we appreciate the support.
|
|
101
|
-
|
|
102
|
-
## License
|
|
103
|
-
|
|
104
|
-
MIT
|
|
1
|
+
# LetsFG — Your AI agent just learned to book flights. (Node.js)
|
|
2
|
+
|
|
3
|
+
**Server-side search engine. Real prices. One function call.** Search hundreds of airlines at raw airline prices — **$20–$50 cheaper** than Booking.com, Kayak, and other OTAs. Zero dependencies. Built for AI agents.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/LetsFG/LetsFG)
|
|
6
|
+
[](https://www.npmjs.com/package/letsfg)
|
|
7
|
+
|
|
8
|
+
## Two ways to use LetsFG
|
|
9
|
+
|
|
10
|
+
| | **CLI / SDK** (this package) | **Developer API** |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| **Search cost** | Free (Twitter/X Bearer token via `letsfg auth`) | Prepaid credits |
|
|
13
|
+
| **Booking** | `POST /api/agent-book` — no LetsFG fee | Direct airline URL, no fee |
|
|
14
|
+
| **Speed** | 60–90 s | 2–5 s (discover) · 60–90 s (full) |
|
|
15
|
+
| **Setup** | `npm install letsfg` then `letsfg auth` | [letsfg.co/developers](https://letsfg.co/developers) |
|
|
16
|
+
|
|
17
|
+
> **Want direct airline URLs without any per-booking fee?** Use the [Developer API](https://letsfg.co/developers) — prepaid credits, results in seconds, no checkout step.
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install letsfg
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start (SDK)
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { LetsFG, cheapestOffer, offerSummary } from 'letsfg';
|
|
29
|
+
|
|
30
|
+
// Register (one-time)
|
|
31
|
+
const creds = await LetsFG.register('my-agent', 'agent@example.com');
|
|
32
|
+
console.log(creds.api_key); // Save this
|
|
33
|
+
|
|
34
|
+
// Use
|
|
35
|
+
const bt = new LetsFG({ apiKey: 'trav_...' });
|
|
36
|
+
|
|
37
|
+
// Search — FREE
|
|
38
|
+
const flights = await bt.search('GDN', 'BER', '2026-03-03');
|
|
39
|
+
const best = cheapestOffer(flights);
|
|
40
|
+
console.log(offerSummary(best));
|
|
41
|
+
|
|
42
|
+
// Unlock
|
|
43
|
+
const unlock = await bt.unlock(best.id);
|
|
44
|
+
|
|
45
|
+
// Book
|
|
46
|
+
const booking = await bt.book(
|
|
47
|
+
best.id,
|
|
48
|
+
[{
|
|
49
|
+
id: flights.passenger_ids[0],
|
|
50
|
+
given_name: 'John',
|
|
51
|
+
family_name: 'Doe',
|
|
52
|
+
born_on: '1990-01-15',
|
|
53
|
+
gender: 'm',
|
|
54
|
+
title: 'mr',
|
|
55
|
+
email: 'john@example.com',
|
|
56
|
+
}],
|
|
57
|
+
'john@example.com'
|
|
58
|
+
);
|
|
59
|
+
console.log(`PNR: ${booking.booking_reference}`);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Quick Start (CLI)
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
export LETSFG_BEARER_TOKEN=<your-bearer-token>
|
|
66
|
+
|
|
67
|
+
letsfg search GDN BER 2026-03-03 --sort price
|
|
68
|
+
letsfg search LON BCN 2026-04-01 --json # Machine-readable
|
|
69
|
+
letsfg unlock off_xxx
|
|
70
|
+
letsfg book off_xxx -p '{"id":"pas_xxx","given_name":"John",...}' -e john@example.com
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## API
|
|
74
|
+
|
|
75
|
+
### `new LetsFG({ apiKey, baseUrl?, timeout? })`
|
|
76
|
+
|
|
77
|
+
### `bt.search(origin, destination, dateFrom, options?)`
|
|
78
|
+
### `bt.resolveLocation(query)`
|
|
79
|
+
### `bt.unlock(offerId)`
|
|
80
|
+
### `bt.book(offerId, passengers, contactEmail, contactPhone?)`
|
|
81
|
+
### `bt.setupPayment(token?)`
|
|
82
|
+
### `bt.me()`
|
|
83
|
+
### `LetsFG.register(agentName, email, baseUrl?, ownerName?, description?)`
|
|
84
|
+
|
|
85
|
+
### Helpers
|
|
86
|
+
- `offerSummary(offer)` — One-line string summary
|
|
87
|
+
- `cheapestOffer(result)` — Get cheapest offer from search
|
|
88
|
+
|
|
89
|
+
## Zero Dependencies
|
|
90
|
+
|
|
91
|
+
Uses native `fetch` (Node 18+). No `axios`, no `node-fetch`, nothing. Safe for sandboxed environments.
|
|
92
|
+
|
|
93
|
+
## Also Available As
|
|
94
|
+
|
|
95
|
+
- **MCP Server**: `npx letsfg-mcp` — [npm](https://www.npmjs.com/package/letsfg-mcp)
|
|
96
|
+
- **Python SDK + CLI**: `pip install letsfg` — [PyPI](https://pypi.org/project/letsfg/)
|
|
97
|
+
- **Try without installing**: [letsfg.co](https://letsfg.co) — search instantly in your browser
|
|
98
|
+
- **GitHub**: [LetsFG/LetsFG](https://github.com/LetsFG/LetsFG)
|
|
99
|
+
|
|
100
|
+
> ⭐ **[Star the repo](https://github.com/LetsFG/LetsFG)** — we appreciate the support.
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "letsfg",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.59",
|
|
4
4
|
"description": "Flight search & booking for AI agents. Server-side engine covers hundreds of airlines. Free search via Bearer token or prepaid Developer API. Includes open-source ranking engine.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|