Scrape Images
Extract all images from any web page with metadata including dimensions, alt text, and format.
Endpoint: GET /v1/web/scrape/images
Credits: 1 per request
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The URL to extract images from |
timeout | number | No | Timeout in milliseconds (default: 30000, max: 60000) |
Response Schema
{
"success": true,
"images": [
{
"src": "https://stripe.com/img/v3/home/social.png",
"alt": "Stripe payment processing",
"width": 1200,
"height": 630,
"type": "png"
},
{
"src": "https://stripe.com/img/v3/home/hero-graphic.svg",
"alt": null,
"width": null,
"height": null,
"type": "svg"
}
],
"url": "https://stripe.com",
"count": 2,
"cached": false,
"credits_used": 1,
"request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Code Examples
cURL
curl -X GET "https://api.orsa.dev/v1/web/scrape/images?url=https://stripe.com" \
-H "Authorization: Bearer YOUR_API_KEY"TypeScript
const result = await client.web.scrapeImages({
url: 'https://stripe.com',
});
console.log(result.count); // 47
console.log(result.images[0].src); // "https://stripe.com/img/..."
console.log(result.images[0].alt); // "Stripe payment processing"Python
result = client.web.scrape_images(url="https://stripe.com")
print(result.count) # 47
print(result.images[0].src) # "https://stripe.com/img/..."
print(result.images[0].alt) # "Stripe payment processing"Error Codes
| Code | Status | Description |
|---|---|---|
INPUT_VALIDATION_ERROR | 400 | Invalid or missing URL |
UNAUTHORIZED | 401 | Missing or invalid API key |
RATE_LIMITED | 429 | Rate limit exceeded |
INTERNAL_ERROR | 500 | Server error during extraction |
Notes
- Images are extracted after JavaScript rendering, so dynamically loaded images are included.
- The
typefield is inferred from the URL or content-type header — it may benullfor data URIs. - Results are cached for 24 hours. Cached responses still cost 1 credit.
- SVG images may not have
widthorheightvalues.