letsfg 2026.5.53 → 2026.5.55
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 +10 -101
- package/dist/chunk-7C3EKQ37.mjs +1768 -0
- package/dist/cli.js +267 -279
- package/dist/cli.mjs +10 -65
- package/dist/index.d.mts +300 -84
- package/dist/index.d.ts +300 -84
- package/dist/index.js +1525 -248
- package/dist/index.mjs +21 -7
- package/package.json +4 -2
- package/dist/chunk-LBHJ4GE4.mjs +0 -487
package/README.md
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
# LetsFG — Your AI agent just learned to book flights. (Node.js)
|
|
2
2
|
|
|
3
|
-
**
|
|
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
4
|
|
|
5
5
|
[](https://github.com/LetsFG/LetsFG)
|
|
6
6
|
[](https://www.npmjs.com/package/letsfg)
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Two ways to use LetsFG
|
|
9
9
|
|
|
10
|
-
| | **
|
|
11
|
-
|
|
12
|
-
| **Search cost** | Free
|
|
13
|
-
| **Booking URL** | 1% concierge fee (min $3) via letsfg.co |
|
|
14
|
-
| **Speed** |
|
|
15
|
-
| **Setup** | `npm install letsfg`
|
|
10
|
+
| | **CLI / SDK** (this package) | **Developer API** |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| **Search cost** | Free (Twitter/X Bearer token via `letsfg auth`) | Prepaid credits |
|
|
13
|
+
| **Booking URL** | 1% concierge fee (min $3) via letsfg.co | 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
16
|
|
|
17
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
18
|
|
|
19
|
-
> ⭐ **[Star the repo](https://github.com/LetsFG/LetsFG) → register → unlimited access forever.** First 1,000 stars only.
|
|
20
|
-
|
|
21
19
|
## Install
|
|
22
20
|
|
|
23
21
|
```bash
|
|
@@ -64,12 +62,9 @@ console.log(`PNR: ${booking.booking_reference}`);
|
|
|
64
62
|
## Quick Start (CLI)
|
|
65
63
|
|
|
66
64
|
```bash
|
|
67
|
-
export
|
|
65
|
+
export LETSFG_BEARER_TOKEN=<your-bearer-token>
|
|
68
66
|
|
|
69
67
|
letsfg search GDN BER 2026-03-03 --sort price
|
|
70
|
-
|
|
71
|
-
# Fast mode — OTAs + key airlines only (~25 connectors, 20-40s)
|
|
72
|
-
letsfg search GDN BER 2026-03-03 --mode fast
|
|
73
68
|
letsfg search LON BCN 2026-04-01 --json # Machine-readable
|
|
74
69
|
letsfg unlock off_xxx
|
|
75
70
|
letsfg book off_xxx -p '{"id":"pas_xxx","given_name":"John",...}' -e john@example.com
|
|
@@ -91,96 +86,10 @@ letsfg book off_xxx -p '{"id":"pas_xxx","given_name":"John",...}' -e john@exampl
|
|
|
91
86
|
- `offerSummary(offer)` — One-line string summary
|
|
92
87
|
- `cheapestOffer(result)` — Get cheapest offer from search
|
|
93
88
|
|
|
94
|
-
### `searchLocal(origin, destination, dateFrom, options?)`
|
|
95
|
-
|
|
96
|
-
Search 200 airline connectors locally (no API key needed). Requires Python + `letsfg` installed.
|
|
97
|
-
|
|
98
|
-
> **Note:** Local search results return masked booking links by default. Each offer includes `offer_ref` and `payment_token` fields. To get a direct airline booking URL, use the **concierge unlock flow** (1% fee, min $3 — no API key needed) or sign up for the **Developer API** at [letsfg.co/developers](https://letsfg.co/developers) for fee-free direct links.
|
|
99
|
-
|
|
100
|
-
```typescript
|
|
101
|
-
import { searchLocal } from 'letsfg';
|
|
102
|
-
|
|
103
|
-
const result = await searchLocal('GDN', 'BCN', '2026-06-15');
|
|
104
|
-
console.log(result.total_results);
|
|
105
|
-
|
|
106
|
-
// Limit browser concurrency for constrained environments
|
|
107
|
-
const result2 = await searchLocal('GDN', 'BCN', '2026-06-15', { maxBrowsers: 4 });
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Unlocking offer results
|
|
111
|
-
|
|
112
|
-
Local search results include `offer_ref` and `payment_token` on each offer. Use these to retrieve the direct airline booking URL via the concierge flow (no API key required):
|
|
113
|
-
|
|
114
|
-
```typescript
|
|
115
|
-
import { searchLocal } from 'letsfg';
|
|
116
|
-
|
|
117
|
-
const result = await searchLocal('GDN', 'BCN', '2026-06-15');
|
|
118
|
-
const offer = result.offers[0];
|
|
119
|
-
|
|
120
|
-
// 1. Initiate checkout — fee = max(price × 1%, $3.00). No API key needed.
|
|
121
|
-
const checkoutRes = await fetch('https://letsfg.co/api/developers/checkout', {
|
|
122
|
-
method: 'POST',
|
|
123
|
-
headers: { 'Content-Type': 'application/json' },
|
|
124
|
-
body: JSON.stringify({
|
|
125
|
-
offer_id: offer.id,
|
|
126
|
-
offer_ref: offer.offer_ref,
|
|
127
|
-
payment_token: offer.payment_token,
|
|
128
|
-
currency: offer.currency,
|
|
129
|
-
price: String(offer.price),
|
|
130
|
-
}),
|
|
131
|
-
});
|
|
132
|
-
const { checkout_url } = await checkoutRes.json();
|
|
133
|
-
|
|
134
|
-
// 2. Present checkout_url to the user (or open it programmatically)
|
|
135
|
-
console.log(`Pay here: ${checkout_url}`);
|
|
136
|
-
|
|
137
|
-
// 3. Poll until payment is confirmed
|
|
138
|
-
async function pollVerify(token: string): Promise<string> {
|
|
139
|
-
while (true) {
|
|
140
|
-
await new Promise(r => setTimeout(r, 3000));
|
|
141
|
-
const res = await fetch(
|
|
142
|
-
`https://letsfg.co/api/developers/payment-verify?token=${token}`
|
|
143
|
-
);
|
|
144
|
-
const data = await res.json();
|
|
145
|
-
if (data.verified) return data.booking_url;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// 4. booking_url is the direct airline link — no further fees
|
|
150
|
-
const bookingUrl = await pollVerify(offer.payment_token);
|
|
151
|
-
console.log(`Book here: ${bookingUrl}`);
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
To skip the per-booking fee entirely, use the [Developer API](https://letsfg.co/developers) — it returns direct airline booking URLs on every search result.
|
|
155
|
-
|
|
156
|
-
### `systemInfo()`
|
|
157
|
-
|
|
158
|
-
Get system resource profile and recommended concurrency settings.
|
|
159
|
-
|
|
160
|
-
```typescript
|
|
161
|
-
import { systemInfo } from 'letsfg';
|
|
162
|
-
|
|
163
|
-
const info = await systemInfo();
|
|
164
|
-
console.log(info);
|
|
165
|
-
// { platform: 'win32', cpu_cores: 16, ram_total_gb: 31.2, ram_available_gb: 14.7,
|
|
166
|
-
// tier: 'standard', recommended_max_browsers: 8, current_max_browsers: 8 }
|
|
167
|
-
```
|
|
168
|
-
|
|
169
89
|
## Zero Dependencies
|
|
170
90
|
|
|
171
91
|
Uses native `fetch` (Node 18+). No `axios`, no `node-fetch`, nothing. Safe for sandboxed environments.
|
|
172
92
|
|
|
173
|
-
## Performance Tuning
|
|
174
|
-
|
|
175
|
-
Local search auto-scales browser concurrency based on available RAM. Override with `maxBrowsers`:
|
|
176
|
-
|
|
177
|
-
```typescript
|
|
178
|
-
// Limit to 4 concurrent browsers
|
|
179
|
-
await searchLocal('LHR', 'BCN', '2026-04-15', { maxBrowsers: 4 });
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Or set the `LETSFG_MAX_BROWSERS` environment variable globally.
|
|
183
|
-
|
|
184
93
|
## Also Available As
|
|
185
94
|
|
|
186
95
|
- **MCP Server**: `npx letsfg-mcp` — [npm](https://www.npmjs.com/package/letsfg-mcp)
|
|
@@ -188,7 +97,7 @@ Or set the `LETSFG_MAX_BROWSERS` environment variable globally.
|
|
|
188
97
|
- **Try without installing**: [letsfg.co](https://letsfg.co) — search instantly in your browser
|
|
189
98
|
- **GitHub**: [LetsFG/LetsFG](https://github.com/LetsFG/LetsFG)
|
|
190
99
|
|
|
191
|
-
> ⭐ **[Star the repo](https://github.com/LetsFG/LetsFG)**
|
|
100
|
+
> ⭐ **[Star the repo](https://github.com/LetsFG/LetsFG)** — we appreciate the support.
|
|
192
101
|
|
|
193
102
|
## License
|
|
194
103
|
|