Skip to content

Commit 48faf5b

Browse files
authored
Merge pull request #25 from ScrapingBee/feat/make-sdk-up-to-date
[SCR-576] Align SDK with llms.txt: new endpoints, removed endpoints, exhaustive param type hints
2 parents b09dad1 + c33118c commit 48faf5b

13 files changed

Lines changed: 624 additions & 376 deletions

.eslintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
},
66
"extends": [
77
"airbnb-base",
8-
"prettier/@typescript-eslint",
98
"plugin:prettier/recommended"
109
],
1110
"globals": {

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.vscode
22
.idea
3-
node_modules
3+
node_modules
4+
exhaustive-test.js

CHANGELOG.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
# Changelog
22

3-
## [1.8.3](https://github.com/ScrapingBee/scrapingbee-node/compare/v1.8.2...v1.8.3) (2026-06-30)
3+
## [2.0.0](https://github.com/ScrapingBee/scrapingbee-node/compare/v1.8.2...v2.0.0) (2026-08-05)
44

55
### Features
66

7-
- Added Auto-Mode support for the HTML API: pass `mode: 'auto'` (GET only) to let ScrapingBee pick the cheapest scraping config that succeeds, charged only for the winning config. Optional `max_cost` (integer ≥ 1) caps the credits a request may cost. The credits charged are returned in the `Spb-auto-cost` response header.
8-
- Added `mode` and `max_cost` to the `HtmlApiParams` type for autocomplete.
7+
- Added `fastSearch()` method for Fast Search API
8+
- Added `amazonPricing()` method for Amazon Pricing API
9+
- Added `gemini()` method for Gemini API
10+
- Added `youtubeSubtitles()` method for YouTube Subtitles API (replaces the removed `youtubeTranscript()`)
11+
- Expanded param type hints for all endpoints to match the documented API contract (e.g. HTML API `mode`/`max_cost`, Google `pages`/`date_range`/geo/`sort_by`/price filters, Amazon Search `autoselect_variant`, Walmart Search `start_page`)
12+
- Added `tag` optional param (request label) to every endpoint's params type except Usage, including a new `YouTubeMetadataParams` type so `youtubeMetadata()` now accepts a `params` object
13+
14+
### Removed
15+
16+
- Removed deprecated `get()` and `post()` methods (use `htmlApi()` with `method: 'GET'`/`'POST'` instead)
17+
- Removed `youtubeTranscript()` method (endpoint no longer supported; use `youtubeSubtitles()` instead)
18+
- Removed `youtubeTrainability()` method (no longer supported)
919

1020
## [1.8.2](https://github.com/ScrapingBee/scrapingbee-node/compare/v1.8.0...v1.8.2) (2026-01-22)
1121

README.md

Lines changed: 82 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ Signup to ScrapingBee to [get your API key](https://app.scrapingbee.com/account/
2020

2121
- [HTML API](#html-api)
2222
- [Google Search API](#google-search-api)
23+
- [Fast Search API](#fast-search-api)
2324
- [Amazon API](#amazon-api)
2425
- [Walmart API](#walmart-api)
2526
- [YouTube API](#youtube-api)
2627
- [ChatGPT API](#chatgpt-api)
28+
- [Gemini API](#gemini-api)
2729
- [Usage API](#usage-api)
2830

2931
---
@@ -110,7 +112,7 @@ async function post(url) {
110112
const response = await client.htmlApi({
111113
url: url,
112114
method: 'POST',
113-
'username=user&password=pass',
115+
data: 'username=user&password=pass',
114116
params: {
115117
render_js: false,
116118
},
@@ -127,7 +129,7 @@ async function post(url) {
127129
console.log(text);
128130
}
129131

130-
post('https://httpbin.org/post');
132+
post('https://httpbin.scrapingbee.com/post');
131133
```
132134

133135
### Screenshot
@@ -186,6 +188,33 @@ googleSearch('web scraping tools');
186188

187189
---
188190

191+
## Fast Search API
192+
193+
Retrieve a lightweight Google result set optimized for sub-second responses.
194+
195+
```javascript
196+
const { ScrapingBeeClient } = require('scrapingbee');
197+
198+
async function fastSearch(query) {
199+
const client = new ScrapingBeeClient('YOUR-API-KEY');
200+
const response = await client.fastSearch({
201+
search: query,
202+
params: {
203+
page: 1,
204+
country_code: 'us',
205+
language: 'en',
206+
tag: 'my-request',
207+
}
208+
});
209+
210+
console.log(response.data);
211+
}
212+
213+
fastSearch('web scraping tools');
214+
```
215+
216+
---
217+
189218
## Amazon API
190219

191220
Scrape Amazon search results and product details.
@@ -245,6 +274,32 @@ async function amazonProduct(asin) {
245274
amazonProduct('B0D2Q9397Y');
246275
```
247276

277+
### Amazon Pricing
278+
279+
```javascript
280+
const { ScrapingBeeClient } = require('scrapingbee');
281+
282+
async function amazonPricing(asin) {
283+
const client = new ScrapingBeeClient('YOUR-API-KEY');
284+
const response = await client.amazonPricing({
285+
asin: asin,
286+
params: {
287+
domain: 'com',
288+
language: 'en',
289+
zip_code: '10001',
290+
currency: 'USD',
291+
device: 'desktop',
292+
light_request: true,
293+
add_html: false,
294+
}
295+
});
296+
297+
console.log(response.data);
298+
}
299+
300+
amazonPricing('B0D2Q9397Y');
301+
```
302+
248303
---
249304

250305
## Walmart API
@@ -307,7 +362,7 @@ walmartProduct('123456789');
307362

308363
## YouTube API
309364

310-
Scrape YouTube search results, video metadata, transcripts, and trainability data.
365+
Scrape YouTube search results, video metadata, and subtitles.
311366

312367
### YouTube Search
313368

@@ -353,59 +408,67 @@ async function youtubeMetadata(videoId) {
353408
youtubeMetadata('dQw4w9WgXcQ');
354409
```
355410

356-
### YouTube Transcript
411+
### YouTube Subtitles
357412

358413
```javascript
359414
const { ScrapingBeeClient } = require('scrapingbee');
360415

361-
async function youtubeTranscript(videoId) {
416+
async function youtubeSubtitles(videoId) {
362417
const client = new ScrapingBeeClient('YOUR-API-KEY');
363-
const response = await client.youtubeTranscript({
418+
const response = await client.youtubeSubtitles({
364419
video_id: videoId,
365420
params: {
366421
language: 'en',
367-
transcript_origin: 'auto_generated',
422+
subtitle_origin: 'auto_generated',
368423
}
369424
});
370425

371426
console.log(response.data);
372427
}
373428

374-
youtubeTranscript('dQw4w9WgXcQ');
429+
youtubeSubtitles('dQw4w9WgXcQ');
375430
```
376431

377-
### YouTube Trainability
432+
---
433+
434+
## ChatGPT API
435+
436+
Use ChatGPT with optional web search capabilities.
378437

379438
```javascript
380439
const { ScrapingBeeClient } = require('scrapingbee');
381440

382-
async function youtubeTrainability(videoId) {
441+
async function askChatGPT(prompt) {
383442
const client = new ScrapingBeeClient('YOUR-API-KEY');
384-
const response = await client.youtubeTrainability({
385-
video_id: videoId,
443+
const response = await client.chatGPT({
444+
prompt: prompt,
445+
params: {
446+
search: true,
447+
country_code: 'us',
448+
add_html: false,
449+
}
386450
});
387451

388452
console.log(response.data);
389453
}
390454

391-
youtubeTrainability('dQw4w9WgXcQ');
455+
askChatGPT('What are the latest web scraping trends?');
392456
```
393457

394458
---
395459

396-
## ChatGPT API
460+
## Gemini API
397461

398-
Use ChatGPT with optional web search capabilities.
462+
Ask Gemini through ScrapingBee and receive citation objects when available.
399463

400464
```javascript
401465
const { ScrapingBeeClient } = require('scrapingbee');
402466

403-
async function askChatGPT(prompt) {
467+
async function askGemini(prompt) {
404468
const client = new ScrapingBeeClient('YOUR-API-KEY');
405-
const response = await client.chatGPT({
469+
const response = await client.gemini({
406470
prompt: prompt,
407471
params: {
408-
search: true,
409472
country_code: 'us',
410473
add_html: false,
411474
}
@@ -414,7 +477,7 @@ async function askChatGPT(prompt) {
414477
console.log(response.data);
415478
}
416479

417-
askChatGPT('What are the latest web scraping trends?');
480+
askGemini('What are the latest web scraping trends?');
418481
```
419482

420483
---
@@ -475,22 +538,6 @@ client.googleSearch({ search: 'test' })
475538

476539
---
477540

478-
## Legacy Methods (Deprecated)
479-
480-
The `get()` and `post()` methods are deprecated and will be removed in a future version. Please use `htmlApi()` instead.
481-
482-
```javascript
483-
// Deprecated
484-
await client.get({ url: '...' });
485-
await client.post({ url: '...' });
486-
487-
// Use instead
488-
await client.htmlApi({ url: '...', method: 'GET' });
489-
await client.htmlApi({ url: '...', method: 'POST' });
490-
```
491-
492-
---
493-
494541
## Documentation
495542

496543
For more details on all available parameters, visit [ScrapingBee's documentation](https://www.scrapingbee.com/documentation/).

0 commit comments

Comments
 (0)