API Reference
Web Scraping
Scrape Images

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

ParameterTypeRequiredDescription
urlstringYesThe URL to extract images from
timeoutnumberNoTimeout 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

CodeStatusDescription
INPUT_VALIDATION_ERROR400Invalid or missing URL
UNAUTHORIZED401Missing or invalid API key
RATE_LIMITED429Rate limit exceeded
INTERNAL_ERROR500Server error during extraction

Notes

  • Images are extracted after JavaScript rendering, so dynamically loaded images are included.
  • The type field is inferred from the URL or content-type header — it may be null for data URIs.
  • Results are cached for 24 hours. Cached responses still cost 1 credit.
  • SVG images may not have width or height values.