A command-line tool to easily download images from Unsplash.
You can use this tool without installation via npx:
npx unsplash-dl download "your search query"
Or install it globally:
npm install -g unsplash-dl
Before using this tool, you'll need:
- Node.js >= 14.0.0
- Unsplash API credentials (Access Key and Secret Key)
- Go to https://unsplash.com/developers
- Register/Login to your account
- Create a new application
- Copy your Access Key and Secret Key
First time users will be guided through the configuration process automatically. You can also run the config command manually:
unsplash-dl config
Basic usage:
unsplash-dl download "mountain landscape"
With options:
unsplash-dl download "cats" --count 10 --size full -o ./cat-photos
-
-n, --count <number>
- Number of images to download (default: 5) -
-s, --size <size>
- Image size: small, regular, or full (default: regular) -
-o, --output-dir <path>
- Directory where images will be saved (default: ./unsplash-images)
# Download 3 full-size mountain photos
unsplash-dl download "mountains" -n 3 -s full
# Download 10 cat pictures to a specific directory
unsplash-dl download "cats" -n 10 -o ./cat-photos
# Download 5 regular-size nature photos (default)
unsplash-dl download "nature"
MIT
Contributions are welcome! Please feel free to submit a Pull Request.