Skip to content

Commit 245f9cc

Browse files
VinciGit00claude
andcommitted
docs(scrape): add screenshot/branding examples, fix stealth credit cost
Add dedicated Python/JS/cURL examples for the `screenshot` and `branding` formats on the Scrape service, including option ranges from the SDK schema. Align stealth cost (+5 credits) across sitemap, markdownify, smartscraper, and CLI docs to match the public pricing page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b13e6fc commit 245f9cc

5 files changed

Lines changed: 125 additions & 4 deletions

File tree

knowledge-base/cli/command-examples.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ just-scrape extract https://store.example.com/shoes \
2222
-p "Extract all product names, prices, and ratings" \
2323
--scrolls 5
2424

25-
# Bypass anti-bot protection (costs +4 credits)
25+
# Bypass anti-bot protection (costs +5 credits)
2626
just-scrape extract https://app.example.com/dashboard \
2727
-p "Extract user stats" \
2828
--stealth

services/markdownify.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ just-scrape markdownify https://example.com/article
7777
| apiKey | string | Yes | The ScrapeGraph API Key (first argument). |
7878
| website_url | string | Yes | The URL of the webpage to convert to markdown. |
7979
| mock | boolean | No | Enable mock mode for testing. Default: false. |
80-
| stealth | boolean | No | Enable anti-detection mode (+4 credits). Default: false. |
80+
| stealth | boolean | No | Enable anti-detection mode (+5 credits). Default: false. |
8181
| wait_ms | number | No | Page load wait time in ms (default: 3000). |
8282
| country_code | string | No | Proxy routing country code (e.g., "us"). |
8383

services/scrape.mdx

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,127 @@ curl -X POST https://v2-api.scrapegraphai.com/api/scrape \
190190
191191
</CodeGroup>
192192
193+
### Screenshot
194+
195+
Capture a screenshot of the page. Use `fullPage` to grab the entire scrollable area, or set `width`/`height` for a fixed viewport. `quality` (1–100) controls JPEG compression.
196+
197+
<CodeGroup>
198+
199+
```python Python
200+
from scrapegraph_py import ScrapeGraphAI, ScreenshotFormatConfig
201+
202+
sgai = ScrapeGraphAI()
203+
204+
res = sgai.scrape(
205+
"https://scrapegraphai.com",
206+
formats=[
207+
ScreenshotFormatConfig(
208+
full_page=True,
209+
width=1440,
210+
height=900,
211+
quality=90,
212+
),
213+
],
214+
)
215+
216+
if res.status == "success":
217+
shot = res.data.results.get("screenshot", {}).get("data", {})
218+
print("URL:", shot.get("url"))
219+
print("Size:", f"{shot.get('width')}x{shot.get('height')}")
220+
```
221+
222+
```javascript JavaScript
223+
import { ScrapeGraphAI } from "scrapegraph-js";
224+
225+
const sgai = ScrapeGraphAI();
226+
227+
const res = await sgai.scrape({
228+
url: "https://scrapegraphai.com",
229+
formats: [
230+
{ type: "screenshot", fullPage: true, width: 1440, height: 900, quality: 90 },
231+
],
232+
});
233+
234+
if (res.status === "success") {
235+
const shot = res.data?.results.screenshot?.data;
236+
console.log("URL:", shot?.url);
237+
console.log("Size:", `${shot?.width}x${shot?.height}`);
238+
}
239+
```
240+
241+
```bash cURL
242+
curl -X POST https://v2-api.scrapegraphai.com/api/scrape \
243+
-H "SGAI-APIKEY: $SGAI_API_KEY" \
244+
-H "Content-Type: application/json" \
245+
-d '{
246+
"url": "https://scrapegraphai.com",
247+
"formats": [
248+
{ "type": "screenshot", "fullPage": true, "width": 1440, "height": 900, "quality": 90 }
249+
]
250+
}'
251+
```
252+
253+
</CodeGroup>
254+
255+
| Option | Type | Default | Range | Description |
256+
|--------|------|---------|-------|-------------|
257+
| `fullPage` | bool | `false` || Capture the whole scrollable page instead of just the viewport. |
258+
| `width` | int | `1440` | `320``3840` | Viewport width in pixels. |
259+
| `height` | int | `900` | `200``2160` | Viewport height in pixels. |
260+
| `quality` | int | `80` | `1``100` | JPEG quality. |
261+
262+
### Branding
263+
264+
Extract a page's brand identity — colors, typography, and logos — in a single call.
265+
266+
<CodeGroup>
267+
268+
```python Python
269+
from scrapegraph_py import ScrapeGraphAI, BrandingFormatConfig
270+
271+
sgai = ScrapeGraphAI()
272+
273+
res = sgai.scrape(
274+
"https://scrapegraphai.com",
275+
formats=[BrandingFormatConfig()],
276+
)
277+
278+
if res.status == "success":
279+
branding = res.data.results.get("branding", {}).get("data")
280+
print(branding)
281+
```
282+
283+
```javascript JavaScript
284+
import { ScrapeGraphAI } from "scrapegraph-js";
285+
286+
const sgai = ScrapeGraphAI();
287+
288+
const res = await sgai.scrape({
289+
url: "https://scrapegraphai.com",
290+
formats: [{ type: "branding" }],
291+
});
292+
293+
if (res.status === "success") {
294+
console.log(res.data?.results.branding?.data);
295+
}
296+
```
297+
298+
```bash cURL
299+
curl -X POST https://v2-api.scrapegraphai.com/api/scrape \
300+
-H "SGAI-APIKEY: $SGAI_API_KEY" \
301+
-H "Content-Type: application/json" \
302+
-d '{
303+
"url": "https://scrapegraphai.com",
304+
"formats": [{ "type": "branding" }]
305+
}'
306+
```
307+
308+
</CodeGroup>
309+
310+
<Note>
311+
Branding costs **25 credits** per call — significantly more than other formats because it runs additional vision and typography analysis on top of the page fetch.
312+
</Note>
313+
193314
### Structured JSON extraction
194315
195316
Use the `json` format to extract structured data during the scrape.

services/sitemap.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ just-scrape sitemap https://scrapegraphai.com
7979
| website_url | string | Yes | The URL of the website to extract the sitemap from. The API will automatically locate the sitemap.xml file. |
8080
| headers | object | No | Optional headers (user agent, cookies, etc.). |
8181
| mock | boolean | No | Enable mock mode for testing. Default: false |
82-
| stealth | boolean | No | Enable stealth mode for anti-bot protection. Adds +4 credits. Default: false |
82+
| stealth | boolean | No | Enable stealth mode for anti-bot protection. Adds +5 credits. Default: false |
8383

8484
<Note>
8585
Get your API key from the [dashboard](https://scrapegraphai.com/dashboard)

services/smartscraper.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ just-scrape smart-scraper https://scrapegraphai.com/ -p "Extract info about the
8282
| output_schema | object | No | Pydantic or Zod schema for structured response format. |
8383
| mock | boolean | No | Enable mock mode for testing. |
8484
| plain_text | boolean | No | Return result as plain text instead of JSON. |
85-
| stealth | boolean | No | Enable anti-detection mode (+4 credits). |
85+
| stealth | boolean | No | Enable anti-detection mode (+5 credits). |
8686
| wait_ms | number | No | Page load wait time in ms (default: 3000). |
8787
| country_code | string | No | Proxy routing country code (e.g., "us"). |
8888

0 commit comments

Comments
 (0)