download_image
Download a stock photo from Pexels, Unsplash, or Pixabay, convert it to WebP, optionally resize, and save it to your project. Returns a relative path ready for use in an component.
Instructions
Download an image found via search_images, convert it to WebP, optionally resize it, and save it inside the project (default public/images). Returns the relative path ready for . Always pass trackDownloadUrl when the result came from Unsplash. Only URLs from pexels.com, unsplash.com and pixabay.com are accepted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | downloadUrl field from a search_images result. | |
| quality | No | WebP quality. 80 is the sweet spot for web. | |
| filename | Yes | Descriptive file name without extension, kebab-case (e.g. 'hero-artisan-bread'). Extension .webp is added automatically. | |
| maxWidth | No | Resize down to this width if the original is wider (aspect ratio preserved, never upscaled). | |
| outputDir | No | Relative directory inside the project to save the file. | public/images |
| overwrite | No | Overwrite the file if it already exists. | |
| trackDownloadUrl | No | trackDownloadUrl from an Unsplash result. Required by Unsplash API guidelines when the photo is used. |